Fetch very huge data from server and insert in sqlite - Android -


i working on project having millions of records in server, need fetch these data server via web services , insert sqlite database.

problem is, in order fetch these details server taking time because data retriving server huge.

also taking time insert sqlite database.

anyone can give me possible workaround this.

used asynctask class fetching data server

the asynctask class encapsulates creation of background process , synchronization main thread. supports reporting progress of running tasks.

more information go to: http://www.vogella.com/tutorials/androidbackgroundprocessing/article.html

and database operations slow , in situation thousands of records have inserted, inserting each record consumes lot of time , affects performance of application. in such situations,batch insert saves overhead. significant amount of time can saved if batch inserts made in single transaction.

sqlite provides 3 simple methods in sqlitedatabase class :

  1. begintransaction();
  2. settransactionsuccessful();
  3. endtransaction();

more information go to: http://gafurbabu.wordpress.com/tag/android-example/


Comments

Popular posts from this blog

python - Subclassed QStyledItemDelegate ignores Stylesheet -

java - HttpClient 3.1 Connection pooling vs HttpClient 4.3.2 -

SQL: Divide the sum of values in one table with the count of rows in another -