Is it bad or rude to automatically execute contentresolver.setmastersync in Android applications?

I widely use synaptor in my application to realize its core functions. I also use the periodic refresh provided by synaptor. Therefore, if "account and synchronization" is disabled on the phone, my application will be useless. Use contentresolver.setmastersyncauto (true) To open synchronization is considered a bad practice or rude. Just making a contentresolver.setissyncable is not helpful, because if the master account and synchronization are disabled, periodic synchronization will not work. What are the common methods to deal with this scheme?

Thank you in advance,

-V-

resolvent:

I would call it bad practice

There are two different synchronization enable flags for different functions

Regardless of the account type or content type, master synchronization is a single enable flag for all synchronization. This setting is "automatic synchronization" on accounts and accounts. Synchronization pages and users usually turn it off to save battery power. Some users may (AB) use it to enter some "do not disturb" mode. Programmatically, through contentresolver. Setmastersyncautomatically() Check and uncheck this item

Secondly, your account / permission pair has an enable flag. So, say a Google account. You click on the Google account, and then you get a sub page... Sync the drive, sync Google, play music, sync contacts, sync Gmail, etc. each is paired with an account (COM. Google) and a permission (COM. Android. Contacts). They can be controlled separately, So I can have a Google account that syncs contacts instead of my calendar. In addition, even the items available in the list may be different - I may have one account with Google Music installed and the other does not - so the content list in this sub page may be different, and the content checked or unchecked may be different. Please note, If the additional permissions are synchronizable, the account will display a green synchronization circle, but the account itself cannot be handled separately. Programmatically, check and uncheck this item through contentresolver. Setsyncautomatically(), and enable / disable it (grayed out) through contentresolver. Setissyncable(). If it is not configured, you will grayed out

Invalid Sign

Invalid Sign

Generally speaking, the mobile phone cannot be reconfigured without the user's consent

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>