Improve app handling

Unify writing
master
Marco H 2022-07-07 21:24:47 +02:00
parent 1c2ca29f3f
commit cf1f2119cc
3 changed files with 16 additions and 17 deletions

View File

@ -1,14 +1,14 @@
# A-GPS Data # A-GPS Data
Load assisted GPS (AGPS) data directly to the watch using the new http requests on Android GadgetBridge. Load assisted GPS (A-GPS) data directly to your Bangle.js using the new http requests on Android GadgetBridge.
Will download AGPS data in background (if enabled in settings). Will download A-GPS data in background (if enabled in settings).
Make sure: Make sure:
* your GadgetBridge version supports http requests * your GadgetBridge version supports http requests
* turn on internet access in GadgetBridge settings * turn on internet access in GadgetBridge settings
Currently proof of concept on Bangle2 only. Currently proof of concept on Bangle.js 2 only.
## Creator ## Creator
[@pidajo](https://github.com/pidajo) [@pidajo](https://github.com/pidajo)

View File

@ -5,11 +5,11 @@ function display(text1, text2) {
if (img) { if (img) {
g.drawImage(img, g.getWidth() - 48, g.getHeight() - 48 - 24); g.drawImage(img, g.getWidth() - 48, g.getHeight() - 48 - 24);
} }
g.setFont("Vector", 20); g.setFont("Vector", 18);
g.setFontAlign(0, 1); g.setFontAlign(0, 1);
g.drawString(text1, g.getWidth() / 2, g.getHeight() / 3 + 24); g.drawString(text1, g.getWidth() / 2, g.getHeight() / 3 + 24);
if (text2 != undefined) { if (text2 != undefined) {
g.setFont("Vector", 15); g.setFont("Vector", 12);
g.setFontAlign(-1, -1); g.setFontAlign(-1, -1);
g.drawString(text2, 5, g.getHeight() / 3 + 29); g.drawString(text2, 5, g.getHeight() / 3 + 29);
} }
@ -22,15 +22,14 @@ Bangle.loadWidgets();
Bangle.drawWidgets(); Bangle.drawWidgets();
function start() { function start() {
display("Updating data..."); display("Updating A-GPS...");
require("agpsdata") require("agpsdata").pull(function() {
.pull(function() { display("Success", "AGPS data updated."); }, display("A-GPS updated.", "touch to close");
Bangle.on("touch", () => { load(); });
},
function(error) { function(error) {
display("Error:" + error, "touch to retry"); display("Error:" + error, "touch to retry");
Bangle.on("touch", () => { Bangle.on("touch", () => { start(); });
start();
});
}); });
} }
start(); start();

View File

@ -1,9 +1,9 @@
{ "id": "agpsdata", { "id": "agpsdata",
"name": "A-GPS Data", "name": "A-GPS Data",
"shortName":"AGPS Data", "shortName":"A-GPS Data",
"icon": "agpsdata.png", "icon": "agpsdata.png",
"version":"0.02", "version":"0.02",
"description": "Download assisted GPS (AGPS) data directly to watch", "description": "Download assisted GPS (A-GPS) data directly to your Bangle.js",
"tags": "boot,tool,assisted,gps,agps,http", "tags": "boot,tool,assisted,gps,agps,http",
"allow_emulator":true, "allow_emulator":true,
"supports": ["BANGLEJS2"], "supports": ["BANGLEJS2"],