1

I have used message api to send messages between multiple android smart watches and a smart phone. I have used wearable listener service to launch the app in phone when the app in smart watch is launched. I have also used capability api to selectively send messages to the connected devices.

Recently, I have come across put data map request to sync data between the devices. I also feel there are more uses and functionalities for these APIs and services.

I would like to know in detail what are message api, wearable listener service, put data map request, capability api etc used for. When should we consider these to use? What are their key functions and advantages? I know my question is broad and any links to read about them would be highly appreciated.

NewOne
  • 401
  • 5
  • 19

2 Answers2

0

I know my question is broad and any links to read about them would be highly appreciated.

You can have a look at these links. I found it useful and added about each in short.

Message API

Wear and handheld device communicates via bluetooth link

Both Wear and Handheld contains DataLayer

Wearable Message api is used to provide access to datalayer for communication

For bidirectional messaging both the handheld and wearable should implement a message sender and listener

Messages can be sent from mobile to Wear or viceversa by means of Googleapi client

DataLayer API

Recommended to use for communication, but not for networking

Can send small pieces of data or large pieces of data which are <=100kb

Use PutMapRequest and DataItem to place data

Data item is data + a unique identifier to identify data in both ends

Use datamap –> by default serialization and de-serialization will be handled

To get notified whenever a data item is deleted, added, or changed in the Data Layer use OnDataChanged()

Divya
  • 543
  • 2
  • 13
  • 20
-3

A simple google search would reveal the following (official) site. There's all the information you'd want:

https://developer.android.com/training/wearables/data-layer/index.html

wickermoon
  • 171
  • 1
  • 10