android-syncadapter

ListView not updating after web service Sync

白昼怎懂夜的黑 提交于 2019-12-12 01:49:12
问题 I have impelmented SyncAdapter that calls webservice and insert/update database. I would like to show some of this data in ListView so i implemented ListFragment in witch the data is displayed via CursorAdapter . And everything works ok, except when I get new data from web and insert it into database, the CursorAdapter is not updated and new data is not shown in ListView In my ContentProvider , after every insert I call context.getContentResolver().notifyChange(uri, null); This is

SQLite “database schema has changed” error in Content Provider

纵然是瞬间 提交于 2019-12-11 08:42:10
问题 I'm using Content Providers and Sync Adapters for my synchronization routine. My routine receives a JSONObject and insert or update the entry. In order to decide if we are going to update or insert we check if the entry exists in the database. This is where the sqlite error occurs. 06-03 10:58:21.239: INFO/Database(340): sqlite returned: error code = 17, msg = prepared statement aborts at 45: [SELECT * FROM table WHERE (id = ?) ORDER BY id] I have done some research and found this discussion

SyncAdapter's periodic syncs abandonned

允我心安 提交于 2019-12-11 05:58:28
问题 I have an application where I use SyncAdapter to collect some user data and send it to my server (activity tracking application that synchronizes the data with server periodically). I have set it to work every 4 hours and everything was fine. However after 2-3 weeks of running the application, suddenly I have realized that syncs weren't performed for 2 days (on some devices even longer). I have checked the adb shell dumpsys content and I didn't find there entry for periodic sync of my

Why No android.content.SyncAdapter meta-data registering sync-adapter?

家住魔仙堡 提交于 2019-12-11 02:52:54
问题 I am following the SampleSyncAdapter and upon startup, it appears that my SyncAdapter is not configured correctly. It reports an error trying to load its meta-data. How can I isolate the problem? You can see the other accounts in the system that register correctly. Logcat: 12-21 17:10:50.667 W/PackageManager( 121): Unable to load service info ResolveInfo{4605dcd0 com.myapp.syncadapter.MySyncAdapter p=0 o=0 m=0x108000} 12-21 17:10:50.667 W/PackageManager( 121): org.xmlpull.v1

Android CalendarContract, deleting a recurring event causes all events to disappear on calendar?

守給你的承諾、 提交于 2019-12-11 02:46:09
问题 I have a sync adapter that handles syncing calendars and events. I am able to delete normal events just fine. But whenever I delete a recurring event, all the events on my calendar disappear. One thing I noticed is that whenever I deleted a recurring event, the Instances table is emptied, which explains the events disappearing. The Events table is as expected, with the recurring event row deleted from the table. What is causing this? I have tried deleting in the following ways: resolver

Android SyncAdapter: how to get notified of specific sync happened

人盡茶涼 提交于 2019-12-11 01:47:11
问题 I have the following scenario. I use a SyncAdapter in my app to download data from a server. When the user opens the app I call requestSync() to make sure the latest data are available. When the user requests it I call again requestSync() passing a bundle of the specific datum I want to download. The problem is the following: I can use a SyncStatusObserver to get notified about the status of the download, but that will not tell me which sync is completed: For example: at app start I start a

Merging raw contacts

三世轮回 提交于 2019-12-10 23:42:58
问题 I have an account and a sync adapter which add new raw contacts with corresponding private data entries. the contacts I'm creating are phone number based, meaning I'm creating a new entry per existing phone number. How do I merge my raw contact with the existing raw contact that was linked to the existing phone number? I've tried creating a new phone number entry in the data table, and link it to the raw contacts I'm adding. it works, but It's creating a duplication phone number. I've also

Syncing contacts using SyncAdapter ,Working

我与影子孤独终老i 提交于 2019-12-10 18:10:37
问题 I am currently working on a android project in which I want to Sync mobile contacts to server, After researching a lot about SyncAdapter and Creating account in accountmanager , I have learned it myself. however there are two things I don't understand, I searched about these in google but could not get perfect answer. Please don't duplicate the question, I want to know more clearly how it works. As the Google documentation says whenever a sync is done, the dirty flag of the contact gets

Creating an Android background service that continuously polls a REST API for data

你说的曾经没有我的故事 提交于 2019-12-10 17:28:38
问题 I need to write an Android service that polls a server for data, parses the data, and then sends it to an app via intents. The polling must occur frequently (every few seconds). From what I've read, polling like this is not recommended (due to battery life concerns). This is my first time developing in Android, and after doing a lot of research there are a few things that remain unclear to me. I am unsure if a service, sync adapter, or alarm manager would be better suited for my needs. Which

Custom sync not working with Google Account (com.google) on some Samsung devices

爱⌒轻易说出口 提交于 2019-12-10 13:11:47
问题 I implemented a sync task the same way as the BasicSyncAdapter example except with a Google account like in this answer: https://stackoverflow.com/a/2972918/2072569 It works on allmost all devices except for the Samsung SM-P600 (Galaxy Note 2014) with Android 4.4.2 and some other Samsung tablets. My ContentProvider in the Manifest file has a label. This is the cause of this bug according to this post at some Android version of some Samsung tablets. Has Samsung blocked adding sync tasks to a