Ziad Halabi
Ziad Halabi

Reputation: 866

Android wear developing for different watches and os

I developed an Android wear app that communicates with my mobile app by sending and retrieving messages. A GoogleApiClient is being created and the wear retrieves the node and sends messages to it. I tested it on a Samsung Gear watch and a Nexus 5 and everything works fine. However, when I ran it on a Motorola Moto 360 watch, the communication was having a lot of issues. The messages were not always received on both sides. I would like to know if there anything that I should note on developing an Android Wear app when it comes to different Watch operating systems. What possible reasons could have caused this behaviour.

EDIT:

1- In the Wearable App (WApp) there is a global GoogleApiClient (client) object. The WApp runs a WearableListenerService. In this service's onCreate, it checks if the client is null, it initialise it. The WApp's MainActivity does the same thing, it checks if the client is null, it initialised it. In the onConnected function of the client, the app retrieves connected nodes and saves its id. The WApp's service implements ConnectionCallBack and has onMessageReceived function that receives messages from the phone and broadcast them to the MainActivity.

2- The mobile App (MApp) has a service that extends WearableListenerService . In its onCreate, it initialise a GoogleApiClient.

Upvotes: 0

Views: 125

Answers (1)

Wayne Piekarski
Wayne Piekarski

Reputation: 3232

There should be no differences in terms of communication using the Data Layer API on any Android Wear device, it should be quite consistent. It provides a high level abstraction so you do not need to worry about these things.

You will need to provide more information about the issues you are experiencing.

Upvotes: 1

Related Questions