I am developing an application. In this I am using the sqlite database.
First time I am taking the data from assets and then inserting into database. From second time onwards I am taking data from the Database.
But first time my application is very slow. Finally my application is too slow. My question is, will the application become slow when we use sqlite in our app? and what we can do for this type of issue.
Please give me some suggestions.
It is possible the parser you are using for reading the XML file is working very slowly – but this shouldn’t be the case as I can process a XML file with 7000 entries, with 3 entities each in around 12 seconds adding each entry to the DB.
If it is causing you problems with a Force Close / Wait dialog, run the first import in a seperate thread, not the UI one.
Another solution would be for you to load the data into a DB on the emulator, get the sqlite file from the applicaiton directory and package that with your application, then its just a question of moving the file from the asset folder to the DB folder:
Database Populating Solution for large DB’s, but you could simplify the process if the DB is less than 1mb in the asset folder.