4
votes

after a couple of weeks I have been unable to get the android set of tools to a functioning level with c++ before and have been given the opportunity of using a project tango, and though that sounds awesome and wondrous and would open a world of opportunity for working with VR... I feel like I am stuck at step -4. My understanding is limited, so bear with me.
I stumbled upon the PCL built for running algorithms on point cloud data, it was open source and appeared like a wonderful solution, it is written in C++ and I have a mild understanding of both c++ and java. I have tried using Eclipse and the NDK and actually managed to get a project 'deployed' to the tango, however upon attempting to edit any file in the project, java or c++, it breaks and will never deploy again.
Now I am trying to use Android Studio, and after following about 5 conflicting tutorials on 'how to get C++/ndk working in android studio' I have yet to get a working environment. So here is my question, and we can start at step one, any help is appreciated. How does one get c++ and the PCL working on a google project tango, is there a better way for someone of my skill level? The end result is a mapped 3d space with the project tango, with exportable data sets of manageable size. I have seen it done in demos on youtube, but thus far, like i said, I am stuck on step -4.

3
I tried like mad with Android Studio, as I know Eclipse and do not relish it's company - I failed miserably and returned to Eclipse - for me, the unsurmountable problem was trying to get Gradle to bring in the Tango shared lib.Mark Mullin

3 Answers

3
votes

we are working on converting all project to android studio based, for now, here is the walk around to get you started:

  1. Open Android Studio, import the project from the repo you just cloned.

  2. Take the motion-tracking-jni-example as the example, copy tango-gl-render, tango-service-sdk, and third-party into the motion-tracking-jni-example/app/src.

  3. Run ndk-build in the motion-tracking-jni-example/app/src/main folder.

  4. ndk will generate the libs folder, rename it to jniLibs.

  5. Go to Android Studio, in build.gradle(Module:app) file, add line 'sourceSets.main.jni.srcDirs = []' to the defaultConfig section.

  6. Just click the run button in Android Studio.

What we did here is basically disabled the Android Stdio's JNI compile and manually built it using ndk.

0
votes

Start with unity3d, its easy to get a working demo with a week with Unity3D. And support is very good, documentation is top notch.

Hope this will help.

-1
votes

Tango NDK Tutorial Will help but the basic layout is

  1. Setup a new project
  2. Create your Java activity
  3. Create a JNI file to bridge Java to the C++
  4. Create your C++ logic
  5. Setup your Makefiles and Gradle (probably the most annoying part)