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
0
votes
1 answer

SyncAdapter not showing up in settings menu

I am trying to setup SyncAdapter with google account. I did everything like in tutorials, but still my adapter is not visible in settings menu. So here is my android manifest:
0
votes
1 answer

Make a 2 way contact sync adapter

Hello dear Stackoverflowers ! I work on a CardDAV sync source for Android 2.3.3, and I don't understand a think. I read carefully the document about samplesyncadaptater, which works only for reading contacts from distant serveur. But in my case, I'm…
Kiwy
  • 340
  • 2
  • 10
  • 43
0
votes
1 answer

Syncadapter for more than one account type

Is it possible to have a syncadapter for several account-types? (e.g. com.google and com.facebook.auth.login) It seems the syncadapter.xml just accepts a single value like:
0
votes
2 answers

How to use SyncAdapter for an app that doesn't require authentication

I need a way to keep data updated on my app. I read about SyncAdapter and saw that it requires an AbstractAccountAuthenticator, but my app doesn't require the user to fill any user/password information. How can I deal with this?
juliano.net
  • 7,982
  • 13
  • 70
  • 164
-1
votes
1 answer

Sync adapter definition

Although I have implemented sync adapters and I can describe what a sync adapter is, I wanted to find the definition of it. I did not find it. Here I found a description that is clear but it is not a definition. Is there, somewhere, a formal…
kingston
  • 11,053
  • 14
  • 62
  • 116
-1
votes
1 answer

Is there any way to know who is calling the sync adapter?

I have Content provider and sync adapter in my project. In my project first i'm going to fetch data from server and then i'm storing it in my database sqlite. Now i'm coming to my issue. Actually i want to change the server data according to the…
Dinesh S
  • 139
  • 2
  • 13
-1
votes
1 answer

Best way to start a task when connectivity is available again? (API 24 or higher)

As mentioned in Android 7.0 changes, apps targeting Android API 24 or higher do not receive CONNECTIVITY_ACTION broadcasts if they declare their broadcast receiver in the manifest. I implement a sync adapter to check and synchronized pending data…
lukaspp
  • 1,059
  • 10
  • 15
-1
votes
1 answer

Launch My application From Native Contact App in Android API 23

I am trying to link all the contacts in the phone with my application . and then launch my application from contact app. In api < 23 it works fine. But in api >23 the contacts get duplicated .so let me know anyone tried this !!.. Here is what i…
gStephin
  • 332
  • 3
  • 20
-1
votes
1 answer

passing value another activity

I made a WeatherSyncAdapterClass, I create a method and get the latitude and longitude value from GPS. public void getGPS(){ Context context = WeatherSyncAdapter.super.getContext(); gps = new GpsTrack(context); if (gps.canGetLocation())…
-1
votes
1 answer

How to use sync adapter with content provider.?

I want to implement sync adapter in my app to a specific data frequently. The documentation provided in the developer site seems hard to understand for me. Kindly help me to do this. Thanks in advance.
-1
votes
1 answer

Android AccountManager :Which account is being used?

I am using android account manager for my app. It allows multiple accounts and every account has it's own specific data. What I want to know is; How to determine which account is being used by account manager Is there a way to set specific account…
-1
votes
1 answer

Sync Adapter not calling onCreate

Do we need to start the Sync Adapter service or framework starts implicitly? I have put a log on Constructor, onCreate, onDestroy of Sync Adapter service and when I start the app, I don't see the logs in the logcat. But when I do on activity…
-1
votes
1 answer

Android: Adding SyncAdapters to existing Account

I want to split up functionality from a bigger SyncAdapter to the corresponding Apps. Therefore i now have a single App which contains the Authenticator and a SyncAdapter which syncs core data. The plan is now, that other Apps also contain…
cwiesner
  • 934
  • 1
  • 8
  • 24
-1
votes
2 answers

How to disable mail syncing for Google account in Android programmatically?

I am using AccountPicker to add a Google account in my device. Once it is added, I want to disable the syncing through code. I am able to stop contacts syncing for that account using the following code. ContentResolver.setSyncAutomatically(account,…
Vivek
  • 1,823
  • 1
  • 19
  • 39
-1
votes
1 answer

Online Storage Android App

I am to build an android app that needs a central cloud storage (along with some server coding). My app is somewhat in the footsteps of https://play.google.com/store/apps/details?id=com.justyo I mean i should be able to store a login and…
1 2 3
40
41