diff --git a/apps.json b/apps.json index 6f29c83e0..62e7da66b 100644 --- a/apps.json +++ b/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} + ] } ] diff --git a/apps/findphone/ChangeLog b/apps/findphone/ChangeLog new file mode 100644 index 000000000..9297fc6c7 --- /dev/null +++ b/apps/findphone/ChangeLog @@ -0,0 +1 @@ +0.01: First Version \ No newline at end of file diff --git a/apps/findphone/README.md b/apps/findphone/README.md new file mode 100644 index 000000000..870847222 --- /dev/null +++ b/apps/findphone/README.md @@ -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 diff --git a/apps/findphone/app-icon.js b/apps/findphone/app-icon.js new file mode 100644 index 000000000..95a73755e --- /dev/null +++ b/apps/findphone/app-icon.js @@ -0,0 +1 @@ +require("heatshrink").decompress(atob("mEwwkCkQA/AEp0JCxkgC5KJMUpYXMgf/AA0wC5sPC4/wC/4XhxAXXwQXtlBIJC5URC4QwIC5PxFgQXT/QUCC6fwC4ZgIC5E/+EYCgJ4JC4/zwfwhAXTnGIC9pHXO66nY//4a63xFYTvUiJeCC6cAOxQXNFxIXllAWIC5oAKC+EDC48wC5oAKC9EBiAXokBGJgQXLMBQWMAH4AZA=")) \ No newline at end of file diff --git a/apps/findphone/app.js b/apps/findphone/app.js new file mode 100644 index 000000000..bbabdd38a --- /dev/null +++ b/apps/findphone/app.js @@ -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); +} \ No newline at end of file diff --git a/apps/findphone/app.png b/apps/findphone/app.png new file mode 100644 index 000000000..70d891396 Binary files /dev/null and b/apps/findphone/app.png differ