I'm trying to compile and run the OpenCV face detection example but it won't let me. I'm using Linux Mint 17, Eclipse with ADT and NDK installed. I have the gcc, g++, build-essentials packages installed. I'm getting the following errors:
Thanks in advance!
You should compile that stuff for ARM architecture (depending on your device). In principle gcc can do that but it is a little bit of work because your need android ndk, android sdk and android built-tools.
I advice you to start very simple. Having a running empty app that calls a native c++ function. And once this is settled your should proceed to opencv.
Have a look at this. I made it https://github.com/skanti/Android-Manual-Build-Command-Line
Related
I am now porting a linux C++ library to Android using JNI. The library porting itself is very straightforward, and I have built a C++ library that can be invoked by Android via JNI. Now my problem is to verify that the library works well in Android environment as well. In the linux development environment, some unit-tests and regression tests are already available. So I was wondering whether I can test the library by taking advantage of all the available unit-test and regression test programs. For example, in linux I have the following binaries:
mylib.so
my_unit_test
my_regression_test
Then for Android, I will first built mylib_android.so. Then, can I build my_unit_test_android and my_regression_test_android for Android platform? If it possible, how can I invoke them in the Android simulator and the real device?I have little knowledge about Android, and any ideas will be appreciated.
Transform them to libraries with single function and write Android app that will use them.
we are now developing some features with c/c++ for android client.
So we will use android NDK - r8 to compile our code.
We use libuv also in our code.
Unfortunately, android NDK cannot complie libuv correctly. All the terms started with 'pthread_'cannot be recognized.
Anyone has idea or hint? Thanks a lot.
The support for android is not yet in mainline libuv, but I know of at least two patch-sets to fix it:
As implemented in rust
As a recently submitted pull-request
While I can't speak of the latter (seemingly very good quality), I can tell you that the former is currently being used for the Android port of rust and servo.
Is it possible to write part of the Android app in Ruby and then, using JRuby and Android Tools, compile the code to run on Dalvik VM? I don't need any run-time support for interpreting Ruby code, just to run one Ruby module. It would be nice if the compiled code is minimal, to not drag along the entire Ruby standard library.
How to configure some IDE (like Eclipse) and Android Tools to support that?
See these/three/answers (on stackoverflow) regarding #CharlesOliverNutter 's Ruby-like Mirah language that runs on the Dalvik VM.
Have a look at Ruboto.
Some time ago I was working on a debug lib for android that was using it but I got out of time. I looked at the ruboto-irb source code a lot.
The major downside I came up is that it needed to have ruboto installed on the device.
Recently,i want to learn how to use opencv in android,but I stuck in the beginning.
I follow this page to learn how to construct the environment,but when I run the sample "Tutorial 1-Add OpenCV",it appears
The environment:
jdk 1.6 33update
eclipse juno
android 4.0
ndk r8b
Anybody know what kind of mistakes I have made?
thanks!
Did you actually read warning message? It says that your program doesn't work without OpenCV manager. It was added in version 2.4.2. So all you need to do is to install it.
I am building C libraries that will be used by an android app(through either JNI or the NDK, I've never used the NDK though) and I am wondering what IDE/development environment is best to use? I've basically only used Visual Studio for native development and I'm not sure how to adapt to building .so libraries for use on android.
Thanks
EDIT: Update -- I want to avoid makefiles if possible (never used them) and rather use a complete IDE such as the case with visual stuido to compile
Generally, cygwin (i.e. command line) is used for building Android native code. But you can also try to use Eclipse for this purpose. It doesn't help very much but it highlights syntax and you don't have to switch to other apps to write code and build your app. You can read more about using Eclipse for C/C++ Android development here.
I would strongly recommend that you use the NDK's compiler.
Normally this is done by writing an Android.mk in accordance with the instructions for the NDK. It is not complicated. The easiest thing to do is to grab the hello-jni sample app and just make the necessary changes, for example substituting your source files into its android.mk.
You can stay in visual studio if you like that as an editing environment, simply using the ability to bind an external command to a keystroke to launch the ndk build script. Ages ago I had figured out how to reformat GCC error messages with sed into something that VS could parse to make them click-able, though I soon moved development of that project under linux.
I think a lot of people use Eclipse as their IDE for Android development. I use it and its pretty good. You shouldn't have any problems if you're used to VS.
The Android SDK comes with a plugin, the Android Development Tools (ADT), to develop applications for Android inside the Eclipse IDE, which is same kind of beast as Visual Studio. And within that IDE, it is possible to use JavaCPP (disclaimer: I am the author) to have it compile all the native C/C++ stuff we need through the Android NDK, but without needing Makefiles and such. More details here:
http://code.google.com/p/javacpp/#Instructions_for_Android