I’m trying to work with a web service (that I have no control over) that returns a SQLite database when you query it. Is there any way to do this?
Share
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.
I am working on a project that’s doing something similar. I request updates to a database and depending on the volume of updates required, it either sends down an entirely new database or a series of SQL statements. I would strongly suggest keeping the databases on the sdcard if it is available, especially if the size of the databases you’re downloading are variable and beyond just a few kilobytes in size.
I’m doing the following to get the file (modify to taste since you may have XML to deal with in the SOAP response, also ignore the progress stuff.)
Then I do the following to access the database. Since these databases are also used on an iPhone app, they do not have an Android-specific table and therefore the
SQLiteDatabase.NO_LOCALIZED_COLLATORSflag is needed to access the DB. Note that my Database class extends the SQLiteOpenHelper class: