5

Currently i have an application that creates 2 types of models (let's call them A and B).
A has a 1:N relationship with B, and right now i have a database implemented in both the handheld and the wearable to store those models.

The problem is, I need both of those data storage synchronised and I'm not entirely sure how to accomplish this. I have seen many docs referring to the dataApi where they suggest that you save your data in a DataItem object, which will get synchronised each time the wear connects.
What I'm not 100% sure about this approach is:

  • Is DataApi a reliable data storage? (enough to replace SQLite Database in both handheld and wear)
  • Can the DataApi support search operations (for example, all B objects that object A has)? and if so, how can you do that search?
  • Considering that each DataItem corresponds to an entity, is there a limit in how many DataItems can i save?

Documentation on the subject seems a bit lacking at the moment, so i'm not sure if DataApi is the correct implementation i need or if i have to send raw data in a message to sync databases.

EricDS
  • 476
  • 3
  • 13

1 Answers1

0

For first question

Is DataApi a reliable data storage? (enough to replace SQLite Database in both handheld and wear)

The DataApi is not recommended for a complete replacement for SQLite database as said in the SO answer https://stackoverflow.com/a/34137544/6452886

Community
  • 1
  • 1
Madhan
  • 555
  • 5
  • 23
  • Hello @Madhan, thanks for the reply. At the end I used the following approach: serializing/deserializing database objects and sending them between devices using the Wearable Message API (each device manages it's own SQLite database and the messages are used for synchronization). – EricDS Nov 12 '16 at 04:44