Android SDK
Requirements
- ARCloud project from Graffity Console
- Android Studio
- Android SDK Version 24+
- Android Device to run AR app
Setup AR Cloud Project
Before you set up SDK for iOS, please create your project with Graffity Console. You will be guild to generate an ACCESS_TOKEN
that used to init our SDK.
Integrate SDK to Android Project
Step 1: Add Graffity AR Cloud dependencies
Step 2: Set minimum SDK version
Make sure that your project's minSdkVersion
is at API 24 or higher in module-level build.gradle
file.
build.gradle (Module:)
android {
...
defaultConfig {
minSdkVersion 24
}
}
Step 3: Add package dependency
Add dependency to module-level build.gradle
file.
build.gradle (Module:)
dependencies {
...
implementation 'com.graffity.android:arcloud:4.0.1'
...
}
Step 4: Add an AR Cloud activity/fragment
Pass your access token from Graffity Console to YOUR_ACCESS_TOKEN
field
Step 5: Add a permission request for your Android app
Add additional AR permission to AndroidManifest.xml
. You can choose optional not to block users from loading your app or required
for more information (opens in a new tab).
AndroidManifest.xml
<manifest ...>
...
<application ...>
...
<meta-data android:name="com.google.ar.core" android:value="optional" />
// in case you add an AR scene with an activity
<activity
android:name="com.graffity.arcloud.ar.ARCloudActivity"
android:process=":ARCloudActivity"/>
</application>
</manifest>
Step 6: Add this to your proguard-rules.pro
proguard-rules.pro
-keep class io.grpc.graffity.** { *; }
Note that: Our service uses some ARCore functionalities as a wrapper.
Step 6 (Optional): Additional configs for AR Cloud services
Android OptionsRun your project
- Connect an Android phone to your computer
- Make sure USB Debugging is enabled for your phone
- Hit the run button in Android Studio
- Scan around to let service determine your position in the real world.
Report Issues
If you're facing any issues related to this package, please find out here.