Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android optimize query on ContentResolver

Is there a way to speed up the query for a contentresolver? I find querying for contacts takes a bit of time even with a proper projection.

like image 337
Maurice Avatar asked Jun 17 '26 08:06

Maurice


1 Answers

Ask for fewer columns in the projection. Better yet, ask for fewer rows in the result set.

You can also use Traceview to confirm that the time truly is in the query itself, versus anything you are doing with the resulting Cursor.

like image 191
CommonsWare Avatar answered Jun 22 '26 15:06

CommonsWare



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!