Tuesday, December 12, 2017

Android Wear (Finally)



So, I left this project alone for a while, then started it up again yesterday, and now, it just works.
I'll attribute this to problems with knowing if the updated code actually makes it onto the watch.
Maybe a restart caused the new code to run.

I have it running both as a watchface and as a complication.  Downside to the complication is vibration alerts don't work.   Alerts are good.  Also, I can't see it if I look quickly.

The watchface design, leaves allot to be desired for now, but that's on me.

Again, not sure why this works now.  Maybe the watch OS got updated...
My last change was to shutdown the ble connection every few minutes and force the watch to reconnect.  I'm hoping this forces the app to stay "awake", which it appears to do.  It's good for about 12 hours, I can probably improve that by leaving the ble up longer, but who knows at what point the device will go to sleep...  Other downside to the watch, it's only good to about 35% of battery and it doesn't alert when the battery level is low, it just dies.

Also, I did away with the Sweetblue api's and wrote the bluetooth from scratch.  There was too much going on there that I couldn't follow.

12/29 update
Getting up to 15 hours of use now.  Have to remember to turn WIFI off, sometimes it defaults to on after a restart.  Works reliably for days.  Can also run the battery down closer to zero.
Currently, stopping and restarting the Service that holds my Bluetooth intent every 10 minutes(this is in the code).
Somewhere between 10 and 15 minutes is the tipping point, where Bluetooth becomes unusable after several hours.

2/25 update
Looks like watch firmware improved, no longer having WIFI turn on.  Battery life is 30+ hours(on the device, not the watch).