Wednesday, March 5, 2014

android listview how to display the data in sqlite


I put some data exist sqlite, the application of direct access to the data in my sqlite, but I have a database of more data, estimated the 1W bar, take out all at once on the listview is not very good, right? Everyone encountered local data and relatively long time is how you handle it, how to make the display more smoothly?
Thank you<-! Main posts under Banner (D4) -><-! Posts under the main text (D5) ->
Reply:
This case comes to mind is open threads
Reply:
Asynchronous loading colleagues under control the amount of data to select the appropriate time to release and load
Reply:
Loads more features like
Reply:
reference to the third floor a1150247879 reply:
similar loads more features

Is also like to load the data on the network, as each load only one page of it?
Reply:
1 When you query data from a database query in time may result in the application blocking, it is recommended that you use CursorLoader. You should get the data in this page I will not say good control sql statement can do

Reply:
Is (with the query limit) paging and AsyncTask (android comes with asynchronous task class) will be able to solve the problem you say
Reply:
references, 5th Floor dkdjfkdjfk reply:
1 when you query data from a database query in time may result in the application blocking, it is recommended that you use CursorLoader.. You should get the data in this page I will not say good control sql statement can do

But I feel that if you want the page to load, then up, then even if the page is reloaded before the data has been loaded, so how to avoid?
Reply:
reference to the 6th floor I_am_studying reply:
is paged (query with limit) and AsyncTask (android comes with asynchronous task class) will be able to solve your say problem

Already loaded data will then reload it?
Reply:
Is paged, the clear front, front loading how many, keeping up to 50, when the pre-loaded sliding and cleared the cache optimization
Reply:
Previous data on the use of soft references, this is not easy OOM
Reply:
reference to the second floor tanwei4199 reply:
loaded asynchronously while controlling the amount of data to select the appropriate time to release and load


Implement paging function, when the SQL query can be set limit offset, maxResult. offset refers to the starting position in the result set, maxResult refers to the maximum number of a query.

Recommendations can see Chuan Chi podcast android video, listview chapters related to implementation.
Reply:
reference to the 11th floor harkue reply:
Quote: references to the second floor tanwei4199 reply:

Asynchronous loading of data while controlling the amount of the next release and choose the right time to load


Implement paging function, when the SQL query can be set limit offset, maxResult. offset refers to the starting position in the result set, maxResult refers to the maximum number of a query.

Recommendations can see Chuan Chi podcast android video, listview chapters related to implementation.

Ah this is a good idea, really need this knowledge

No comments:

Post a Comment