0

I tried different ways to pass class object using DataMap but its not correct way. Please suggest any way to pass class object from phone to wear.

Newts
  • 1,354
  • 14
  • 23

2 Answers2

1

You may want to check these SO threads 1 and 2 on how to use DataMap to pass and retrieve the object. The way to access previously stored data is with the DataApi methods. For example, you can get all stored data with Wearable.DataApi.getDataItems().

Community
  • 1
  • 1
abielita
  • 13,147
  • 2
  • 17
  • 59
0

Since you can pass String you can pass serialized object of your class.

So you can use GSON library for object serialization and deserialization.

Andrey Danilov
  • 6,194
  • 5
  • 32
  • 56