Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is Parse.com an appropriate service for backup/sync with SQLite in Android?

The example apps and documentation I've seen so far seems to use Parse as the primary (if not only) storage solution for the app, which is great in some situations.

I'm looking to integrate Parse with an existing application of mine on Android, which uses multiple SQLite tables in a single database.

Are there any examples which show usage of Parse, where local storage (i.e. the SQLite DBs) is the primary storage, and data is only sync'd between Parse and local storage if there are newer changes which need updating/committing?

For my database, I have two tables, Tasks and Dates. Tasks is formed of:

  • _id (a unique integer key for this table)
  • item (a String describing the task)
  • desc (a String with a longer description - may be null)
  • parent (an integer indicating the _id of this task's parent)

and Date:

  • _id (a unique integer key for this table)
  • item_id (a foreign key which corresponds to _id in Tasks) date (a date stored in long format)

In this instance, would I store each row as a separate ParseObject? Having different classes for Task and Date, and I could link Dates with their Task parents? Is this the recommended way?

--

Edit: I received a reply from an engineer at Parse who said that it's possible (to sync with a local SQLite DB), but that it's not supported, and didn't comment on the method I proposed - specifically mapping rows to ParseObjects.

like image 959
ataulm Avatar asked Dec 17 '12 18:12

ataulm


1 Answers

I have been thinking on similar lines but there is not adapter or library that implements the sync. So, you would have to implement it from scratch. Seeing as your schema is pretty straight-forward, it shouldn't be too difficult.

Is the solution is appropriate: in your scenario parse.com would act as any other REST service that would provide data, so I don't see any problems.

like image 183
Mandar Limaye Avatar answered Sep 25 '22 23:09

Mandar Limaye