Friday, June 7, 2013

[android-developers] Re: How to reduce time to load data from database

Hi Vamshi,

I got a hunch here, so I need to ask you first if you are querying that data from a background thread (using AsyncTask) for example. If you don't do that the user interface gets noticeably blocked / unresponsive for a moment making your activity appear "slow". By querying the data from a background thread you can make your activity appear to be "faster", because the UI is still able to respond to touch events and so on.

If this is not the issue then it might be your database or the query itself.

So here a few questions for you in return:

- Do you query text strings or pieces of text from your database? This can be really really slow because SQLite usually needs to go through all records and scan them for matching the strings. That's especially a big problem with "LIKE" conditions. You can dramatically boost your database string search performance using the FTS3 extension. Which comes at a cost of course, the database gets much bigger, but in my opinion that's well worth it.

- Do you use (complicated) table joins? Maybe you can optimize your query

- What is / what are the columns that get queried most often? It might be possible that you can create an indexes for these (but use them sparingly)

Maybe you want to post the SQL table creation code of your database tables and your query code.


On Thursday, June 6, 2013 12:22:43 PM UTC-5, vamshi ch wrote:
 Hi All,

   I have an Activity with contain data and when i click the data then it moves to another activity in background it renders the list of data from database(sqlite) and it consuming most of the time. so i need to modify and reduce the execution and rendering time. Please let me know what are approaches should i use to implement.

Please help me on this. 


Thanks,
Vamshi.

--
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
---
You received this message because you are subscribed to the Google Groups "Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate