-
Create project or Open existing android project in android studio Make sure your project has following versions
minSdkVersion: 22
targetSdkVersion: >=28
gradle version: 3.4.2
-
Clone plugxr-vuforia-library-android library
git clone https://github.com/plugxr/plugxr-vuforia-library-android.git
-
Click on
File -> New -> Import Module
. Then selectplugxr-vuforia-library-android
as module which is cloned in step 2. -
Open your app
build.gradle
and place below code in dependencies section.implementation project(':plugxr-vuforia-library-android')
-
Add below lines in project
build.gradle
module underallprojects
moduleflatDir { dirs project(':plugxr-vuforia-library-android').file('libs') }
-
Now Sync your project with gradle files
-
Add Permissions to your app
AndroidManifest.xml
file.<uses-permission android:name="android.permission.INTERNET"/> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/> <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"> <uses-permission android:name="android.permission.CAMERA"/> <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS"/> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/> <uses-permission android:name="android.permission.READ_PHONE_STATE"/> <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
-
Now open your
activity_main.xml
file and create button<Button android:id="@+id/arscene" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="AR SCENE" android:layout_gravity="center" />
-
Initialize button in your
MainActivity.java
file and give click event to button And call PlugXR AR Scene// Initialize Plugxr Ar Scene here Plugxr plugxrARScene = new Plugxr(getApplicationContext()); // Set Vuforia license keys here plugxrARScene.setVuforiaKeys(licenceKeyToUnity,accessKeyToUnity,secretKeyToUnity); // Start Plugxr AR when click on the button Button button = (Button)findViewById(R.id.startAr); button.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { plugxrARScene.start(); } });
-
Run Application
NOTE: If you are facing any issues, Please raise a issue here. We will resolve issues as soon as possible