Hi, I am creating an android JNI library, that in turn uses a native linux library to access a particular device.
Here is a snippet from the android jni project's Android.mk file, where libdevice is the external library. # All of the shared libraries we link against. LOCAL_SHARED_LIBRARIES := \ libandroid_runtime \ libnativehelper \ libcutils \ libutils \ libdevice Now I've already created libdevice library and built the libdevice.so shared library using the OpenEmbedded build system and it is available on my target. But the moment, I say I want to link to libdevice, in my JNI project's Android.mk file as shown above, it expects to find a libdevice android project. Question 01: Is it really necessary to have an external android project for it to work with android? Can I edit the jni project's Android.mk so that it uses the pre-build shared library files and headers locate under /usr/lib/ on the target device? i.e, Is there a workaround for this type of situation? Question 02: Suppose I decide to go ahead and create an external project, which I've already done and stored it under /external/device What should I be adding to my Android.mk so that the following headers of my device.cpp file can #include <string> #include <vector> #include <stdexcept> can be found? At the moment I get the following errors: external/libdevice/src/Device.h:24:18: error: string: No such file or directory external/libdevice/src/Device.h:25:18: error: vector: No such file or directory external/libdevice/src/Device.h:26:21: error: stdexcept: No such file or directory What should I do to make the external/device/Android.mk file pick up string, vector and stdexcept? Here is a copy of my Android.mk file for the libdevice external project: #ifneq ($(TARGET_ARCH),arm) LOCAL_PATH:= $(call my-dir) include $(CLEAR_VARS) LOCAL_CXXFLAGS += -Weffc++ LOCAL_SRC_FILES := src/device.cpp LOCAL_C_INCLUDES := #LOCAL_STATIC_LIBRARIES := LOCAL_MODULE:= libserial LOCAL_COPY_HEADERS_TO := libdevice LOCAL_COPY_HEADERS := src/device.h include $(BUILD_SHARED_LIBRARY) #endif Best regards, Elvis --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "android-framework" group. To post to this group, send email to android-framework@googlegroups.com To unsubscribe from this group, send email to android-framework+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-framework?hl=en -~----------~----~----~----~------~----~------~--~---