If you subsequently use the result of the query, then of course the best way would be to do cursor.getCount() This is faster than executing 2 queries to get a counter and one for the result
EDIT:
If you are not using the results, then rawQuery is faster because you only get one column from the database, not many. Plus, why would you waste resources on executing a query and not use its result?
source share