Questions tagged [android-wear-data-api]

The Wearable Data Layer API, which is part of Google Play services, provides a communication channel for your handheld and wearable devices.

About

The API consists of a set of data objects that the system can send and synchronize over the wire and listeners that notify your apps of important events with the data layer.

Dependencies

  • Android 4.3 (API Level 18) or higher on the handheld device
  • Android 4.4W (API Level 20) or higher on the Android Wear device
  • Google Play services version 5.0 or higher
  • An Android Wear device or Wear AVD

Links

288 questions
0
votes
1 answer

onDataChanged isn´t called on android wear

I want to send just simple Strings from Smartphone to android wear. I looked in this Question before: Unable to push data to android wear (Emulator) and tried to do the same way, but onDataChanged only when i delete the hole App on my Phone, but not…
Halatira
  • 5
  • 3
0
votes
3 answers

How do I transfer an Android asset without blocking the UI thread?

I'm trying to transfer an asset by following the android developer training which says to use this code: @Override public void onDataChanged(DataEventBuffer dataEvents) { for (DataEvent event : dataEvents) { if (event.getType() ==…
0
votes
1 answer

DataAPI synchronization

I'm developing an app that listens to the gps positions on the wear side and write them on a file. As I want to keep this files synced on the handheld side, currently I'm adding the positions to a datamap as they are acquired: private void…
cdlc
  • 323
  • 1
  • 8
0
votes
1 answer

Sending message from Android host device to wear when app is not running

I'm building a simple motivational quote app that generates a random quote from a MySQL database. The app works fine on mobile and I want to sync the quote message to a Wear device. I'm using MessageApi to do so and used this tutorial to set it up:…
Iqen
  • 139
  • 1
  • 9
0
votes
1 answer

Wear App doesn't work if the phone App isn't running or the the phone is locked

I'm working on an android wear app that exchanges some information (using the Wearable Data Layer API) with a another android app installed in the phone device . But if the Phone app is not running or the phone is locked the information cant be…
Hr.SAAD
  • 35
  • 6
0
votes
1 answer

In Android wear, is DataApi and MessageApi sequential?

For example, if I send: MessageApi.send(1) DataApi.putItem(2) MessageApi.send(3) DataApi.putItem(4) Are we guaranteed that they come in at the correct order?
Kamilski81
  • 14,409
  • 33
  • 108
  • 161
0
votes
1 answer

Null Data Item From Wearable.DataApi.getDataItem

My wearable has an Activity that implements DataApi.DataListener, this Activity sends a message in onConnected() to the handheld to update the requested data. When the handheld receives this message, it gets the data from a server, and passes it to…
Bryan
  • 14,756
  • 10
  • 70
  • 125
0
votes
1 answer

Trouble Connecting To Wearable Data Layer

I am trying to connect to the data layer on the wearable device using an Activity that implements DataApi.DataListener. In onStart() the device connects to the Google API Client, and onConnected() is called. From onConnected() I call another method…
Bryan
  • 14,756
  • 10
  • 70
  • 125
0
votes
2 answers

Efficient Way To Get JSON Data To Wearable

I am attempting to read a feed from a URL in the form of a JSON Object, and pass that feed to a Wearable device to display as a list using the Data API. This JSON Object contains an array of objects, each object containing a few elements. Something…
Bryan
  • 14,756
  • 10
  • 70
  • 125
0
votes
0 answers

Android Wear data from phone not saved

When the Android Wear app starts it sends a message to the phone and retrieves the data that is on the watch. The phone then retrieves data from the webservice and executes this method: Wearable.DataApi.putDataItem(mGoogleApiClient,…
Kevin van Mierlo
  • 9,554
  • 5
  • 44
  • 76
0
votes
1 answer

What To Use On Handheld Side To Get Data For Wearable?

I am just getting started on developing an Android Wear companion app for my handheld application. I have been going through the developer documents, and I am looking to get data from the handheld to view on the wearable. I am looking to use a…
Bryan
  • 14,756
  • 10
  • 70
  • 125
0
votes
1 answer

How can I distinguish whether my onDataChanged was triggered by handheld or wear?

How can I distinguish whether my data was edited on my handheld or on my wear? According to the docs: You can listen for the following events with WearableListenerService: onDataChanged() - Called when data item objects are created, changed, or…
Kamilski81
  • 14,409
  • 33
  • 108
  • 161
0
votes
1 answer

Wear DataAPI synchronize only differences of a collection

I am using the Wear DataAPI for the first time now. I couldn't find in the documentaton whether the DataAPI actually checks for differences in the given DataItems everytime you put a "putDataRequest" or just sends over the object you give it. The…
Aeefire
  • 888
  • 10
  • 25
0
votes
2 answers

Is NodeApi specific to Android Wear?

I want to detect the connected Android Wear device in my app. I found the solution here using NodeApi. But the documentation doesn't say anything about that is it specific to Android Wear or not: Exposes an API for to learn about local or connected…
Krupal Shah
  • 8,949
  • 11
  • 57
  • 93
0
votes
0 answers

Android Wear connection with handheld unstable

I'm using a GoogleApiClient in my Android Wear app that in onResume of the main activity connects and when it's connected it messages all connected nodes a message ("startservice" in this case) that my WearableListenerService takes care of. Whenever…
Jonas Borggren
  • 2,591
  • 1
  • 22
  • 40