I see this project http://code.google.com/p/iosched/ in io like LocalRoomsHandler.java have "ContentProviderOperation" but I can't understand what is used for It's only used for contacts? Who can give me an answer
ContentProviderOperation enables mainly to batch operations on a Content provider : ex :
ArrayList<ContentProviderOperation> ops = new ArrayList<ContentProviderOperation>(lRosterContentCount);
Builder cpo = ContentProviderOperation.newUpdate(ProviderConstants.CONTENT_URI);
cpo.withValues(Entries);
cpo.withSelection(SQLTables.ID + "=?", selection);
ops.add(cpo.build());
etc.. You can prepare a lot of "Operation", and at the end you call one time :
ContentProviderResult[] results = ContentResolver.applyBatch(ProviderConstants.CP_AUTHORITY_DB, ops);
Content Provider facilitates access to a central data store or warehouse to allow data sharing and data manipulation across different applications. These are the only way to access information across application in the same device.
Like their are built in Content Providers in android system like
Contacts
MediaStore
Bookmarks
Settings and more.
See this image how Content Provider works(Image courtsey -- http://vajjala-javapassion.blogspot.in/2011/08/getting-started-with-android-content.html)
See this image, Points to be noted:
Content providers has access to different data sources like database, File, Xml e.t.c.
Activities from different application are using this Content Providers.
Content Provider is a bridge between Data resources and different application.
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