Android SDK

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:2.1.0'
    ...
}

Step 4: Add an AR Cloud activity/fragment

Pass your access token from Graffity Console to YOUR_ACCESS_TOKEN field

Step 5: Finally, 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>

Note that: Our service uses some ARCore functionalities as a wrapper.

Step 6 (Optional): Additional configs for AR Cloud services

Android Options

Run your project

  1. Connect an Android phone to your computer
  2. Make sure USB Debugging is enabled for your phone
  3. Hit the run button in Android Studio
  4. 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.