android-syncadapter

Own sync adapter for Android?

白昼怎懂夜的黑 提交于 2019-11-28 02:49:15
The press release of Android 2.0 states that the new release supports sync adapters so that emails and calendars cannot only be synced with gmail and exchange. However, there is no information available online how to write such a sync adapter. Has anyone tried it and some example code available? white_gecko These two articles by Sam Steele (January 23rd, 2010) are about the implementation of the last.fm sync adapter. Do not miss the second part and the opensource projects that are mentioned at the end of the articles. http://www.c99.org/2010/01/23/writing-an-android-sync-provider-part-1/ http:

ContentResolver.addPeriodicSync interval round up

倖福魔咒の 提交于 2019-11-28 01:27:06
My sync adapter does work perfectly well except for one little thing which bugs the sh*t out of me for the last few hours... For my app i want the sync adapter to run with an interval of 10 seconds. ContentResolver.addPeriodicSync(mAccount, AUTHORITY, Bundle.EMPTY, 5); What happens is that the sync starts every 60 seconds instead of the requested 5 seconds. When i change the interval to 70 seconds then the sync starts every 70 seconds. From the log file: W/ContentService﹕ Requested poll frequency of 5 seconds being rounded up to 60 seconds. Or, to be sure that the ContentService is taking

Prevent network sync loop when syncing from network in Android ContentProvider

戏子无情 提交于 2019-11-27 17:28:20
I'm writing my own ContentProvider which will be synced to a web service using a SyncAdapter. Problem happens when the sync adapter is modifying the content provider's data the provider triggers a network sync when internally calling getContentResolver().notifyChange causing a sync loop. The notifyChange with the network sync flag is required for when a client application does the modification but should be avoided when the sync adapter is modifying. How can one, inside a contentprovider, easly tell if it's being used by a client application (which should trigger network sync upon modification

Show settings under accounts & sync menu for android app

时间秒杀一切 提交于 2019-11-27 10:37:42
问题 I am implementing a syncadapter for an android app and would like to make the settings for the account available under the "Accounts & sync" menu. I have seen this done in the DropBox app(as shown below), but I have not been able to find documentation on how to do this. I have the accounted added, just want to add a link to the account settings in this menu. 回答1: In your Android Manifest, you should have a section like this to define your account authenticator: <service android:name=

How to add whatsapp like options to contact whenever the is a new contact added to Contacts

北战南征 提交于 2019-11-27 09:07:59
I develop an app which needs to do 2 things: Create a user account (like WhatsApp). Whenever there is a new contact entry, if the contact is using my app, then immediately in the Contacts application show options "call" or "message" in the contact detail page. Example You need to create a SyncAdapter , this is basically a service that is able to sync contacts to/from a server, like Google does for Google Contacts , you can set it to be notified when a new contact is added, and have your SyncAdapter add the needed info to the contact so it'll show links to your app. If you go to your phone

How do I use the Android SyncAdapter?

可紊 提交于 2019-11-27 09:06:21
问题 I try to understand the Android synchronization logic. What I don't understand is the file syncadapter.xml contained in the Android SDK sample project SampleSyncAdapter . If you downloaded the SDK samples it should be in the following folder: SDK/android-sdk-PLATFORM/samples/android-VERSION/SampleSyncAdapter/res/xml/syncadapter.xml I read, the authority of a content provider should be a string or a reference to a resource. What exactly is the content authority and where is com.android

How does one listen for progress from Android SyncAdapter?

强颜欢笑 提交于 2019-11-27 03:32:22
问题 I recall reading about a broadcast receiver interface from the sync adapter or some ResultReceiver of sync progress events. Is there something built into the SyncAdapter pattern or is it home-grown? 回答1: What works: The method suggested in a 2010 Google IO session, Developing Android REST client applications is to place columns into your ContentProvider as tags to indicate that a record is being fetched or placed or etc. This allows a per-row spinner (or other visual change) to be placed in

Prevent network sync loop when syncing from network in Android ContentProvider

南楼画角 提交于 2019-11-26 18:59:52
问题 I'm writing my own ContentProvider which will be synced to a web service using a SyncAdapter. Problem happens when the sync adapter is modifying the content provider's data the provider triggers a network sync when internally calling getContentResolver().notifyChange causing a sync loop. The notifyChange with the network sync flag is required for when a client application does the modification but should be avoided when the sync adapter is modifying. How can one, inside a contentprovider,

How to add whatsapp like options to contact whenever the is a new contact added to Contacts

心已入冬 提交于 2019-11-26 14:31:50
问题 I develop an app which needs to do 2 things: Create a user account (like WhatsApp). Whenever there is a new contact entry, if the contact is using my app, then immediately in the Contacts application show options "call" or "message" in the contact detail page. Example 回答1: You need to create a SyncAdapter , this is basically a service that is able to sync contacts to/from a server, like Google does for Google Contacts , you can set it to be notified when a new contact is added, and have your

SyncAdapter without a ContentProvider

有些话、适合烂在心里 提交于 2019-11-26 12:02:28
问题 I want to implement a SyncAdapter for a content I want to synchronize with a server. It seems that to do so, you need a ContentProvider registered for the authority you specify in the SyncAdapter XML property file. As I don\'t want this content to be accessible to the rest of the phone, I haven\'t implemented my own ContentProvider and used a personal implementation to store this content. Do you know if it is possible to provide a synchronization using a SyncAdapter without providing a