sync

Android how to enable/disable auto sync programmatically

孤街醉人 提交于 2019-11-28 08:37:10
I need to know how to toggle auto sync on and off programmatically. kingston I think you are looking for ContentResolver.setMasterSyncAutomatically(<boolean>); What docs says: Sets the master auto-sync setting that applies to all the providers and accounts. If this is false then the per-provider auto-sync setting is ignored. This method requires the caller to hold the permission WRITE_SYNC_SETTINGS. So don't forget to add permission into manifest.xml: <uses-permission android:name="android.permission.WRITE_SYNC_SETTINGS" /> This should disable / enable all the syncs. @Sajmon: I updated this i

Is LocalStorage synchronization for Chrome extensions already available?

耗尽温柔 提交于 2019-11-28 07:10:58
问题 I found chromium issue titled "Allow extensions/apps to sync their own settings" that has status ' Fixed '. It's from December 2011. So, does it work? If so, how does it work and where are the docs? Last time similar question was asked in 2010 and then the answer was to use bookmarks hack. I think it's time to have an update on this topic. Update : I just found these docs for experimental chrome.storage API. Is this what I'm looking for? Do we have any new alternatives (other than bookmarks)

Android Studio how to run gradle sync manually?

情到浓时终转凉″ 提交于 2019-11-28 07:06:53
I'm debugging Gradle issues in Android Studio and see references to "Run gradle sync", but I'm not sure how to run this command. How do I run "Gradle sync" from Android studio or Mac terminal? Cai Android studio should have this button in the toolbar marked "Sync project with Gradle Files" EDIT: I don't know when it was changed but it now looks like this: EDIT: This is what it looks like on 3.3.1 OR by going to File -> Sync Project with Gradle Files from the menubar. gradle --recompile-scripts it will do a sync without building anything. Alternatively, with command line in your root project .

How to show sync failed message

一曲冷凌霜 提交于 2019-11-28 05:34:36
问题 I've build a contacts sync adapter. It's all working fine but I need one more thing. If for some reason the sync does not complete successfully, I want to show a message like Google account is showing when the sync fails 回答1: The solution was to set the delay on the sync result. After this delay the sync will be restarted. try { DO THE SYNCHRONIZATION } catch (AuthenticationException e) { Log.e(TAG, "AuthenticationException"); syncResult.stats.numAuthExceptions++; syncResult.delayUntil = 180;

Java Thread synchronization - Thread.sleep() Method Not Working as desired

送分小仙女□ 提交于 2019-11-28 04:56:35
问题 i heard, sleep() will lock the current sync method/block But here, when i call sleep() on thread 1, thread 2 is able to access the same block? Can anyone Explain? Main.java public class Main { public static void main(String args[]) { Thread1 t1 = new Thread1(); Thread2 t2 = new Thread2(); System.out.println("going to start t1"); t1.start(); System.out.println("going to start t2"); t2.start(); } } ===================================================================== Thread1.java public class

Sync Adapter without Account

ぃ、小莉子 提交于 2019-11-28 03:27:59
I need to fetch some data over the cloud from my app. I've watched the google IO video on RESTful android apps @ http://www.youtube.com/watch?v=xHXn3Kg2IQE&t=43m58s It recommends in the final slides to use a SyncAdapter to integrate with the Android System. Later I learned that one has to use an Account to implement SyncAdapter. My app does not use an account. Users can freely download data without registration. Can I still use SyncAdapter? Is there a stock dummy account that I could use? Edit: I do have a content provider for my app so that's not a problem Edit2: I've just looked at the

How to authenticate with Chrome sync XMPP servers?

怎甘沉沦 提交于 2019-11-27 20:14:40
问题 I need to get the currently opened tabs of a Google Chrome user in my Java application (not on the same machine). Chrome sync is enabled so the current tabs are synced with Google servers. According to the documentation of Chrome sync it is done via XMPP. So I guess it should be possible to connect to the Google XMPP server (xmpp.google.com), e.g. via Smack (Java library for XMPP), authenticate and listen for protobuf messages that indicate a tab session change. Of course the login

Can I use iCloud to sync the NSUserDefaults plist file

自古美人都是妖i 提交于 2019-11-27 20:12:53
I was wondering if it was possible to use iCloud to sync an app's preferences file between devices. The preference file I am talking about is the com.domain.appname.plist file created by NSUserDafults to store the app's preferences. I would like to have the option of keeping my app's preferences file in sync between two different devices (an iPad and an iPhone, for example). Is this an acceptable use of iCloud syncing? Or would I need to convert the plist file into a different type of document, store it on the cloud, and convert it back into the app's preferences file upon retrieving it?

ffmpeg stream offset command (-itsoffset) not working

我是研究僧i 提交于 2019-11-27 18:09:20
问题 I would really appreciate if someone could give some pointers regarding the use of itsoffset with ffmpeg. I have read a number of posts on this subject, some of them explain very clearly how to re-synchronize audio and video with -itsoffset, but I haven't been able to make it work. My avi file is encoded with ffmpeg, in two passes, using the following command for the second pass: ffmpeg -i whole-vts_01.avs -pass 2 -y -vcodec libxvid -vtag XVID -b:v 1300K -g 240 -trellis 2 -mbd rd -flags +mv4

How to know when sync is finished?

半城伤御伤魂 提交于 2019-11-27 18:09:13
I have implemented a sync adapter and I want to get a callback when it finishes in my activity. I have tried using ContentResolver.addStatusChangeListener , but I am only getting callbacks when the sync is pending / active. Here's some relevant code from my activity: @Override protected void onResume() { super.onResume(); final int mask = ContentResolver.SYNC_OBSERVER_TYPE_ACTIVE | ContentResolver.SYNC_OBSERVER_TYPE_PENDING; syncObserverHandle = ContentResolver.addStatusChangeListener(mask, syncStatusObserver); } @Override protected void onPause() { super.onPause(); if (syncObserverHandle !=