Using boilerpipe on Android application - java

I'm trying to use boilerpipe in an Android application.
I have included the libraries boilerpipe-1.2.0, nekohtml-1.9.13, xerces-2.9.1 in the libs folder.
When running the application with Eclipse i get the following error: Conversion to Dalvik format failed with error 1
It doesn't give me errors in the code. I'm also using the same code in a Java project and it works.
Could it be a problem of conflicts through dependencies?

The reason is dalvik uses different libraries than jvm.
I've created boilerpipe which uses correct ones: boilerpipe-android

Related

Android - debug native code of AAR library

I have the following situation. Due to some requirements I've to extract some parts of our app into a separate AAR library. So it looks like that:
Native C++ code together with some Java wrappers is compiled into an AAR library
The library is then added as a library module in the main app
The compilation itself is configured with Gradle + CMake
Everything works as expected but I've one problem, I cannot debug the native C++ part anymore. Both modules are compiled in DEBUG. It also doesn't help to set the LLDB symbol directory (to LIB_PATH/.externalNativeBuild/cmake/debug/ABI_XXX/CMakeFiles/native-lib.dir/). Setting the LLDB debug type doesn't seem to help either.
When I put my library code back into the main app I can debug everything without a problem.
Is it simply not possible to debug the native part of an AAR library? Or can anyone tell me what I'm doing wrong?
For some reason I found this blog entry only now... http://www.akaita.com/post/android-native-library-module-debug/
Although the author is using the experimental ndk plugin I can confirm that it's also working with the stable gradle version + CMake!

OpenCV 3.0 building library with contrib modules and Java wrappers

I am trying to build openCV 3.0 library with contrib modules for my Java project. I am using CMake 3.4 and Microsoft Visual Studio 2013. In CMake I successfully generate data. Then I am opening ALL_BUILD project in Visual Studio and building it without errors. After build I've got openCV-300.jar and many other files with extensions *.exe, *.dll, *.iik, *.pdb. What I need is file opencv_java300.dll and it is also there however it's greatly smaller than original opencv_java300.dll from standard library. Also when I try to run my simple app I get:
java.lang.UnsatisfiedLinkError: ..\lib\x64\opencv_java300.dll: Can't find dependent libraries
Of course If I am using files from standard openCV version it is working like it supposed to. So my question is what am I doing wrong?I have got contrib library from here https://github.com/itseez/opencv_contrib and I am building library following guide from here https://github.com/Itseez/opencv_contrib/blob/master/README.md (How to build OpenCV with extra modules - cmake-gui part).
EDIT: I had to add directory to all generated files into PATH variable and it worked. But I am still searching for a different solution.

The import javax.ws cannot be resolved with GWT on Eclispe

I want to use some javax annotation on a GWT app. I download javax.ws.rs-api-2.0.jar here, and then include it in my project (Project/Properties/Java Build Path/Libraries/Add External Jars).
I clean my project, then I refresh my project and build it. But when I launch the Run as button, I got following error:
[ERROR] [gwtinit] - Line 5: The import javax.ws cannot be resolved
Eclipse show me no error in my source file, what did I miss?
With GWT you cannot use all Java libraries available for server side Java. You are restricted to a small JRE emulation subset.
As a consequence you cannot use any librariy using standard Java classes outside of the emulation subset.
Often there are special GWT libraries for the same purpose.
You don't get an error in eclipse because Eclipse interprets your code as standard Java. It doesn't know anything of the GWT restrictions. This is a common pitfall for everbody new to GWT.

Why am I getting 'undefined symbol' error for class that is on my build path?

I have an eclipse project with a third party library on my build path. I am trying to use a class from this library, which eclipse recognizes (and I can see in the hierarchy of the jar file when I drill down), but when I actually try to build the project I'm getting an 'undefined symbol' error for this type. I am using other libraries on the build path without issue. Any ideas on what might be wrong?
Our projects are built with ANT.
It's hard to answer your question with such a little details.
Here's a few vulnerable points of your build:
Ant is using different version of java compiler than Eclipse does.
Ant is using different version of the library or doesn't use it at all.
Order of your dependencies in your classpath for Ant build is different from one in Eclipse.
More details will get you a better answer.
There are also some existing answered questions to consider. They mainly regarding shared libraries (C++ or else) used in Java applications:
Undefined Symbol Error
Just started C++: Undefined Symbol error on Compile
shared library compiles, but has undefined symbols

Showing console output of a third party JNI library in an eclipse plugin

I am using JPL, a JNI library for interacting with Prolog from Java. In my application it is important to see the output that the Prolog engine generates (for example: when loading Prolog files, executing unit tests, etc). This is happening when I use the library in a standalone Java application.
However, when I pack my application as an Eclipse plug-in, I cannot see the JPL generated output anymore (such output is coming from the Prolog engine).
Does someone know if there is a way to see this output in the Eclipse console?
Thanks in advance.
May be you could try to make a plugin out of your library (hwoto) and then hook a LogListener for this plugin (like that)?

Categories

Resources