Put your app account in Auto-Sync settings android

我的梦境 提交于 2019-12-13 04:57:18

问题


I am new on this so i do not find the answer on the internet or i am not sure if the answer is that. What i am trying to do is to make my app sync all the contacts in the native contact app like whatsapp or facebook does. I also wanted to link contacts. Any hint or tutorial would be great.

Something like this:

What are the benefits of putting my app over there? I am very new on this. Please I hope an answer do not vote down D:. Any answer is welcome.


回答1:


Account Manager requires several key api's to work with your app.

Just to show your App account

  • Authenticator Activtiy which extends AbstractAccountAuthenticator
  • Service Activity which Bind's with Authenticator
  • An xml file in RES/XML folder
  • Some Settings in Android Manifest.

Read this https://www.finalconcept.com.au/article/view/android-account-manager-step-by-step

To Auto Sync your Account;

  • SyncAdapter Class which extends AbstractThreadedSyncAdapter
  • SyncService which extends Service
  • an xml file , which defines metadata for SyncAdapter
  • Permission in Android Manifest
  • Optionally Content Provider Class

Offical Android Developer Tutorial https://developer.android.com/training/sync-adapters/index.html

Another Fully Detailed answer (With Examples) : Android Login - Account Authenticator vs Manual Authentication



来源:https://stackoverflow.com/questions/34364101/put-your-app-account-in-auto-sync-settings-android

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