-
The Pebble App Store (now Rebble App Store) displays a count of the number of times each app has been "favourited".
-
-
I think all that would do is encourage devs to close issues perhaps sooner than they should, or at least be more aggressive closing them.
Perhaps the GitHub icon under the app icon should be a link to the dev's repo?
I've also noticed that people seem to be reporting app bugs to the main Espruino repo. Are you planning to manually tote up the bugs for each app? What if the dev has enabled Issues on their repo and bugs are reported there as well? I know I'd prefer that people report bugs for my app to my repo and not yours! I've recently updated my Readme to that effect.
-
OK, this is weird. My Bangle 2 has my app loaded via the App Loader. If I connect the IDE to the Bangle and run "authentiwatch.app.js" from the device storage, then the SHA256/512 functions are missing:
c=require("crypto") ={ SHA1: function (b) { ... } } >c.SHA512 =undefined >c.SHA1 =function (b) { ... }
However, if I click the "Send to Espruino" with RAM selected, the SHA256/512 functions suddenly exist!
c=require("crypto") =function () { [native code] } >c.SHA512 =function () { [native code] } >c.SHA1 =function () { [native code] }
-
Just wondering: I've updated my watch to 2v10.236 from the 2v10.219 I'm pretty sure it shipped with. Neither of these firmwares appear to have SHA256/512 support, and the SHA1 is slow enough I'm certain it's the JavaScript version.
Both of them are more recent than the 2v10.187 that's in the current emulator, which does support SHA256/512.
Should the current watch firmware have this support?
-
Sounds like you just want to make a settings menu. Read a few options at start up in your app. Allow the user to change them via the settings app
No, entering 2FA token settings on the watch would be a nightmare. You need to accurately type a string of 32 essentially random alphanumeric characters for each token. That's only practical on a phone/tablet or PC. Even better, a phone/tablet/PC usually has a camera for scanning a QR code representing the token.
If you use .writeJSON you'll be good.
I will look into that.
-
-
I've now been advised that my attempt to use the above code in my app is working for reading the settings on the Bangle, but failing when attempting to write updated settings back to the Bangle. My code is:
The feedback was "I get an (nearly) empty authentiwatch.json file (consists of a few zeros)".
I cannot investigate this myself as I have yet to receive my Bangle.
-
-
If the GPS is starting from fresh, it needs to download the almanac and ephemeris data. This takes a minimum 12.5 minutes, assuming no errors. If there are errors, then depending on what data is missing it could be another 12.5 minutes before that data is re-sent. It's quite likely the first fix will take two goes, or 25 minutes. It's down to a bit of luck, really.
-
The setInterval function doesn't need to be anonymous:
function doChime() { ... } let chime = setInterval(doChime, 60 * 1000);
The interval is in milliseconds, so the example is 1 minute intervals. See http://www.espruino.com/Reference#l__global_setInterval
-
I was thinking about this at work today and realized that I was over-complicating things.
While I couldn't see it in GitHub, the only possible conflict could have been the apps.json file, so when I got home tonight I manually copied the latest content from the espruino repo and copied it into mine (keeping a copy of my app entry in a text editor). That unlocked the "Fetch upstream" which completed, then I restored my app entry.
Now I can do those tweaks I wanted to do two nights ago, and hopefully once I submit a pull request and get my entry into the main apps.json file, I won't have this problem again.
-
Thanks for your help - I do appreciate it!
However, when I view the pull request ( https://github.com/andrewgoz/BangleApps/pull/1 ), there is no "Resolve Conflicts". The bottom of the page looks like:
It appears I can't resolve this using the web interface! I tried clicking on "Use the command line" but I'm puzzled by the example commands referring to your repo and not mine.
It's after midnight here now and I don't want to make things worse. I'll try again tomorrow night. Thanks again for your help.
-
This is what I'm seeing:
The first image is my repo landing page and to date I've been clicking the "Fetch upstream" button. It normally "just works", but now it's showing "Open pull request" as shown.
The second image is what I get when I click "Open pull request". Last night I tried to create a draft pull request (the "Update repo #1"), but I couldn't make sense of what I was seeing. I thought a draft request would be discarded, but it seems draft requests are quite permanent!
For the third image I've just clicked on the "Files changed" tab. The fourth image is that page scrolled down a bit.
I don't know if those help at all. I can't see anything that looks like a conflict??!! Everything just looks like typical everyday additions and deletions. I have no idea what it's complaining about.
-
I'm new to Github and not really sure what I'm doing. I'd hoped to make a couple of tweaks to the app that I'm developing tonight, but when I got to Github and attempted to do my usual "fetch upstream" to keep things up to date, it told me there was a conflict.
I've poked around and tried to figure out what the problem was. I got to a point where I appear to need to download git and start using command-line instructions(!), which seems ridiculous as I've been using the GitHub web interface exclusively so far.
My repo is at https://github.com/andrewgoz/BangleApps
I suspect the problem is another app got added to the main apps.json, and that change conflicts with my addition. I've tried to manually edit my apps.json, but the conflict remains.
I don't know what to do. Any advice would be appreciated.
-
After a lot of random poking about, I finally found it! https://github.com/espruino/Espruino/tree/master/libs/js/banglejs
-
I know that several days ago I found a module called Scroller that acted as a scroll-y menu thingy.
I evaluated it for use in my app, but found it unsuitable because I couldn't redraw arbitrary menu items from a timer.
I'd like to check it again, but I can't remember how I found it in the first place, and I can't seem to find it again now. Can someone point me in the right direction?
-
What my code is doing is iterating over every pixel of the character and looking for 'empty' pixels that have two 'full' pixels that are at 90deg to each other relative to the 'empty' pixel. It then draws sub-pixels in the scaled-up 'empty' pixel to smooth out the stair-step effect created by the naïve scaling.
It's really only good for smoothing out monochrome things, like bitmapped fonts, not images in general.
Quick set of sample images: https://imgur.com/a/KUDrfPQ
The vector font is a good for a lot of cases, and it might be a better option for my immediate requirements.
-
While developing my current Bangle app, I needed to use a larger font. In my case, the built-in 6x15 font, scaled x2. As expected, it looked a bit rough. I wondered if there was some way to automatically smooth things out without generating a 12x30 font and I came up with the proof-of-concept program below.
In short, it adds extra pixels in black squares that have two adjacent white squares forming a 'corner'.
It draws some sample text three times: the top is the base x1 scale text. Next is the xN native scaled-up rendering. The last is my smoothed scaled-up xN rendering, using the x1 render as the source.
Tapping on the screen will cycle through the 7-bit ASCII characters. When all the characters are cycled, the scale increases by 1 and the characters start again.
It's a bit slow, so would be better off implemented in C.
Do what you like with it. I think it could reduce the need for large fonts.
// B -> is drawn as // // BBBB // ??? BBB WBBB // WB? -> BB WBB WWBB // ?W? WB WWB WWWB // // source -> x2 x3 x4 // // W=white // B=black // ?=any function process(x, y, dx, dy, scale, ox, oy) { var s, sx, sy; s = scale - 1; ox += x * scale; oy += y * scale; if (g.getPixel(x, y) != g.getColor()) { ox += (dx > 0) ? s : 0; oy += (dy > 0) ? s : 0; if (g.getPixel(x, y + dy) == g.getColor() && g.getPixel(x + dx, y) == g.getColor()) { for (sx = 0; sx < s; sx++) { for (sy = 0; (sx + sy) < s; sy++) { g.setPixel(ox - sx * dx, oy - sy * dy, g.getColor()); } } } } else { g.fillRect(ox, oy, ox + s, oy + s); } } var ch = 33; var scale = 2; function draw() { var i, s = ""; for (i = 0; i < 5; i++) { s += String.fromCharCode(ch); ch++; if (ch == 127) { break; } } g.clear(); g.setFontAlign(-1, -1, 0); g.setFont6x15(1); g.drawString(s, 2, 2, true); g.setFont6x15(scale); g.drawString(s, 2 + scale, 20, true); for (var y = 2; y < 15; y++) { for (var x = 2; x < 35; x++) { process(x, y, 1, 1, scale, 0, 90); process(x, y, -1, 1, scale, 0, 90); process(x, y, 1, -1, scale, 0, 90); process(x, y, -1, -1, scale, 0, 90); } } if (ch == 127) { ch = 33; scale++; } } Bangle.on('touch', (zone, e) => { draw(); }); draw();
-
OK. Thanks for your help. I'll just summarize all this for future reference:
function loadSettings() { Util.showModal("Loading..."); Puck.eval(`require("Storage").read(${JSON.stringify("myapp.json")})`,data=>{ Util.hideModal(); try { settings = JSON.parse(data); } catch { settings = defaultSettings; } }); } function saveSettings() { Util.showModal("Saving..."); Puck.write(`\x10require("Storage").write(${JSON.stringify("myapp.json")},${JSON.stringify(settings)})\n`,()=>{ Util.hideModal(); }); }
-
Thanks. There is quite a bit to learn! Writing then seems straightforward:
Util.showModal("Saving..."); Puck.write(`\x10require("Storage").write(${JSON.stringify("myapp.json")},${JSON.stringify(settings)})\n`,()=>{ Util.hideModal(); });
However, the documentation implies that Storage.read/write are different and not compatible with StorageFile.read/write, so the example read code using StorageFile is inconsistent with using Storage.write. From my reading of the Puck code, the callback of Puck.write doesn't take any arguments, so I'm guessing the following WONT work:
Util.showModal("Loading..."); Puck.write(`\x10require("Storage").read(${JSON.stringify("myapp.json")})\n`,data=>{ Util.hideModal(); settings = JSON.parse(data); });
This is rather confusing. It's a shame I can't see a way to try this with the emulator. I think I'll have to be patient and wait for the actual Bangle to turn up.
-
I've been working on my Bangle app and got to the point where I need to handle its configuration. I need to be able to read its current configuration, have the user modify it, then write it back.
I started with the Data Storage Tutorial. In the interface.html file (which I can seem to get going - that's a separate issue) the code references Util.readStorageFile() and Util.eraseStorageFile().
Going to the interface.js source I found that there is no Util.writeStorageFile(). Hopefully that's not too hard to add?
-
I've been trying to develop an interface page to configure my Bangle (2) app. The App Loader at https://github.com/espruino/BangleApps#appsjson-interface-element says that a "Download From App" link will appear, but I can't see anything. I can't see anything like that for any of the official apps either.
Should this be working? Do I need to connect the App Loader to an actual device? In which case I don't have one (yet) - I've been working exclusively with the emulator thus far.
-
Yes - g.theme / g.setTheme:)
Thanks - I knew I'd seen something somewhere, but couldn't remember.
g.setTheme
is not documented?BTW, the example data structure for
g.theme
repeatsfg
/bg
instead of referring tofg2
/bg2
/fgH
/bgH
.I can see cases where someone might want to do something a bit different
I know it's tempting to try to be as flexible as possible, but there is also value in enforcing consistency. In this case, using my phone as an example, status widgets have only ever appeared at the top, and I've never felt they needed to appear anywhere else :)
I also don't think there is a good reason to have variable-sized widgets. What if some authors can't be bothered to implement support for variable sizes? If they do, will they need to supply multiple-sized images if they use images? What if there's a mix of variable and fixed-size? It seems overly complicated to me. I say - put your foot down and set the size at 24! ;-)
Confirmed fixed - thanks again!