Measure access performance to Android’s Sqlite database

Asked

Viewed 154 times

0

Good afternoon,

How can I measure access performance to Android Sqlite database? More specifically database entry and selection.

1 answer

0

You can create mocks (sample data for input or output) in the Sqlite database and App.

I suppose you’re already using the best Pattern for performance Android, with this at each request start you can insert a LOG and in the Reader who receives the result you put another LOG indicating the end of SQL execution.

Example, if you are using Asynctask

private class SQLTask extends AsyncTask<URL, Integer, Long> {

 protected Long doInBackground(URL... urls) {
     Log.e(TAG,"inicio");
     //sua consulta SQL
     return totalSize;
 }


 protected void onPostExecute(Long result) {
     Log.e(TAG,"fim");

 }
}

With this you will know how long is lasting an SQL command, you can also monitor using the Android Studio on the flap Android Monitor the use of CPU and memory of the application.

Anyway there are other N ways to do this, everything will depend on how and how detailed you want this monitoring

Browser other questions tagged

You are not signed in. Login or sign up in order to post.