The next step on Wearables

barx

Well-Known Member
Licensed User
Longtime User
So, with the release of the NotificationBuilder v3 library which adds functionality to to do all things Notifications wise on the Wear devices, it's time to move onto the next step.

To me the obvious next step is getting an app running on the Wear device directly. So that is what I am now looking into. From what I have read so far, most (if not all apps) will require communication between

Handheld device app <-> Wear device app
To do this a new library is needed to add support for the Wear data sync layer. Therefore, that is what I am now concentrating on. I can see it being tricky to test / debug but we'll just have to see how it goes.

Wish me luck guys...
 

barx

Well-Known Member
Licensed User
Longtime User
On a mission this weekend to try figure how to get an app to install on the Wear. Obviously I can install direct to the avd but getting the handheld to auto install the Wearable part will be a good step.

It's impossible to test libraries like data layer if you can't get an app running on the Wearable...
 

aaronk

Well-Known Member
Licensed User
Longtime User
Hi Barx,

What's the status on the data side of things.. did you end up working out how to do this?
I am wanting to transfer data between my LG G Watch and my app.

If I start a wear SDK on my computer and I run my app in debug mode it comes up on the wear SDK on my computer, but wonder if there is a way to push it to my real wear device rather then running it in the SDK?

Maybe a Wear B4A-Bridge app needs to be created that can run on the wear device and then the IDE can connect direct to the wear device while developing apps for it, then we can test the app using a real wear device rather then using a virtual version on my computer.
 

barx

Well-Known Member
Licensed User
Longtime User
Hi Barx,

What's the status on the data side of things.. did you end up working out how to do this?
I am wanting to transfer data between my LG G Watch and my app.

If I start a wear SDK on my computer and I run my app in debug mode it comes up on the wear SDK on my computer, but wonder if there is a way to push it to my real wear device rather then running it in the SDK?

Maybe a Wear B4A-Bridge app needs to be created that can run on the wear device and then the IDE can connect direct to the wear device while developing apps for it, then we can test the app using a real wear device rather then using a virtual version on my computer.

You can connect B4A direct to the watch by enabling USB Debugging. This is done much the same as on newer phones. Go to settings and tap away on Build number, etc to enable developer options. Then if you connect watch to pc with USB cable B4A will install the app to the watch (and take photos etc). You will probably need to sort drivers out for watch. in the end I ended up installing as a google device for my samsung watch. This step will get you up and running with UI and core development but obviously no data transfer between phone and watch. This is no complete solutions as there is then no way to share the app. Wear devices have no access to a market, they have to packaged within a standard phone app. This bit I have managed to accomplish so we are getting there slowly.

The data comms layer I have started a library which is quite complicated as it uses Google Play services and there is quite a bit to it. With the Wear platform being very new, there is very little documentation to follow so that isn't helping. I would hazard a guess (without doing any testing) that I'm about 60% done with the library. I keep chipping away at it in the bit of spare time I get each evening. I'm hoping is won't be long now.

Lastly there is the issue of UI guide lines. Google state that there is an 'unofficial' UI library for Wear. Something I only managed to find yesterday and haven't spent much time looking at. It may just be a matter of replicating the effects in B4A (animations and such and styling existing views) or it may require a wrapper library. For now I'm concentrating on the data so at least we can get working apps up and running.

Hope this helps
 

barx

Well-Known Member
Licensed User
Longtime User
Today I hit a small milestone, I have got enough of the data layer library working to be able to send message back and forth. I feel it is not the end of the headaches but it is a good step for me. To be continued...
 

aaronk

Well-Known Member
Licensed User
Longtime User
Today I hit a small milestone, I have got enough of the data layer library working to be able to send message back and forth. I feel it is not the end of the headaches but it is a good step for me. To be continued...
Can't wait to try it out..

What type of data can you send? Can you send a image from a phone/tablet to the watch using it, or only just ASCII messages etc?
 

barx

Well-Known Member
Licensed User
Longtime User
Can't wait to try it out..

What type of data can you send? Can you send a image from a phone/tablet to the watch using it, or only just ASCII messages etc?

There are 3 main ways to send data:

Messages - one way 'send and forget' message < 100kb
DataItem - Can contain many data types, string, Int, arrays, etc. DataItems are kept in sync, either side can edit the data and a DataChanged event is triggered on the opposing side.
Asset - Large objects created from Bitmap or File.

So far only messages are working but with that comes the fact that the data connection is working (the important bit). I have written the classes with the methods for DataItem and Asset just need to test and fix if not working lol.
 

aaronk

Well-Known Member
Licensed User
Longtime User
Sounds good.

I want to be able to have a label on the device and a label on the watch and when I press a button on the wear device (watch) to update the label text on the watch as well as when I press a button on the my device to then update the label on the wear device.

I am guessing I would need the DataItem part of the lib.
 

barx

Well-Known Member
Licensed User
Longtime User
You could in theory do it with messages. Watch > phone then Phone < watch but yes, it would probably suit a DataItem better as the devices will keep the item in sync.
 

aaronk

Well-Known Member
Licensed User
Longtime User
Hi Barx,

How is this lib going ?
I am really wanting to send data between my app and watch, even if it's just with the 'messages' part for now.

Have you had much luck getting the other parts working ?
 

barx

Well-Known Member
Licensed User
Longtime User
Thought I had the DataMap working yesterday. I could add the DataMap to the synchronized connection and I got the event to say that had been added but when I tried to retrieve the data back out on the other side I was getting a few issues. I finally fixed it last night but didn't have time to test. I have literally just run a few tests and it seems to be working now. So that is messages and DataMaps ok (I think). I will release a beta shortly so you can play with these features. Just need to clean up the demo, which will be required to show how to code it in B4A.
 

barx

Well-Known Member
Licensed User
Longtime User
Well I cleaned up the demo projects and just needed to do 1 more if Al test on them as I had changed a few bits. Then it was ready for beta release. Only gone any left my laptop at work. Hopefully I will find half hour at work tomorrow to upload. Sorry
 

barx

Well-Known Member
Licensed User
Longtime User
keep an eye on this thread for progress.....

All in good time!
 
Top