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
0 answers

Change SyncAdapter in my app for another solution to sync

I already have my app in production, but I want to remove the sync adapter function without affecting the app's functionality. is there any approach in which I don't make a mess with my app? I need to solve this because sometimes the app stay in…
Mmr100
  • 1
0
votes
1 answer

Custom account type for secondary user in Android N

My application provides a custom account type, which can be created via Preferences->Accounts->Add account Everything works as expected. However, when I change to a non-primary user, my custom user account is not on the list, so I cannot create…
0
votes
2 answers

Contacts provider not appears in "google contacts application"

I wrote a Contacts provider. It is quite configurable via "Settings/Accounts", it correctly sync contacts from remote server and these contacts are visible in the "Google contacts" application. But in the setting "Contacts to display" of the "Google…
Ice72
  • 11
  • 1
  • 4
0
votes
1 answer

Microsoft ADAL authentication on Android

I'm trying to create a SyncAdapter for Microsoft calendars and the first step is Authentication. i'm using com.microsoft.aad:adal:2.0.4-alphaand using this code for first authentication: getAuthenticationContext().acquireToken( …
mehdok
  • 1,499
  • 4
  • 29
  • 54
0
votes
2 answers

Do I need to use SyncAdapter for my app?

I am making a social media Android app. The user will require to sign up or login the first time he opens the app. Now, obviously, I want to store that login information so the user doesn't have to login everytime he starts the app. I could simply…
0
votes
0 answers

Calling Sever for Update using android? How to Architecture my Code?

Scenario: I have an application that recieves data from Cloud, the cloud is receives data from Sensors in a fish farm(Internet of things).My job is to recieve data from cloud and update my user interface every second. How do I Architecture? what…
0
votes
0 answers

How application run multiple bound services with same authorities and same account type using Sync Adapter class?

I have customized Odoo Android SDK. https://github.com/Odoo-mobile/framework In the sdk only one Customer service is working using Syncadapter. I have implemented messaging service also. but app can not work both service at a time.I can get either…
0
votes
1 answer

How to launch My app Activity from account icon in contacts

I have an Account Authenticator and Sync Adapter which stored the my app contacts separately into my account. That account icon is also getting displayed for those contacts. But am not getting how to go into an activity once i click the account icon…
pokuri
  • 156
  • 7
0
votes
1 answer

Store several accounts in the AccountManager and include a SyncAdapter

I'm facing the following scenario. My app uses the AccountManager to store the users credentials. It is possible to be logged in more than one account at the same time, similar to what twitter does (you can go to your profile and switch to a…
0
votes
1 answer

using syncadapter every 1 min need to send hit to server using Json get result

I am new to web services topic and same time new to syncadapter. I read about syncadpter from developer site and other websites and get some idea and developed small app using it. In that app using syncadapter every 1 min i display toast.It…
YBDevi
  • 439
  • 5
  • 22
0
votes
2 answers

Should I rely on SOURCE_ID when reading Android Contacts?

I am creating an android contacts app, so I regularly read user's contacts and store them in my app. To do this, I need to rely on some kind of ID so that I know which contact I should update (or add/delete) in my app and Contacts Provider supplies…
zafeiris.m
  • 4,339
  • 5
  • 28
  • 41
0
votes
2 answers

How to setup administrators in Couchdb via Apache's HttpClient (given a curl example)

So I am working on a CouchDB Gui Toolbox for easier maintaining an setting up CouchDB on Android, as Futon is quite uncomfortable on a small mobile device. I wanted to stick to the "org.apache.http.client.*" packages for this which was working out…
chris polzer
  • 3,219
  • 3
  • 28
  • 44
0
votes
0 answers

Multiple sqlite db instances getting created

In one of my Android applications, - I have the SyncAdapter running in a different process, which actually queries the data from sqlite db and pushes the data to server. - SqliteDatabase is singleton and there is only instance of it across the…
Chaitanya
  • 3,399
  • 6
  • 29
  • 47
0
votes
0 answers

Sync Adapter perform sync not called on low internal storage

Have a sync adapter implementation to sync data from server to app. It works fine when there is more than 1 GB internal storage. But if storage is less than 1 GB, Sync Adapter's perform sync is not getting called. Is there a minimum storage space…
0
votes
1 answer

Sync Adapter: How do I force re-sync on a failed sync after device was Off and on again?

I am using sync adapter to sync between my mobile device to my central server. When I add a record to my sqlite DB on the device, I am using requestSync to sync with server and it is working well. Even when there is no internet connection with…
gkinu
  • 81
  • 2
  • 10