0

I am trying to launch an Activity form a Wearable device (watch) when a push notification is received on a handheld device.

I read in other questions that I will need to send data over to Wearable, then in the "onDataChanged" event I can build the notification from the wearable device and add a PendingIntent with the desired wearable activity. But in order to do that I will have to initialize and connect a GoogleAPIClient from the intent service on the handheld device that received the push nitification which is the part that I am kind of struggling with. Any help would be appreciated. Thanks.

youssefhg
  • 11
  • 2
  • To Trigger when PUSH notification received, u need to inherit `BroadcastReceiver`and/or [GCM](https://developer.android.com/google/gcm/index.html) & in that use `onReceive()` method to send data to wear. – Vintesh Aug 31 '14 at 19:12

2 Answers2

0

If you're looking for help getting started with the GoogleAPIClient, this may help.

eshayne
  • 915
  • 9
  • 15
  • Thanks @eshayne for your help. I have looked at that link before I ask this question. I think I made it work and I will post the answer shortly. – youssefhg Sep 15 '14 at 18:40
0

Since I am trying to connect the ApiClient from a service that does not run on the UI thread I was able to do that

 mGoogleApiClient = new GoogleApiClient.Builder(context).addApi(Wearable.API).build();
 mGoogleApiClient.blockingConnect(30, TimeUnit.SECONDS);

And it worked fine.

youssefhg
  • 11
  • 2