Most recent activity
-
That should automatically have installed the Message UI app ("Messages"), which contains music controls.
(I'm assuming you already installed Gadgetbridge on your phone and connected it to your watch)
-
gbmusic
should work if you only want to control media, but maybe have a look at Android Integration first, for more extensive Android support (including music). -
-
I think you're looking for the
lock
event -
I haven't found a way to have the console up when connected to GB.
Instead of connecting to GB, you could send fake messages manually in the console:
GB({"t":"musicinfo","artist":"Some Artist Name","album":"The Album Name","track":"The Track Title Goes Here","dur":241,"c":2,"n":2}) GB({"t":"musicstate","state":"play","position":0,"shuffle":1,"repeat":1})
-
var getData = require('Storage').read('rawData.csv\1');
This only reads chunk 1 of the Storage file, see here for an explanation about those.
You probably want something like this:
var dataFile = require('Storage').readopen('rawData.csv', 'r'); var line = dataFile.readLine(); while (line != undefined) { Bluetooth.println(`<data>\n${line}\n</data>`); line = dataFile.readLine(); } dataFile.erase();
Also:
var memory = require("Storage").getStats();
Shouldn't this be
var memory = require("Storage").getFree();
? -
Actually, we might get away with just making it an attribute, and only calling
Volley.newRequestQueue
for the very first request (and cleaning it up indispose
). That way there is no need to sprinklestop
over all response/error handler code, and we don't need a full-blown singleton class either.Looking at 400-line switch statements makes me itchy though, so I'll try to submit a PR with some refactoring Soon, and include a fix for this.
edit: PR
-
I wonder if it's related to Volley.newRequestQueue - maybe that should just be called once?
I think that's it: looking at this, we should either call
stop()
on the queue once we have a response, or set up a singleton. Otherwise every request leaves a new "thread pool" lying about.If you just need to make a one-time request and don’t want to leave
the thread pool around, you can create theRequestQueue
wherever you
need it and callstop()
on theRequestQueue
once your response or
error has come back, using theVolley.newRequestQueue()
method
described in Sending a Simple Request. But the more common use case is
to create theRequestQueue
as a singleton to keep it running for the
lifetime of your app, as described in the next section.(Calling
stop()
seems by far the easiest solution.)
You can log GadgetBridge messages using the Messages Debug app.
Music state is tricky as there is quite some variety in what info various media players report (and even when). That is e.g. why the watch updates the current music info when it gets a new message, instead of completely throwing away old info. I can definitely see that messing things up when there are multiple player notifications.
I haven't looked at the Gadgedbridge music code, but I'm thinking maybe it could be changed to include the name of the media player.