android-syncadapter

Splitting sqlite files for syncing

蹲街弑〆低调 提交于 2021-02-19 07:49:06
问题 I am writing an Android app that collects data from sensors and stores it in a local SQLite database. What I'd like to do is sync this data (read: upload) with a backend application (I am using Android's Sync Adapter for this). Since the data can be acquired during the sync process, I think it is reasonable to set the maximum size for the sqlite file to say 700 Kb (doesn't really matter), so the sync adapter will synchronise those 700 Kb files (via POST request) excluding the active one. And

Why does the sync adapter won't work if android storage space running out

心不动则不痛 提交于 2020-08-09 08:25:40
问题 In my android application I have configured a periodic syncing using sync adapter, and its working fine except if the android storage space is running out.If i deleted some files and free up space then sync will start to work.Actually I am just syncing data from my device to the remote server,so there is no need for extra space in device while syncing.So why does the android sync adapter demand some space to work.What I noticed is the sync adapter won't work even if there is a 2% free memory

Check if app is running in foreground or background (with sync adapter)

五迷三道 提交于 2020-02-15 10:01:51
问题 I know this's a repeated question but i've looked all over the place and couldn't find a solution that works for me so... I've an app that fetches movie data from TMDB API, it fetches it by page using a sync adapter, basically it runs great except when the sync adapter's periodic sync is ran while the app is open and the user is not at the first page, so my options were to force update the movies list and send the user to the top of the list which is totally bad experience so not considered

Contacts provider not appears in “google contacts application”

时光毁灭记忆、已成空白 提交于 2020-01-17 06:41:28
问题 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 Contacts application" I can't see my provider (but I see others, like skype). Platform: Android >= 5.0 Any idea? TIA Roberto C. 回答1: I assume you've created an xml file for you SyncProvider, that xml file has a field userVisible , make sure it's

How to define ContactsAccountType for a server like Exchange to allow user to edit in native contact app using syncadapters

微笑、不失礼 提交于 2020-01-16 08:59:14
问题 I am implementing SyncAdapter which sync data from Microsoft Exchange server to device native contact. However, exchange have some limitation on the DataKinds e.g only 3 email id allowed of each type Home, Work, Mobile etc. Similarly for other pre-defined MimeTypes. I want the native contact app to honour this while editing/creating a new contact. I have added follow meta-data to my syncadapter.xml <meta-data android:name="android.provider.CONTACTS_STRUCTURE" android:resource="@xml/contacts"/

BroadCast Receiver or Sync Adapter for detection of deletion of files at particular Location Android

风格不统一 提交于 2020-01-16 05:32:06
问题 I want a broadcast receiver that detects for deletion of files at particular location in android. Basically there are some files downloaded by the app whom I want to keep track of. As they gets deleted it should also be deleted from the local apps database. And if its possible a way to track when the file has moved from one location to another and is still present in the phone to get its current location. Please help. 回答1: I think you can use FileObserver for this. Just observe the files you

First time sync loops indefinitely

为君一笑 提交于 2020-01-01 05:35:27
问题 I'm having a situation with SyncAdapter I don't know how to fix. I'm using periodic syncs. The onPerformSync method just logs some info for me to know that the process is working (no calls to notifyChanges in content providers or anything else). The project consists of two apps: The first one creates a user account (for testing purposes only). The second holds the sync adapter. Note that this is perfectly legal for the scope of the project. I first install the app with the account. I can see

Display custom sync adapter as an option when adding contacts

随声附和 提交于 2020-01-01 00:49:09
问题 I am writing a custom sync adapter following the example in the SDK sample, and things seem to be working well. I can sync back contacts from my server and have them appear in the Contacts app. However, I am unable to add a contact directly to my server. Specifically, I want my sync adapter to appear as an option in the Spinner on the add contact screen, in addition to Google and Corporate, as shown in the screenshot. I couldn't find anything on the interwebs that talks about this. 回答1: Ok I

ContentResolver.requestSync in Sync Adapter is not working in Android

▼魔方 西西 提交于 2019-12-30 17:32:15
问题 I am trying to write a sync adapter with 'StubProvider' and 'StubAuthenticator', i followed the offical guidelines, my code is running without any errors but 'onPerformSync()' is NOT getting called, i tried everything but no use. My full project can be downloaded from https://www.dropbox.com/s/48bgj3wweehaieu/MyApplication.zip?dl=0 Here are the classes I am using: Class MainActivity public class MainActivity extends FragmentActivity implements View.OnClickListener { // Constants // The

How do I get my custom account type to show up in the android contacts app?

折月煮酒 提交于 2019-12-30 04:42:07
问题 I've created a custom account type and I can successfully create contacts of that type in the android ContactsContract ContentProvider. But I'm having a lot of trouble figuring out how to get my custom account label and icon to show up when editing the contact in the default contacts app. When editing a custom contact type, the label should be something like " contact", with your app's icon to the right. Instead, editing contacts of my type always show a label of "Phone-only, unsynced contact