Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I reduce the time that MPAndroidChart spend to show data?

I have an application in which I have a BarChart and a CombinedChart but they spend 1-1.5 seconds until they show the chart with the data.

I retrieve data from a database with Volley doing a request to get the data but I would like that the time that both charts spend to show the data will be reduced as much as possible.

I guess that it could be by the form of import that library to the project:

compile 'com.github.PhilJay:MPAndroidChart:v2.2.5'

but I could not find any other way to import that library or if it is the properly way to do this. Maybe it can be related by the fact that I am using Volley for this purpose.

What can I do to reduce the amount of time that both charts spend to show the data? Can it be something related with the form that I am importing it?

Any suggestion will be appreciated.

Thanks in advance!

like image 880
Francisco Romero Avatar asked Aug 05 '16 09:08

Francisco Romero


1 Answers

The delay you are experiencing has nothing to do the way you are importing the libraries since that is done in compile time and not runtime.

If you are requesting data from a local database that's just the time it takes to fetch the data. If you are looking for speed I would recommend you to use Realm which is the fastest read "database" for android right now.

As a bonus the PhilJay has integrated his MPAAndroidChar library directly with this,

you can find it here: MPAAndroidChart-Realm

like image 164
Joaquim Ley Avatar answered Nov 08 '22 18:11

Joaquim Ley