Jyosna
Jyosna

Reputation: 4446

android how to compare between simpleCursorAdapter and ArrayAdapter

I have an application. I want to optimize that one. how can i do that. For example I am using simpleCursorAdapter to bind listview and it fetch data from database. But if i retrieve data from cursor into an string array and then by using ArrayAdapter I can bind listview. So I want to know which one is the better one means which takes less time to binding or takes less CPU time. Plz give me the answer. And if u have any extra tips of code optimization then tell me plz. Thank you

Upvotes: 0

Views: 1245

Answers (1)

Sunil Kumar Sahoo
Sunil Kumar Sahoo

Reputation: 53657

Please try to test by your self. Have a look on the following steps to check performance difference

Create a sample application where you write both of the technique. also print two print statements for displaying and free heap memory

one statement before calling database second statement after creation of list view

In this way you can find which technique is better as per your requirement.

Thanks Deepak

Upvotes: 3

Related Questions