Jake,

ContentProvider isn't just for exporting data.

One useful thing it provides is data change notifications (based on data URIs). In practice, it means that ListViews with content provider-supplied data refresh automatically, and it's really easy to make other UI elements also update automatically by registering data change observers.

Another useful thing is that it forces you to map your data into a hierarchical URI-based scheme. This, IMO, results in a cleaner conceptual model for your data.

Yet another is that you can easily pass data references between activities by using a data URI.

On the other hand, with content providers you can't just run a raw sql statement whenever you feel like it - all data access is structured, so you've got to do some planning first.

Howerver, for debug info, I probably wouldn't bother with a content provider or a database at all. Just a text log file, with timestamps, so it can be cross-referenced with the logcat (if you can collect that too).

And speaking of debug reports - have you looked at ready-made solutions for this? For example, this one is often recommended on this list:

http://code.google.com/p/acra/

-- Kostya

28.02.2011 0:18, Jake Colman пишет:
What are best practices?  My app will use a private database to store
debug information.  Should I create it as a content provider and do my
own data access that way or, since I do not intend to publish this
database for anyone else to use, there is no point?  Is best practice to
alway wrap database access through a content provider?



--
Kostya Vasilyev -- http://kmansoft.wordpress.com

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to