I am trying to write an app that syncs my mail and my calender with just a single click. After looking through this forum I found some good hints and wrote a short test app that takes my first google account and starts syncing.
The code is working so far but currently only the contacts were synced!
AccountManager am = AccountManager.get(this);
Account[] acc = am.getAccountsByType("com.google");
Account account = null;
if (acc.length > 0) {
account = acc[0];
Bundle extras = new Bundle();
extras.putBoolean(ContentResolver.SYNC_EXTRAS_EXPEDITED, true);
extras.putBoolean(ContentResolver.SYNC_EXTRAS_MANUAL, true);
ContentResolver.requestSync(account, ContactsContract.AUTHORITY,
extras);
}
The method requestSync takes "authority" as parameter and now I use "ContactsContract.AUTHORITY" and I guess that is the reason for only synching my contacts. My question now is, does anybody know what authority string I have to use to only sync my mail and calender? If "null" is used as authority all three (cal, contacts and mail) get synched
public static void requestSync (Account account, String authority, Bundle extras)
Thanks in advance!!
In computing, data is information that has been translated into a form that is efficient for movement or processing. Relative to today's computers and transmission media, data is information converted into binary digital form. It is acceptable for data to be used as a singular subject or a plural subject.
Data is defined as facts or figures, or information that's stored in or used by a computer. An example of data is information collected for a research paper. An example of data is an email. noun.
ICT data means any information stored and processed by ICT and includes programs, text, pictures and sound whether internally or externally hosted or processed.
4 Types of Data: Nominal, Ordinal, Discrete, Continuous.
OK, it seems the the Authority for contacts is:
"com.android.contacts"
and for calander:
"com.android.calendar"
But I could not find the String for syncing Gmail...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With