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 :
- begintransaction();
- settransactionsuccessful();
- endtransaction();
more information go to: http://gafurbabu.wordpress.com/tag/android-example/
Comments
Post a Comment