Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Limit Records fetched in Android (Sqlite database)

I am trying to fetch sms messages from inbox, sent items and drafts. I would like to do a pagination for my list view for that it's imperative that I fetch records in pages/chunks.

I am not familiar with sqlite which is the database I understand android use to store the data. Can someone tell me how can I restrict the number of records I am fetching by using contentResolver.query?

Also what is the way to pull the sqlite database file onto my machine and browse/query it locally to experiment or see data on my machine?

Are there any other better ways to implement pagination in android??

Thanks

like image 237
Priyank Avatar asked Apr 22 '10 14:04

Priyank


1 Answers

According to the Sqlite website, you can use a LIMIT ... OFFSET ... clause in your query:

like image 196
Rich Avatar answered Nov 11 '22 07:11

Rich