Questions tagged [android-syncadapter]

An Android service that synchronizes data between an Android device and a server

A SyncAdapter is an Android Service that synchronizes data between an Android device and a backend server. SyncAdapters can be part of an Android program, or can be a standalone entity. SyncAdapters are associated with an Account, which defines a collection of data that belongs to a specific application.

The purpose of a SyncAdapter is to ensure that data is kept consistent on the Android device and a server. When the data is changed on the server, the SyncAdapter must identify that a change has been made, and update the data on the Android device to reflect the change.

The most common type of data that is synchronized using SyncAdapters are your Contacts list. Whenever you add a contact on your phone, the contact is also sent to the Google server and stored within. Similarly, if you add a contact from a different Google service, such as GMail, the SyncAdapter will identify that a contact has been added, and replicate the data onto your Android device.

Any type of data can be synced with a backend server, its only dependent on the type of data that your application is dealing with. Other common data types to be synced in this way are Calendars and To-Do/Task lists.

The reason why SyncAdapters exist is to create a local copy of the data, so that it can be accessed quickly without the need for a data connection. For example, if your contacts are kept synced, then you can access your contacts quickly on your Android device regardless of whether you have data access or not - it's all locally-stored data independent from network requirements.

SyncAdapters will usually send a 'check' message to the server on a periodic basis, say every 30 minutes, to ask whether any changes have been made during this time. This is only a small data exchange, and doesn't consume much network data. Further 'synchronization' steps only occur if the data has changed and needs to be updated on the Android device accordingly.

SyncAdapter Class Reference

606 questions
-1
votes
1 answer

syncadapter android developers has errors parsing in eclipse

I am following android developers tutorial on syncadapters and i have the following error in the syncadapter.xml inside /res/xml/. [2014-05-22 15:37:07 - InSituApp] res/xml/ syncadapter.xml: Invalid file name: must contain only…
-2
votes
1 answer

Auto Syncing JSON data in Android for a Blog

i have been working on getting Json data from a blog, parsing it (using the google volley library and Glide for loading the Images) and displaying it in a Linear Recycler View + Card Views, i then stored the post in an SQlite database. The blog is…
EdgeDev
  • 2,376
  • 2
  • 20
  • 37
-2
votes
1 answer

onPerformSync() method is not getting called

I have implemented SyncAdapter using dummy account, but when I go to Settings --> Accounts --> MyApp, Sync is OFF there. I want this to sync automatically in 24 hours. How can I achieve this.
Mayank Sharma
  • 35
  • 3
  • 11
-2
votes
3 answers

How to get contact id after add a new contact in android?

I use following code for new contacts added to phone. private static void addContact(Account account, String name, String username,String phone,String email) { Log.i(TAG, "Adding contact: " + name); ArrayList
stacktry
  • 324
  • 3
  • 24
-2
votes
1 answer

how to make onPerformSync on Android syncadapter when network is available and content provider data changes?

While implementing the android developers tutorial on sync adapters, http://developer.android.com/training/sync-adapters/creating-sync-adapter.html i ended up with the following code on my activity: Activity.java // Constants // The authority…
-3
votes
2 answers

application android contact sync

**hi, I am looking for application (apk) or php api can sync android contact with my database mysql ,i want to sync every custmer in my site (database) to my phone contact thinks,
1 2 3
40
41