is it possible to initialize the contentprovider in the application?
because i need to create a database for every user/server combination and I’m creating the database with the login information in the oncreate method of the the contentprovider!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Based on what it sounds like you are trying to do, you may consider contextualizing your ContentProvider’s database access (this may be another way of describing what @Gary B. was getting at):
When you initialize the content provider, create a database within which you will store the list of user/server combinations. Then, when a user logs into the application, create the corresponding database and update the master list for the ContentProvider.
In the ContentProvider’s public operations, determine which user/server combination is active (or being requested) and then look up the appropriate database in the master database you created on installation. You can then read the user/server specific information and return this to the caller.
Alternatively, you could likely implement this all within one database, but I don’t understand enough about your requirements to recommend a specific approach…