mirror of https://github.com/espruino/BangleApps
Merge pull request #391 from v1nc/find-phone
New App: Find Phone - find your phone via GadgetBridgepull/401/head
commit
92c517e22f
14
apps.json
14
apps.json
|
@ -1661,5 +1661,19 @@
|
|||
{"name":"beebclock.app.js","url":"beebclock.js"},
|
||||
{"name":"beebclock.img","url":"beebclock-icon.js","evaluate":true}
|
||||
]
|
||||
},
|
||||
{ "id": "findphone",
|
||||
"name": "Find Phone",
|
||||
"shortName":"Find Phone",
|
||||
"icon": "app.png",
|
||||
"version":"0.01",
|
||||
"description": "Find your phone via Gadgetbridge. Click any button to let your phone ring. 📳",
|
||||
"tags": "tool,android",
|
||||
"readme": "README.md",
|
||||
"allow_emulator": true,
|
||||
"storage": [
|
||||
{"name":"findphone.app.js","url":"app.js"},
|
||||
{"name":"findphone.img","url":"app-icon.js","evaluate":true}
|
||||
]
|
||||
}
|
||||
]
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
0.01: First Version
|
|
@ -0,0 +1,9 @@
|
|||
# Find Phone
|
||||
|
||||
Ring your phone via GadgetBridge if you lost it somewhere.
|
||||
|
||||
1. Enable HID in settings
|
||||
2. Connect GadgetBridge
|
||||
3. Lose phone
|
||||
4. Open app
|
||||
5. Click any button or screen
|
|
@ -0,0 +1 @@
|
|||
require("heatshrink").decompress(atob("mEwwkCkQA/AEp0JCxkgC5KJMUpYXMgf/AA0wC5sPC4/wC/4XhxAXXwQXtlBIJC5URC4QwIC5PxFgQXT/QUCC6fwC4ZgIC5E/+EYCgJ4JC4/zwfwhAXTnGIC9pHXO66nY//4a63xFYTvUiJeCC6cAOxQXNFxIXllAWIC5oAKC+EDC48wC5oAKC9EBiAXokBGJgQXLMBQWMAH4AZA="))
|
|
@ -0,0 +1,33 @@
|
|||
var storage = require('Storage');
|
||||
|
||||
//notify your phone
|
||||
function find(){
|
||||
Bluetooth.println(JSON.stringify({t:"findPhone", n:true}));
|
||||
}
|
||||
|
||||
//init graphics
|
||||
g.clear();
|
||||
require("Font8x12").add(Graphics);
|
||||
g.setFont("8x12",3);
|
||||
g.setFontAlign(0,0);
|
||||
g.flip();
|
||||
|
||||
//init settings
|
||||
const settings = storage.readJSON('setting.json',1) || { HID: false };
|
||||
|
||||
//check if HID enabled and show message
|
||||
if (settings.HID=="kb" || settings.HID=="kbmedia") {
|
||||
g.setColor(0x03E0);
|
||||
g.drawString("click to find", g.getWidth()/2, g.getHeight()/2);
|
||||
|
||||
//register all buttons and screen to find phone
|
||||
setWatch(find, BTN1);
|
||||
setWatch(find, BTN2);
|
||||
setWatch(find, BTN3);
|
||||
setWatch(find, BTN4);
|
||||
setWatch(find, BTN5);
|
||||
|
||||
}else{
|
||||
g.setColor(0xf800);
|
||||
g.drawString("enable HID!", g.getWidth()/2, g.getHeight()/2);
|
||||
}
|
Binary file not shown.
After Width: | Height: | Size: 973 B |
Loading…
Reference in New Issue