In this example we are going to show you how to create a Graph with Android studio on our PlTouch devices. To make the graph, we need to use an external library called MpAndroidChart, that you can find here, otherwise without downloading it, you can include into the grade build file in the next stage.
This Article divides into 3 posts, Initiation, Data Setup, Finalization.
Fist of all, open one of your projects or create a new one, keeping in mind that you can put the graph itself on a specific Activity or you can directly call it under Main Activity.
If you want to import the Library by downloading it, and you don’t know how to import it in Android Studio, here’s a tutorial that fits your need, otherwise,
just follow the build gradle procedure:
LINKING BY BUILD GRADLE:
Go to your gradle.build file and paste in the following lines of code, be aware to put those outside application.
<code> repositories { maven { url 'https://jitpack.io' } } dependencies { compile fileTree(include: ['*.jar'], dir: 'libs') androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { exclude group: 'com.android.support', module: 'support-annotations' }) compile 'com.github.PhilJay:MPAndroidChart:v2.2.4' compile 'com.android.support:appcompat-v7:25.3.1' compile 'com.android.support:design:25.3.1' compile 'com.android.support.constraint:constraint-layout:1.0.2' testCompile 'junit:junit:4.12' } </code>
Fine, now the libray that will allow you to make the graph, has included into the project!
In the next post we are going to see how to initiate every Component correctly, stay tuned.