Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I have an android application with a custom content provider set up to load data asychonously. The database is a local file so I'm not sure if I needed to set up a content provider at all. Sometimes I just need to do something like get a name back from a short list by id. Is it ok to mix the content provider pattern with simple direct database calls, i.e open, query, close type of code blocks?

share|improve this question
    
Adding specifics to your question would go a long way towards getting a better quality answer. –  GlenH7 Oct 9 '13 at 18:23
    
You will likely generate an exception for attempting to perform a blocking operation on the UI thread. –  Mathew Foscarini Oct 9 '13 at 19:03
1  
    
@MichaelT: I donot think that this is a duplicate because, the proposed dupliate question is about a remote database / remote webservice. This question is about local database/loal contentprovider. –  k3b Oct 13 '13 at 17:55
1  
@k3b the question was edited after that was suggested. If you look at revision 1, it was unclear or a dup. –  MichaelT Oct 13 '13 at 17:56
add comment

1 Answer

up vote 2 down vote accepted

from http://developer.android.com/guide/topics/providers/content-providers.html

You don't need to develop your own provider if you don't intend to share your data with other applications. However, you do need your own provider to provide custom search suggestions in your own application. You also need your own provider if you want to copy and paste complex data or files from your application to other applications.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.