android-wear-data-api

Android Wear sending data to Android phone, but phone appears to never receive it

百般思念 提交于 2019-11-30 20:49:39
Short Summary: I am attempting to send data from an Android Wear watch to an Android phone using PutDataRequest and GoogleApiClient. Logs seem to show the data is sent successfully, but onDataChanged never fires. I am using Android Studio 1.0.2. I am not using any emulator but an Android Wear watch I own--which I have paired and enabled debugging via the Android Wear device and the Android Wear application on the phone. On both the phone and wear's AndroidManifest.xml, I include com.google.android.gms.version. On the Android Phone (4.4.4 version of Android), I use a listener service, which is

Read underlying color/light data from Android Wear heart rate sensor?

删除回忆录丶 提交于 2019-11-30 15:37:36
问题 I'd like to read the heart rate sensor data on an Android Wear smartwatch. The documentation makes it seem like the heart rate sensor only reports two things: Heart rate (in beats per minute) Either an accuracy measure or an error code Is it possible to get the Android Wear heart rate sensor's underlying data, i.e., the amount of red light (or green or blue light) at any point in time, which it uses to determine when the heart beats? The Instant Heart Rate app gets color data from the camera

How to use DataItem of Android Wear

丶灬走出姿态 提交于 2019-11-30 15:07:11
问题 I want to sync preference between handhelds and wearables. I implement sample code on handheld app. PutDataMapRequest dataMap = PutDataMapRequest.create("/count"); dataMap.getDataMap().putInt(COUNT_KEY, count++); PutDataRequest request = dataMap.asPutDataRequest(); PendingResult<DataApi.DataItemResult> pendingResult = Wearable.DataApi .putDataItem(mGoogleApiClient, request); System.out.println(dataMap.getDataMap().getInt("COUNT_KEY"));//print 3 And then implement below code on wearable app.

How to use DataItem of Android Wear

寵の児 提交于 2019-11-30 12:52:13
I want to sync preference between handhelds and wearables. I implement sample code on handheld app. PutDataMapRequest dataMap = PutDataMapRequest.create("/count"); dataMap.getDataMap().putInt(COUNT_KEY, count++); PutDataRequest request = dataMap.asPutDataRequest(); PendingResult<DataApi.DataItemResult> pendingResult = Wearable.DataApi .putDataItem(mGoogleApiClient, request); System.out.println(dataMap.getDataMap().getInt("COUNT_KEY"));//print 3 And then implement below code on wearable app. But saved count can't be retrieved. PutDataMapRequest dataMap = PutDataMapRequest.create("/count"); int

Sending data from an Activity to WearableListenerService

橙三吉。 提交于 2019-11-30 09:42:14
When I read about communication between an Activity and Service , I found that we can use either IBinder Messenger AIDL I am interested in the first two. So when I tried implementing this to communicate between an Activity and WearableListenerService , I needed to override the onBind function. But then, I am getting a compiler error saying it cannot override final method "onBind" I dont get such an error when I use a normal Service . So, 1. Does that mean we cannot use IBinder or Messenger approach to communicate with the WearableListenerService from an Activity ? 2. If so, what is the next

Sending data from an Activity to WearableListenerService

久未见 提交于 2019-11-29 14:46:26
问题 When I read about communication between an Activity and Service , I found that we can use either IBinder Messenger AIDL I am interested in the first two. So when I tried implementing this to communicate between an Activity and WearableListenerService , I needed to override the onBind function. But then, I am getting a compiler error saying it cannot override final method "onBind" I dont get such an error when I use a normal Service . So, 1. Does that mean we cannot use IBinder or Messenger

WearableListenerService onMessageReceived is not called on device

陌路散爱 提交于 2019-11-29 13:55:11
I am trying to send a simple message from my Android wear app to my phone app using the Wearable.MessageApi . This is my onConnected callback from GoogleApiClient on the Wear device. final PendingResult<Status> status = Wearable.DataApi.addListener(googleApiClient, this); status.setResultCallback(new ResultCallback<Status>() { @Override public void onResult(Status status) { if (!status.isSuccess()) { return; } NodeApi.GetConnectedNodesResult nodes = Wearable.NodeApi.getConnectedNodes(googleApiClient).await(); for (Node node : nodes.getNodes()) { System.out.println("Sending message: " + node

Android Wear Data Items

半世苍凉 提交于 2019-11-28 20:58:12
I'm trying to figure out how to sync some data from the phone to the Android Wear device and I've read the article on developer.android.com on Data Items however I'm still not clear on exactly how to use them. Specifically where each code segment (the GoogleApiClient, the Sync, and the Listen) should be implemented both where in the flow of the app code and on which device, phone or wear, or both. Link to developer.android.com page Maciej Ciemięga Have you looked at the samples for API 20? There is a nice demonstration of DataApi usage in DataLayer sample located here: {android-sdk-root}

Unable to push data to android wear (Emulator)

无人久伴 提交于 2019-11-28 19:34:54
I have been trying to push data to the android wear emulator. But all in vain. My listener on the emulator is not receiving any calls whatsoever. If anyone else has tried working on wear and pushing data to wear please HELP. This is what my receiver code looks like private GoogleApiClient mGoogleApiClient; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_qrcode_generation); mGoogleApiClient = new GoogleApiClient.Builder(this) .addApi(Wearable.API) .addConnectionCallbacks(this) .addOnConnectionFailedListener(this

WearableListenerService onMessageReceived is not called on device

浪子不回头ぞ 提交于 2019-11-28 07:55:53
问题 I am trying to send a simple message from my Android wear app to my phone app using the Wearable.MessageApi . This is my onConnected callback from GoogleApiClient on the Wear device. final PendingResult<Status> status = Wearable.DataApi.addListener(googleApiClient, this); status.setResultCallback(new ResultCallback<Status>() { @Override public void onResult(Status status) { if (!status.isSuccess()) { return; } NodeApi.GetConnectedNodesResult nodes = Wearable.NodeApi.getConnectedNodes