While trying to understand Android's SyncAdapter
/ContentProvider
framework, one thing still eludes me. I don't understand why a ContentProvider needs android:syncable="true"
to be defined in the manifest.
Why does a ContentProvider
need to know if it will be used from within a SyncAdapter
?
The Google docs say: "The flag allows the sync adapter framework to make data transfers with the content provider, but transfers only occur if you do them explicitly."
Does that mean that if I don't specify android:syncable="true"
, I can't use the ContentProvider
in the SyncAdapter
's onPerform
? If so, how can the framework even enforce such a thing?
Can someone help me shed some light on this subject?
Thanks
A ContentProvider
doesn't need android:syncable
to its associated SyncAdapter
.
And you ask:
Does that mean that if I don't specify android:syncable="true", I can't use the ContentProvider in the SyncAdapter's onPerform?
That's not what it means.
From the doc, android:syncable
defines
Whether or not the data under the content provider's control is to be synchronized with data on a server
AFAIK, you can define a ContentProvider
without a SyncAdapter
– the opposite is false, see also What should I use Android AccountManager for?
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