SyncAdapter


 

  1. SyncAdapter Demo
  2. SyncAdapter Using Parse Backend

 

1. SyncAdapter Demo

Step 1 : Select File -> New -> Project -> Android Application Project. Fill the forms, create “Blank Activity” and click “Finish” button.

Step 2 : Open res -> layout -> activity_main.xml and add following code :

Step 3 : Open src -> package -> MainActivity.java and add following code :

Step 4 : Open src -> package -> Create new class, SyncAdapter.java and add following code :

Step 5 : Open src -> package -> Create new class, SyncAdapterService.java and add following code :

Step 6 : Open src -> package -> Create new class, AuthenticatorActivity.java and add following code :

Step 7 : Open src -> package -> Create new class, AuthenticatorService.java and add following code :

Step 8 : Open src -> package -> Create new class, Authenticator.java and add following code :

Step 9 : Open src -> package -> Create new class, MyContentProvider.java and add following code :

Step 10 : Open res -> xml -> authenticator.xml and add following code :

Step 11 : Open res -> xml -> sync_adapter.xml and add following code :

Step 12 : Open AndroidManifest.xml and add following code :

Step 13 : Open build.gradle(Module: app) and add following code :

ScreenShot:

synacadapter synacadapter_addaccount synacadapter_sync synacadapter_settings synacadapter_addaccount_settings synacadapter_sync_On synacadapter_sync_Off synacadapter_multiple_accounts

Download SourceCode

 

 

2. SyncAdapter Using Parse Backend

Step 1 : Select File -> New -> Project -> Android Application Project. Fill the forms, create “Blank Activity” and click “Finish” button.

Step 2 : Open res -> layout -> activity_main.xml and add following code :

Step 3 : Open src -> package -> MainActivity.java and add following code :

Step 4 : Open src -> package -> Create new class, SyncAdapter.java and add following code :

Step 5 : Open src -> package -> Create new class, SyncAdapterService.java and add following code :

Step 6 : Open src -> package -> Create new class, Authenticator.java and add following code :

Step 7 : Open src -> package -> Create new class, AuthenticatorService.java and add following code :

Step 8 : Open src -> package -> Create new class, SimpleContentProvider.java and add following code :

Step 9 : Open src -> package -> Create new class, DatabaseHelper.java and add following code :

Step 10 : Open src -> package -> Create new class, LoginActivity.java and add following code :

Step 11 : Open src -> package -> Create new class, ParseUtil.java and add following code :

Step 12 : Open src -> package -> Create new class, SyncUtil.java and add following code :

Step 13 : Open src -> package -> Create new class, MyApplication.java and add following code :

Step 14 : Open res -> layout -> authenticator.xml and add following code :

Step 15 : Open res -> layout -> sync_adapter.xml and add following code :

Step 16 : Open AndroidManifest.xml and add following code :

Step 17 : Open build.gradle(Module: app) and add following code :

ScreenShot:

syncadapter_using_parse syncadapter_using_parse_list syncadapter_using_parse-settings syncadapter_parse_user syncadapter_parse_todo

Download SourceCode