-
• #2
Maybe just try:
setTimeout(function() { Bangle.showClock(); }, 100);
Bangle.showClock();
callsload()
, andload()
doesn't do anything if called while initialising (so you don't get into boot loops). -
• #3
That works perfectly. Thanks!
I did try using set timeout before I posted here, but I was only using an empty timeout preceding showClock and didn't have showClock inside the timeout.
-
• #4
Do you think this is worth putting on the app loader?
All it does is start Google Assistant's voice prompt on the phone, but I think it could be convenient for certain scenarios like starting navigation or playing a certain song. Especially when combined with apps like Tasker and the"Navigate In Google Maps With Voice" task that asks for a destination and starts navigation all in one go.
Maybe it could have a way to activate it in the background from anywhere, like the tap side feature from Light Switch. Or maybe if combined with Tasker it could send intents (set up beforehand) to the watch using the voice prompt that was initiated from the watch, essentially giving you hands free control of the Bangle.
-
• #5
Right now I'm using a combination of Light Switch with tap side to unlock and then pattern launcher to launch this new
gassist
app. Combined with Tasker, Google Routines, and Smart Lock on the Android phone it's actually a fairly seamless experience already. But a system wide way to initiate it on the Bangle might be convenient.In order for Google Assistant to use Tasker we need give it the "Write Secure Settings" permission through ADB that can be granted or revoked with a helper app on a PC from the main dev of Tasker here.
Google Routines needs to be configured with the starters and actions. For me this is done by opening the
Google
app > profile pic > "Settings" > "Google Assistant" > "Routines".Starter is the word or phrase that initiates the task. Action should contain "Run" or "Start" followed by the name of the task in Tasker followed by "in" or "with" + "tasker".
The Smart Lock can be configured on Android so you don't have to unlock your device when you tell it to start a task.
I have it drafted up in a new branch right now and can do a PR if anyone else will find it useful.
1 Attachment
-
• #6
It also works for starting apps or running code on your bangle by creating a new task in Tasker and adding a "System" action called "Send Intent" and then fill it out following Gordon's guide here for sending intents from Android -> Bangle.
I think this capability is amazing to have on the Bangle and just wanted to share in case others weren't aware or hadn't tried using intents yet like me.
-
• #7
That's great!
I think at minimum having an app that started the voice assistant would be good - but as you say for it to be properly useful you'd want it with the pattern launcher.
I use a clock with 'Clock Info' and a Clock Info that sent the
VOICE_COMMAND
intent would be really handy. Then it'd just be 2 taps on the clock (1 to select, 1 to run).Also worth adding that you could paste something like:
Bangle.on("tap", function(e) { if (e.dir=="front" && e.double) { Bluetooth.println(""); Bluetooth.println(JSON.stringify({ t:"intent", target:"activity", action:"android.intent.action.VOICE_COMMAND", flags:["FLAG_ACTIVITY_NEW_TASK"] })); } })
into the
Custom Boot Code
app so that just by tapping hard-ish on the watch screen twice (even with the watch locked) you can start voice commands -
• #8
Those both sound like really good ideas.
For the clock I imagine we could use the app icon for the image. Do we need text to go with it?
I'll start making a settings menu and boot code file for the front tap. I'm not familiar with how to make clock info modules yet.
-
• #9
I imagine we could use the app icon for the image. Do we need text to go with it?
I don't think you need text, no - just supply an empty string. For the image you just want a 2 color image (ideally) so it might be better to just include that in the clockinfo itself
-
• #10
I just put what I have so far in a new PR. It's not a clock info yet.
-
• #11
The double tap to start is pretty slick.
1 Attachment
-
• #12
In order for Google Assistant to use Tasker we need give it the "Write Secure Settings" ...
I suggest putting these instructions in a gassist readme in some form.
Smart app!
I'm trying to make a super simple app that only sends an android intent over bluetooth and then goes to the clock app.
When uploading to RAM it works as expected, but if I save it to storage as an app and run it from the launcher or Pattern Launcher I get the "Loading..." box in the middle of the screen and it never goes back to the clock app.