Include .so library to android ndk project

Deadly 提交于 2019-12-24 20:56:28

问题


I'm beginning with android NDK. I have to compile a native library for the 1.6 sdk (mupdf) but it requires the ljnigraphics lib (which was added lately on 2.2). I'm trying to include the compiled library to my android project but I can't figure out how to do it. 1. Is it the best way to do this ? 2. If yes how should I proceed ? Any tutorial or information to start will be appreciated. 3. If not do you know any pdf library i could use on android 1.6 ?

Here is my Android.mk file :

    LOCAL_PATH := $(call my-dir)
TOP_LOCAL_PATH := $(LOCAL_PATH)

    MUPDF_ROOT := ..

include $(TOP_LOCAL_PATH)/Core.mk
include $(TOP_LOCAL_PATH)/ThirdParty.mk

include $(CLEAR_VARS)
LOCAL_MODULE    := ljnigraphics 
LOCAL_SRC_FILES := ljnigraphics.so

include $(PREBUILT_STATIC_LIBRARY)
include $(CLEAR_VARS)

LOCAL_C_INCLUDES := \
$(MUPDF_ROOT)/draw \
$(MUPDF_ROOT)/fitz \
$(MUPDF_ROOT)/mupdf
LOCAL_CFLAGS :=
LOCAL_MODULE    := mupdf
LOCAL_SRC_FILES := mupdf.c
LOCAL_STATIC_LIBRARIES := mupdfcore mupdfthirdparty ljnigraphics

LOCAL_LDLIBS    := -lm -llog

include $(BUILD_SHARED_LIBRARY)

EDIT : I succeeded compiling the mupdf library for android 1.6 thanks to the work of Hans-Werner Hilse (http://code.google.com/p/droidreader/).


回答1:


a lightweight, fast PDF and XPS viewer capable to run on multiple platforms, including Android and iOS. https://code.google.com/p/apv/ try this...




回答2:


I finally used the code at http://code.google.com/p/droidreader/



来源:https://stackoverflow.com/questions/5633023/include-so-library-to-android-ndk-project

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!