[英]Is 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?

是否有任何示例顯示Parse的用法,其中本地存儲(即SQLite DB)是主存儲,如果有更新需要更新/提交的更新,則數據僅在Parse和本地存儲之間同步?

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


  • _id (a unique integer key for this table)
  • _id(此表的唯一整數鍵)
  • item (a String describing the task)
  • item(描述任務的String)
  • desc (a String with a longer description - may be null)
  • desc(具有更長描述的字符串 - 可以為null)
  • parent (an integer indicating the _id of this task's parent)
  • parent(一個整數,表示此任務的父級的_id)

and Date:


  • _id (a unique integer key for this table)
  • _id(此表的唯一整數鍵)
  • item_id (a foreign key which corresponds to _id in Tasks) date (a date stored in long format)
  • item_id(與任務中的_id對應的外鍵)date(以長格式存儲的日期)

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.

編輯:我收到了Parse工程師的回復,他說可能(與本地SQLite數據庫同步),但它不受支持,並且沒有評論我提出的方法 - 特別是將行映射到ParseObjects。

2 个解决方案



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 would act as any other REST service that would provide data, so I don't see any problems.




Actually, now there is a simple library for Parse <=> sqlite integration. Check out

實際上,現在有一個簡單的Parse <=> sqlite集成庫。查看



粤ICP备14056181号  © 2014-2021