Question

I just started to look into the SDK for SmartWatch, if I look in the example source all the code relates to the SmartWatch itself.

But how do one interact from an Android app?

Is there a code example here?

How can I send data from my Android application to the SmartWatch.

a) send data every x seconds?

b) send data when tapping on the SmartWatch?

EDITED: I have an normal Android app XYZ already on Play. I make a new extension for my SmartWatch. Now I have two apps in Play. How can I now change my XYZ app to talk to my new extension. The extension I implemented was the SampleWidgetDemo. Let's say I now want to change SampleWidgetDemo and display some text that originates from my app XYZ. How can I send some text from my app XYZ app? And also if I tap my watch how can I request data from my app XYZ?

Im missing a code example that I have to integrate into my XYZ app. And also the code sample to retrieve a text from my XYZ app, initiated from my extension while tapping.

Thanks!

Was it helpful?

Solution

There is nothing stoping you intergrating the Smartwatch extention stuff into a standard app. Just add the nessasary service etc in with your normal app and away you go. Without my code to consult I can't be sure but I don't remember there being any places where the two come together apart from in the manifest file.

How you make your current app and the smartwatch bit of it interact really depends what your app is dong and what you want to achieve. Personaly I have a service doing most of the work that my main activity or the smartwatch stuff interact with. I also have some shared data in Singoltons that I use.

The complication comes when both are active simultaniously. My methodology is that the smartwatch code and my main activity make requests of the service and the service broadcasts state update information that gets picked up by anything that is displaying the state. So I request start but don't show started state till I get the started message back.

If you want the two apps to be seperate the you need to do the comunication using standard Android means e.g. Intents, ContentProviders, Services, BroadcastRiecivers etc. What is best depends what you want to do...

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top