How to make:


1.Setup ofxAndroid's Development Environment
Please refer to the following site:
ofxAndroid setup manual
http://www.openframeworks.cc/setup/android-eclipse
If you can read Japanese & want to setup it on Windows, you should refer to this site.
http://blog.goo.ne.jp/tuninghigh/e/637821f5b76b370876e3092e860ce7db



2.Merge ofxKinect to ofxAndroid
2-1.Download & Setup to Eclipse

Please download soruce code from the following site:
https://github.com/ofTheo/ofxKinect

Next, Copy [ofxKinect directory]/src/ofxKinect/ to [ofxAndroid directory]/addons/ .
Final, Add include path to Eclipse's "(ofxAndroid's)addons" project.
Please run Eclipse and add the folloing place & path:

Place: Properties -> C/C++ General -> Pths and Symbols -> Includes tab(GNU C++)
Path: [ofxAndroid directory]/addons/src/ofxKinect/src/




2-2.Fix compile error
If ofxAndroid doesn't have ofxThread::waitForThread(bool) function.
Please add the following source:
[ofxAndroid directory]/addons/ofxThread/src/ofxThread.h

void waitForThread(bool stop = true);



[ofxAndroid directory]/addons/ofxThread/src/ofxThread.c


void ofxThread::waitForThread(bool stop){
if (threadRunning){
// Reset the thread state
if(stop){
threadRunning = false;
if(verbose)printf("ofxThread: stopping thread\n");
}
if(verbose)printf("ofxThread: waiting for thread to stop\n");
// Wait for the thread to finish
#ifdef TARGET_WIN32
WaitForSingleObject(myThread, INFINITE);
CloseHandle(myThread);
#else
if(pthread_self()==myThread) printf("ofxThread: error, waitForThread should only be called from outside the thread");
pthread_join(myThread, NULL);
#endif
if(verbose)printf("ofxThread: thread stopped\n");
myThread = NULL;
}else{
if(verbose)printf("ofxThread: thread already stopped\n");
}
}





2-3.Do customize source code for Android
Please remove the following code in ofxKinect::threadedFunction() function:

ofSleepMillis(20);


Please add the following code in [ofxKinect directory]/libs/lubusb/io.c file:


#define TIMESPEC_TO_TIMEVAL(tv, ts) \
do { \
(tv)->tv_sec = (ts)->tv_sec; \
(tv)->tv_usec = (ts)->tv_nsec / 1000; \
} while (0)





2-4.Create your application project
Please choose sample programs from the following directory:

[ofxAndroid directory]/apps/androidExamples/


And copy it to the following directory:

[NDK directory]/apps/


Final, export this project on Eclipse.



2-5.Build project
You must build JNI at first.
You execute the following commands:

cd [NDK directory]/apps/[your app directory]
[NDK directory]/ndk-build -B


And, you build android application on Eclipse.

*If you don't know how to use ofxKinect framework, please refer to "[ofxKinect directory]/src/testApp.cpp".



3.Change Android's configuration
Please add the following line to init.rc:

mount usbfs none /proc/bus/usb -o devmode=0666





4.Upgrade Android's kernel
libusb MUST neet "USB FS". And Kinect MUST neet "High Speed USB(USB2.0)".
Therefore, you check the following kernel options:
.config

CONFIG_USB_DEVICEFS=y
CONFIG_USB_EHCI_ARC_OTG_ALLOW_HS=y (only armadillo)




Appendix
If your device can not draw normal Z-camera image and RGB-camera image, you MUST need to build optimized kernel & userland.
I used the following optimization option for building kernel, userland & "OpenFrameworks x kinect x Android".
for armadillo

-O3 -march=armv6 -mtune=arm1136jf-s -mfpu=vfp -ffast-math -fno-math-errno -mfloat-abi=softfp -ftree-vectorize -fomit-frame-pointer -funroll-loops -fstrict-aliasing -funswitch-loops


for beagleboard

-O3 -ffast-math -fno-math-errno -march=armv7-a -mtune=cortex-a8 -mfloat-abi=softfp -mfpu=neon -ftree-vectorize -fomit-frame-pointer -funroll-loops -fstrict-aliasing -funswitch-loops






*Download
Full "OpenFrameworks x kinect x Android" Development Environment for Armadillo
Full "OpenFrameworks x kinect x Android" Development Environment for beagleboard
Only source code "OpenFrameworks x kinect x Android

Full "OpenFrameworks x kinect x Android" Development Environment has:

Android NDK crystax version for Linux
Android SDK for Linux
C/C++ Eclipse for Linux
ofxKinect(Kinect for OpenFrameworks)'s source codes
ofxAndroid(Android for OpenFrameworks)'s source codes
"OpenFrameworks x kinect x Android" 's source codes
sample program Eclipse's workspace



OpenFrameworks + kinect + Android项目源码下载
原文链接:http://www.cnkinect.com/thread-2953-1-1.html

更多相关文章

  1. 更改cocos2d-x android 项目的cocos2d-x的版本
  2. android 项目 分享图片到微信
  3. 史上最详细的Android原生APP中添加ReactNative 进行混合开发教程
  4. android UI设计器-droiddraw
  5. Android(安卓)NDK: WARNING:jni/Android.mk: non-system librari
  6. c++ for Android(安卓)----- ndk 编译链接 pthread 报错
  7. GSON数据解析异常报错java.lang.IllegalArgumentException: Unab
  8. android-项目结构详解
  9. Android(安卓)studio 使用android.mk来配置ndk

随机推荐

  1. Bong!5 款超牛逼的 Jupyter Notebook 插件
  2. 为什么现在的开发都要懂测试了?没错是的,下
  3. JavaScript 逆向爬取实战(下)
  4. 骚操作!嵌套 JSON 秒变 Dataframe!
  5. PMP证书获得历程
  6. 如何实时主动监控你的网站接口是否挂掉并
  7. 再见 VBA!神器工具统一 Excel 和 Python
  8. Python分析5000+抖音大V,发现大家都喜欢这
  9. 原来炫酷的可视化地图,用Python就能搞定!
  10. 太骚了!Python模型完美切换SAS,还能这么玩