0

I am making an android app which requires 1200 records to insert and then fetch. I am using sqlite as back end. Everything is working fine but app takes lot of time to load the data at very first time for new installation. I am using SQLiteOpenHelper class to insert data. Please suggest ways to reduce the time to load the data at very first time.

EDIT : I resolved my problem:) Here is how? My app was taking much time because, I was inserting all the 1200 records at a time. Now i changed my code such that it should insert only required data one at a time so it saved my lot of time.

user2823274
  • 51
  • 1
  • 7
  • 2
    Why don't you provide a **pre-filled database**? – Phantômaxx May 27 '14 at 14:53
  • There's no simple answer. SQLite is not very well optimised for large amounts of data. Your best bet is to display a progress indicator showing to the user the state of play. – Aleks G May 27 '14 at 14:53

1 Answers1

1

Use transactions as explained in this answer and make sure that you are only creating one connection to the SQL database for the transaction(s)

There should be a significant speed increase

Community
  • 1
  • 1
Shane
  • 150
  • 6
  • Hi Thank you for your response! I think my app is taking time bacause I am inserting huge records a the same time in fact i dont need all that records at one time. Here is the requirement, – user2823274 May 29 '14 at 05:29