mercredi 23 septembre 2015

Activeandroid, paginate models by query

Activeandroid allows us to save our models to SQLite database.

If we want to load All our model instances from database, we need to write something like this:

 new Select().from(MyModel.class).execute();

However, here will be problem. If I have thousands of data in my database, it will have huge impact to performance. Also, I need to parse these models to ListView to show them to user.

How can I get my models by page, by using activeandroid?

Aucun commentaire:

Enregistrer un commentaire