On Wed, Oct 24, 2012 at 2:36 PM, Subodh Nijsure <subodh.nijs...@gmail.com> wrote: > We don't want this upload process to happen in context of UI hence > the service.
Please use a single process, and simply have the upload work be done in a background thread. > I read the commons ware book (page 459 to be specific) and the > database instance that content provider uses singleton database object > based off of getActivity().getApplicationContext(). Page 459 does not say this. It says that you need to use a single SQLiteDatabase object if you want SQLiteDatabase to help with thread safety. Page 459 does not address ContentProvider at all. > Now the question is -- what happens if the service (3) is using the > content provider and user starts the UI (1) that also attempts to use > the same content provider, is the UI going to experience issue opening > the database, is it going to encounter ANR? Possibly. SQLite implements process-level locking -- you use it all the time from, say, Ruby. I have not played with its effects on Android, as I don't waste the user's RAM and CPU with extra processes. > Put other way, does the content provider run in its own process? It runs in the process that the rest of your components run in, normally. > And > are requests & responses to content provider serialized? I do not think so, but I have been confused on this particular point before. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://github.com/commonsguy http://commonsware.com/blog | http://twitter.com/commonsguy _The Busy Coder's Guide to Android Development_ Version 4.2 Available! -- 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