where is link.h in the Android NDK? - android

I am trying to compile a simple program using arm-linux-androideabi-g++. I am including this line im my program:
#include"link.h"
It gives error by saying no such file or directory. When i tried searching for the file I could not find it. I have searched the whole android-ndk directory and still could not find it. Can any one please help me find the file if there is any of its kind in the android ndk?
Or can i just use the link.h of /usr/include/link.h and modify it for Android somehow?

If you are talking about Bohem GC, then you can use this link.h file, it works fine with Android: http://code.google.com/p/androidmono/source/browse/trunk/PlatformPatches/link.h

You have to write a .mk file and set the path to the headers that you are using.
read this for reference:
https://groups.google.com/forum/?fromgroups#!topic/android-ndk/-_scQd5leqo

Related

Error in MainAcitivity.java file & no style are loading

I am new to android. I am creating an android application, but there are many errors showing in MainActivity.java. Here is a screenshot
Another problem is that no style in showing in activity_main.xml. Here is the screenshot
Although I have added appcompact_v7 jar file like this
But it's not recognizing it in android option of project propertise
I have installed Support library in SDK manager. Please tell me how to solve this problem?
It is really hard to say what is wrong there. here are some things that you should try:
first of all, there are errors in your xml file (activity_xml). Please check if xml is properly formatted and you are using right tags. For debugging purpose, please make your acitivity_xml an empty FrameLayout and see if it works.
Include android 6.0 into your build path. Clean the project and try building again. Make sure your layouts are error free before doing that.
Your eclipse is unable to detect referenced library at given location. Please make sure referenced library is at same place and ERROR-FREE. If library has error, your project won't include it.
Please solve all problems one by one. First make an error free xml, then a Hello world Activity. Run it on device or emulator. Once done, try to solve library and import problem now.
Best Suggestion: Please migrate to Android Studio and gradle for better support and learning.

I can't find Java_org_opencv_objdetect_CascadeClassifier for opencv android sdk in jni folder?

Have all of source code been release? My opencv version is 2.4.9. I have reorganize my project,write
Android.mk by myself.Finally I run face-detection demo and I got "Native method not found: org.opencv.objdetect.CascadeClassifier.CascadeClassifier_1:" something like this. I have search the whole opencv source but I can't find Java_org_opencv_objdetect_CascadeClassifier_CascadeClassifier_1 or anything like this.
I dont know the specific question by you.But Native method not found is the common error.Possible reasons for native method not found are
1.)the type mismatch in the c++ function name and java function name.The c++ function name must be in
the format Java_PackageName_classname_functionname
2.)you are calling function before initilization of opencv library.
If you are again not able to find please share your code
the sample problem puzzled me long time.
(my apk running well as using Android studio install it,when using Android.mk to complie in Android System (put source file to packages/apps/"apk name"))
I just replay"libopencv_java3.so"file by "\OpenCV-android-sdk\sdk\native\libs\arm64-v8a\libopencv_java3.so",because this two files size is different,then this problem is solved.
as a result , this problem should be caused by "libopencv_java3.so"

UnsatisfiedLinkError for libopencv_core.so while .apk holds this library

I want to use JavaCv with my App on Android.
Therefore I followed the advice here: https://github.com/bytedeco/javacv on how to install Android 2.2 or newer. As a result the following libraries can be found under \libs\armeabi:
libjniopencv_core.so
libopencv_core.so
All classes of both libraries are also present in the classes.dex file of my .apk.
And still i get the following exception:
java.lang.UnsatisfiedLinkError: Cannot load library: soinfo_link_image(linker.cpp:1635): could not load library "libopencv_core.so" needed by "libjniopencv_core.so"; caused by load_library(linker.cpp:745): library "libopencv_core.so" not found
I tried loading libopencv_core.so via
System.loadLibrary("libopencv_core")
and
System.loadLibrary("opencv_core")
with the same outcome..
Any hint on how to solve this issue would be appreciated.
Edit1:
I had a look to see which .so files could actually be found under /data/app-lib/ccc.android.myappname...
Despite libopencv_core.so and other files can be found under lib/armeabi/ in my .apk only some of them are available for my activity under /data/app-lib/ccc.android.myappname. The others are just ignored for some unknown reason.
Can somebody help, i have no idea what is going on.
Thank you.
Here the solution i found:
I discussed this matter on the JavaCv board on Github:
https://github.com/bytedeco/javacv/issues/28
The Issue might be history with the next release, but for the meantime do as follows:
Before using JavaCv for the first time run:
static {
System.loadLibrary("tbb");
System.loadLibrary("opencv_core");
System.loadLibrary("jniopencv_core");
}
On some devices (or occasion) the intended load order get mixed up...

Converting a set of images into a video using opencv

I tried the code which I found in this link-
how to convert images into video in android using javacv?
But I had a handful of error -
I have included opencv 2.4.6 -
Can anyone please help me resolve this problem...
Also If you know how to convert a set of images into a video using opencv please let me know how to do it.
It's not a problem with OpenCV, but with you project settings (generally). Here you will find lot of solutions, if you will still have problems give us more details.
I encountered this type of problem before. Don't forget to manually add the .jar files on your project's lib folder. Although it is not a requirement, I solved mine by doing so. Then import the .jar files and add it to your project's build path.

Android OCR Application Using Tesseract

I am currently developping an android application based on OCR (Optical Character Recognition). I've downloaded the "tesseract- android" project that contains tools for compiling the Tesseract, Leptonica, and JPEG libraries for use on Android. I am developping via Eclipse on Windows Vista OS.
I've also downloaded the necessary tools (android-ndk;apache ant..), and I've done carefully all the steps to build this project and add it as a library to my basic application.
My app consists of opening the camera for taking a picture and then processing this picture via tesseract API in order to transform it into text.
My question is:
1. Is it true that this procedure doesn't work under Windows OS?
2. When compiling, I am having the following error:
"java.lang.IllegalArgumentException: Data path must contain subfolder tessdata!"
What could be the potential error? The concerned portion of the java code is:
File myDir = getExternalFilesDir(Environment.MEDIA_MOUNTED);
TessBaseAPI baseApi = new TessBaseAPI();
baseApi.init(myDir, "eng");
I've also tried to use "/tess-two/external/tesseract-3.01/tessdata/tessconfigs" instead of "myDir", but the error remains the same.
I would highly appreciate any help.
Thanks in advance.
Q1. It should work on any operating system, I've been able to ndk-build on Win7, Mac OS Lion, and Ubuntu without any issues.
Q2. Make sure that you have permissions to write to the external storage, and have sufficient space to do so.
If that still fails, have a look at the DDMS and see the file explorer and double check your application is setting up the directory structure and copying over the traineddata.
I had an odd issue where it was creating the eng.traineddata file, but it was 0 bytes which led to all sorts of odd issues.
You could also create the directory structure manually to get you progressing, and fix this initialisation issue later on (but don't forget it!)
I was facing the same problem. Worked for me when I removed "tessdata" from the path.
Before (fail): path = "/mnt/sdcard/tesseract/tessdata";
After (success): path = "/mnt/sdcard/tesseract/";
Then, baseApi.init(path, "eng") worked with no exceptions.
Of course, tessdata folder should be in the path with the desired.traineddata file.
Path errors while compiling native stuff usually is not related with your java code. Your java code would be responsible for runtime problems. Check your build scripts and post more log messages.

Categories

Resources