A simple library to add a graph in Real world
Yeah , Check us on Medium also :- https://medium.com/@deepakypro/how-to-plot-a-graph-in-real-world-using-arcore-android-4f5f1007fb86
A simple library that allows you to add a graph in Real world using ARCore.
Add following dependency to your root project build.gradle
file:
allprojects {
repositories {
...
jcenter()
maven { url "https://jitpack.io" }
...
}
}
Add following dependency to your app module build.gradle
file:
dependencies {
...
implementation 'com.github.the-losers:ARGraphLibrary:x.y.z'
...
}
Manifest File
<uses-permission android:name="android.permission.CAMERA"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
Enable ARCore in Android studio, There are two types of AR apps: AR Required and AR Optional.
<application>
…
<!-- Indicates that app requires ARCore ("AR Required"). Causes Google
Play Store to download and install ARCore when the app is installed.
-->
<meta-data android:name="com.google.ar.core" android:value="required" />
</application>
<application>
…
<!-- Indicates that app supports, but does not require ARCore ("AR Optional").
Unlike "AR Required" apps, Google Play Store will not automatically
download and install ARCore when the app is installed.
-->
<meta-data android:name="com.google.ar.core" android:value="optional" />
</application>
Read more about it here - Enable ARCore
build.gradle
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
AndroidX
Create the GraphConfig builder,
GraphConfig mGraphConfig = GraphConfig.newBuilder()
.setGraphList(getList()) //pass the list that you want to add in real world
.setEnableClassicPlatform(false)
.setEnableLogging(true)
.setEnableVideo(true)
.setVideoQuality(VIDEO_QUALITY.QUALITY_1080P) //QUALITY_HIGH, QUALITY_2160P,QUALITY_1080P,QUALITY_720P,QUALITY_480P
.build();
Call the function loadGraph
,
PlotGraph.get(context).loadGraph(mGraphConfig);
You can also check wheather a device support the arcore or not by simple calling the below method,
if(Utils.checkIsSupportedDeviceOrFinish(this)){
//Do stuffs
} else{
//hide button or whatever you wants to do
}
My Run Tracker - The Run Tracking App
ARGraphLibrary is available under the BSD license. See the LICENSE file.
The End : Happy Coding :D