I have submitted a RFE to cache the content provider. If you are keen to see this implemented add your vote.
http://code.google.com/p/android/issues/detail?id=1907 Charles On Feb 2, 5:07 pm, Charles Harley <[email protected]> wrote: > Unfortunately I have to use thecontentprovider, I have already > optimized it a little using bulkInsert but I hadn't thought of > deleting several entries at once. > > If there definitely isn't a way tocachethecontentprovider then > I'll submit it as a feature request. > > Charles > > On Feb 2, 4:58 pm, Peli <[email protected]> wrote: > > > Good question. Indeed the URI has to be resolved with each query, > > update, delete. > > > If the ContentProvider supports it, you may try whether you are not > > faster > > 1) by deleting several entries at once: using delete on the whole > > table, with appropriate selection clause > > 2) by inserting several entries at once using bulkInsert (if the > >contentprovider supports > >this):http://code.google.com/android/reference/android/content/ContentProvi...[]%29 > > > Finally, if you have so many changes to do, do they really have to go > > into a ContentProvider? Maybe you are better off with a private > > database: > > > "If you don't need to share data amongst multiple applications you can > > use a database directly via SQLiteDatabase. > > "http://code.google.com/android/reference/android/content/ContentProvi... > > > Peli > > > On Feb 2, 5:42 pm, Charles Harley <[email protected]> > > wrote: > > > > I am performing hundreds of calls to a singlecontentprovider to > > > perform various insertions, updates and deletions. After profiling my > > > application, I have noticed that the ContentResolver class takes > > > approx. 30ms to retrieve the correspondingcontentprovider object for > > > each call. Is there anyway to retrieve a reference to thecontent > > > provider rather then going through the ContentResolver every time? > > > > Many thanks, > > > > Charles > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---

