Update 1:
As it looks the download of the ARToolKit6 SDKs has been taken down. We need to wait for some announcement on what is happening with the project.
I have been asked, how do I add ARToolKit6-Android-SDK into an existing Android Studio project or how do I create a new Android Studio project from scratch and integrate ARToolKit6-Android-SDK. What I would like to show you in this article is how to do exactly that. We are not going to extend the existing ARToolKit6 for Android example (ARTrackingExample) but create a new project with Android Studio and add ARToolKit6 to that Android project. And we are going to do that on Windows.
Requirements for ARToolKit6-Android-SDK and Android Studio
- Download Android Studio
- Download ARToolKit6-Android-SDK
- Unzip the ARToolKit6-Android-SDK
Integrating ARToolKit6 Android SDK
Actually, it is very easy to get ARToolKit6-Android-SDK integrated into an existing Android Studio project.
- Open your project
- Right click your app > Open Module Settings
- In the top left select the +
- Select Import .JAR/.AAR Package > Next
- As File name on the right select … and then navigate to the .aar file in the unzipped ARToolKit6-Android-SDK
- Should be << ARToolKit6-Android-SDK >>/SDK/lib/AR6J/AR6J-release.aar
- Close the Open Module Settings dialogue with OK
- Open it again Right click your app > Open Module Settings
- There seems to be an issue with Android Studio reloading imported modules. That is why you need to close and open it again.
- Select your app on the left and navigate to Dependencies tab
- On the bottom left select the + > Module Dependencies and select AR6J-release
Now you can use ARToolKit6-Android-SDK inside your Android Studio project.
Look at the ARTrackingExample to see how the camera surface rendering is done in principle.
Or check out my Git repository here:
https://github.com/ThorstenBux/artoolkit6AndroidTest
The API documentation for AR6J can be found here: http://artoolkit.github.io/artoolkit6/Documentation/APIReference/AR6J/
The tutorial video
Also, I’ve recorded a step by step video which is available on YouTube:
Let me know if that works for you and post any questions as comments below.
Thanks Thorsten, your example code was very useful as a starting point. I’m beginner to Android and GLES20 so next step is to understand how to draw something else than a cube. For the moment my goal is to draw a rectangular picture. Best regards.
Yes, that is quite tricky. That can all be achieved using OpenGL but I believe that would be rather complicated and there should be some frameworks around to do that for us. Having said that as ARToolKit6 has no support for OpenSceneGraph anymore the only fast way to do this would be using the Unity3D plugin. Other than that it would be really good to have a native Android 3D engine and integrate that with ARToolKit.
Hi.
I’ve done as the video tells me to do.
From here, how do I be able to use ARtoolkits in the other projects?
Are there any instructions to do that so?
Also, if I implement the project, the camera pops up and there is no sign of any AR..
Hi Adam,
I’d like to help but I need a bit more input to tell you what you need to do or what your error is. Some log message for example
[error] ARController::androidVideoPush2: ARVideoSource is not running.
[error] Error performing CURL operation: Error (7). Failed to connect to calibration.artoolkit.org port 443: Connection refused.
[error] Error -4 returned from cparamSearch.
error log message is like this, any clue to solve this problem?
Hello Thorsten! After of open the app he show the camera and the app closes always, help me please!
Hi Rafael, can you create a stack trace?
Thor_BUX, great video !!!
I think the problem is missing the camera permission !!!
Rafael and THOR_BUX!
Found out the problem !!
On class …TrackRender on the configureARScene method is returning false and the last return should be true.
I am using a samsung 7 2017 the app keeps crashing after boot up, something wrong happening
Hi,
Thanks for a nice tutorial, i have question can we place 3d objects, like .obj file instead of creating cubes?
Hi sir, can u upload your sdk file of Artoolkit 6 to github since the download has been removed, because i need it for my assignment. Thanks for helping, i will be appreciated