Syncing a REST service with an android app

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-04 03:29:12
jcwenger

Definitely go with SyncAdapter. Follow instructions here: Why does ContentResolver.requestSync not trigger a sync?.

To do SyncAdapter, you'll also need to make an Account/AccountAuthenticator as well, so your SyncAdapter knows how to login to your service -- Unless it truly is the Google Finance APIs, in which case all you need to do is apply the right permissions in the manifest so that it will use the account settings already on the phone.

You didn't link the article you mentioned that discussed crashes, but I know it, and it's actually talking about Accounts -- Which yes, you do need to be careful with.

Checkout https://github.com/sschendel/SyncManagerAndroid-DemoGoogleTasks.

Demonstrates setting up sync of Google Task API data to local SQLite db.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!