Blake,
I do have this method call (below) but if I don't set set this the periodic
sync does not execute, should I not be setting this to true?

 ContentResolver.setSyncAutomatically(account, Table.AUTHORITY, true);

Regards,
*Deepak*


On Wed, Jul 23, 2014 at 11:11 AM, G. Blake Meike <[email protected]>
wrote:

> I glanced through them and it all looks pretty good to me.  If you are
> sure that you are never calling notifyChanged with the third arg = true,
> the only thing I can suggest is that, somehow, you have
> setSyncAutomatically = true.
>
> Pretty mysterious.
>
> -blake
>
>
> On Tuesday, July 22, 2014 2:19:02 PM UTC-7, Deepak wrote:
>
>> Hello Blake,
>> Did you get a chance to look through the code snippets I shared? I still
>> haven't been able to figure out the cause of the account sync in every ~10
>> mins.
>> Thank you for your time.
>>
>> Regards,
>> *Deepak*
>>
>>
>> On Sun, Jul 20, 2014 at 5:13 PM, Deepak Soni <[email protected]> wrote:
>>
>>>  Hope below code snippet help identify issue:
>>>
>>> Permissions in AndroidManifest
>>>
>>>     <uses-permission android:name="android.permission.INTERNET" />
>>>
>>>     <uses-permission android:name="android.permission.ACCESS_NETWORK_
>>> STATE" />
>>>
>>>     <uses-permission android:name="android.permission.GET_ACCOUNTS" />
>>>
>>>     <uses-permission android:name="android.permission.INTERNET" />
>>>
>>>     <uses-permission android:name="android.permission.WRITE_EXTERNAL_
>>> STORAGE" />
>>>
>>>     <uses-permission android:name="android.permission.USE_CREDENTIALS"
>>> />
>>>
>>>     <uses-permission android:name="android.permission.READ_SYNC_STATS"
>>> />
>>>
>>>     <uses-permission android:name="android.
>>> permission.READ_SYNC_SETTINGS" />
>>>
>>>     <uses-permission android:name="android.permission.WRITE_SYNC_
>>> SETTINGS" />
>>>
>>> Notification calls in content provider:
>>>
>>>     insert:
>>>
>>>         getContext().getContentResolver().notifyChange(uri, null, false
>>> );
>>>
>>>     delete:
>>>
>>>         getContext().getContentResolver().notifyChange(uri, null, false
>>> );
>>>
>>>     update:
>>>
>>>         getContext().getContentResolver().notifyChange(uri, null, false
>>> );
>>>
>>>         getContext().getContentResolver().notifyChange(
>>>
>>> Table.PATH_RAW_QUERY_URI, null, false);
>>>
>>>
>>> Enable sync on selected account:
>>>
>>>     ContentResolver.setIsSyncable(account, Table.AUTHORITY, 1);
>>>
>>>   ContentResolver.setSyncAutomatically(account, Table.AUTHORITY,
>>>
>>> true);
>>>
>>>   ContentResolver.addPeriodicSync(account, Table.AUTHORITY,
>>>
>>>  new Bundle(), P.Defaults.DRIVE_SYNC_FREQUENCY);
>>>
>>> Syncadapter.xml
>>>
>>> <sync-adapter xmlns:android="http://schemas.android.com/apk/res/android";
>>>
>>>     android:accountType="com.google"
>>>
>>>     android:contentAuthority="content provider package name"
>>>
>>>     android:supportsUploading="true"
>>>
>>>     android:userVisible="true" />
>>>
>>>
>>> Let me know if there is any other code snippet will help analyse the
>>> issue.
>>>
>>> About account: I require Google account which I use to connect to user's
>>> Google Drive.
>>>
>>> I do not have an authenticator, is it an issue?
>>>
>>> Another thought, though I have not verified, is my application shows up
>>> in particular Google account linked application list (when you open the
>>> account). So is my application sync some how linked to sync of other
>>> applications?
>>>
>>> Regards,
>>> *Deepak*
>>>
>>>
>>> On Sun, Jul 20, 2014 at 12:37 PM, G. Blake Meike <[email protected]>
>>> wrote:
>>>
>>>>
>>>> Sorry, missed the note that you were passing "false" in the original.
>>>>
>>>> I've build several Sync Adapters that sync periodically.  They seem to
>>>> work fine.  It is hard to guess what could be wrong.
>>>>
>>>> The period is, definitely, in seconds, not millis.
>>>>
>>>> Have you checked to see that none of your calls are failing due to
>>>> missing permissions?  You may need account permissions...
>>>>
>>>> -blake
>>>>
>>>>
>>  --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
> ---
> You received this message because you are subscribed to a topic in the
> Google Groups "Android Developers" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/android-developers/CS5mVYRcdko/unsubscribe
> .
> To unsubscribe from this group and all its topics, send an email to
> [email protected].
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to