I'm trying to implement BlueCove in Android; i've read here: http://code.google.com/p/bluecove/source/browse/trunk/bluecove-android2/src/site/apt/index.apt?r=3062 "usage: include bluecove.jar and bluecove-android2.jar in classpath of the android application and call JSR-82 APIs normally" .
The problem is that if i include bluecove.jar and bluecove-android2.jar i get a "The library 'bluecove-2.1.0.jar' contains native libraries that will not run on the device." error about libbluecove.jnilib.
How can i solve it?
BlueCove uses native calls through JNI, you will need implement those calls with android equivalents.
This might help: http://groups.google.com/group/bluecove-developers/browse_thread/thread/6e32131d7c5b672
Related
I'm trying to debug JNI code written in C running on Android 5. When one of my functions is called, I want to write a stack trace to the adb log so I can see where the function was called from.
The first resources I found indicated I needed to use libcorkscrew, and included complete examples of how to use the library. Unfortunately it seems libcorkscrew is gone from Android 5, and now libunwind is supposed to be used. For my project, there are several problems:
Instructions for getting libunwind into the project are sparse and/or misleading - some resources say to download the project from github and build it (with directions that do not work), others indicate the library is already part of Android 5.
All of the examples are written in C++, and it seems that libunwind only has C++ bindings for the functions within it. Since my code is C, not C++, and writing to a log function rather than through the C++ stdlib, this isn't usable.
Among others, I looked at these pages:
Native Stack Traces on Android Lollipop with libunwind
There's no "libcorkscrew" in Android 5.0...
Android NDK: getting the backtrace
Is there a way to get a stack trace in C code on Android 5 without crashing the program?
Instructions for getting libunwind into the project are sparse and/or misleading
Compiled libunwind is included into modern Android NDKs, such as NDK r16b, at sources/cxx-stl/llvm-libc++/libs/armeabi-v7a/libunwind.a. You will have to provide this file to the linker. You will also need to download matching headers, namely libunwind.h and __libunwind_config.h. For NDK r16b, these headers can be fetched here: https://android.googlesource.com/platform/external/libunwind_llvm/+/ndk-r16/include/ .
it seems that libunwind only has C++ bindings
No, it's not so. Most of libunwind bindings are C bindings.
Here is a sample Android command-line app in pure C that uses libunwind:
https://github.com/alexeikh/android-ndk-backtrace-test
Can you use backtrace_symbos_fd at Android? If you can, you could use this one:
void *array[100];
size_t size;
size = backtrace (array, 100);
backtrace_symbols_fd (array, size, STDOUT_FILENO);
Recently,i need to build an app for smart eyeglass. with official instruction,i have to import three library project,including SmartExtensionAPI,SmartExtensionUtils SmartEyeglassAPI.and i have develop dependencies for my project when i run this app, there a lot of error information.
such as Error:(44, 57)
com.sonyericsson.extras.liveware.aef.notification is not
existing;Error:(45, 57)
com.sonyericsson.extras.liveware.aef.registration is not
existiong!Error:(49, 52)com.sonyericsson.extras.liveware.aef.control
is not existing,Error:(198, 40)Registration.Intents is not existing
and so on.
what's wrong? search for help.
thanks
It seems like you are missing registration for your extension in your application.
Please take a look at sample projects for details. You can also start developing directly using sample projects in the SDK.
Is there a way to Load the kernel32.dll library in the Android NDK?
I'm trying to extract the GetTickCount and GetTickCount64 functions out of it, and I get this error when trying to run the LoadLibrary("KERNEL32.DLL"):
Function 'LoadLibrary' could not be resolved
Any suggestions to get the GetTickCount and GetTickCount64?
Android is Linux, not Windows. You need to use Linux APIs. Use clock_gettime instead of GetTickCount (example).
I use pugixml parse xml, it's work fine on ios. However, when I change to android, use './build_native.sh' (cocos2d-x for android) to build my project. There are some error:
pugi/pugixml.cpp: In member function 'void* pugi::impl::(anonymous namespace)::xpath_allocator::allocate(size_t)'
pugi/pugixml.cpp:5722:26: error: exception handling disabled, use -fexceptions to enable
someone can help me. thank you very much!
You have two options:
Enable exception handling using -fexceptions, if your platform supports it
Disable exception handling in pugixml by adding #define PUGIXML_NO_EXCEPTIONS to pugiconfig.hpp or to your build settings.
I am using Qt on android through necessitas port.
I'm trying to combine Qt with SDL.
When compile such project with SDL invoked (SDL_Init) , compiler gives me error : multiple definition of `JNI_OnLoad'.
LOG : /mnt/sdcard/Android/data/com.n0n3m4.droidc/files/gcc/bin/../lib/gcc/arm-linux-androideabi/4.7.1/../../../../arm-linux-androideabi/lib/libSDL.a(SDL_andvideo.o): In function JNI_OnLoad':
SDL_andvideo.c:(.text+0xddc): multiple definition ofJNI_OnLoad'
qtmain_android.o:qtmain_android.cpp:(.text.JNI_OnLoad+0x0): first defined here
Is there some short way how to solve this ?
specific : compiling on C4droid (ide from google play with gcc , necessitas Qt(gui + core) , SDL plugin)
thanks
You should ask the developer of c4droid. Looks like he's a helpful guy. He says on google play you should contact him if you have trouble.