-
• #2
Writing Code in Bangle IDE (or VSCode)
Upload to Bangle or emulator.
repeat.When finished: commit to repo, push.
Ah forgot: For testing notifications, I switch the BT connection from PC to phone for the test OR simulate the message in the code (from doc):
GB({"t":"notify","id":1592721712,"src":"WhatsApp","title":"Sample Group: Sam","body":"This is a test WhatsApp message"})
-
• #3
this is interesting, it was some time ago here on the forum:
https://github.com/diesphink/banglejs2-files-watcher
I haven't tested it yet.
-
• #4
The web IDE has "watch & upload".
-
• #5
Yes. But how do you use an app with 3+ files in the web IDE?
And how do you send the test notification in the web IDE? -
• #6
ah, now I understand. Interesting problem. I never had changes to more than one file. It is possible to connect more than one web IDE window/tab to a Bangle - one for each file. However I didn't try it so I can't say whether this is really working or not.
-
• #7
Now I see. You're just loading the one file that you change, and all the other files stay untouched in the memory? I didn't get it.
-
• #8
Yes. But how do you use an app with 3+ files in the web IDE?
You can open 3x Web IDE windows connected to the same watch usually :)
And how do you send the test notification in the web IDE?
You can just paste the
GB(...)
commands into the left-hand side of the IDE. Some example commands are listed at http://www.espruino.com/Gadgetbridge#messages-sent-to-bangle-js-from-phoneThe nice thing about faking it is if there are any errors, they get displayed in the IDE console where you can pick them up :)
-
• #9
I see. But it does not work on the emulator, does it?
I get errors like "export" is not defined... And the emulator switches to a whit screen with an image: "Loading..." "2c12 Emulated".But I get it. First test in the IDE, then push to the repo.
-
• #10
I see. But it does not work on the emulator, does it?
Yes, it will do - but you have to have all the relevant parts installed in the emulator, which is a real pain. Definitely worth just using a real device for.
I get errors like "export" is not defined...
That's what happens when you upload an library and it tries to run the library as if it was an app. Generally I'd just issue
load()
in the LHS of the IDE right after, but if you're doing it a lot you can go to IDEsettings -> communications -> Load after saving
and change it to something other than 'load the just-uploaded file'.
What is your workflow to test an app? I think I'm doing it wrong. I do:
I'm messing with the 'messages' app, so I need to test notifications from gadgetbridge