Reputation: 7351
I need some advice. I'm trying to use oRTP, which is a C library, in my Android app. I have the source for oRTP. As far as I can tell what I need to do is to compile oRTP into a static library using ndk-build. Then I need to write a C wrapper around libortp where the functions are named according to the JNI's conventions. What I need to know is:
Upvotes: 1
Views: 1071
Reputation: 7351
OK, got it working. The supplied Android.mk file is correct. It just doesn't do anything if you use it as is. You need to compile something using the static library for the compiler to do something. In my case I added the code below to the bottom of the Android.mk file. rtpsendc.c is a c file which has code that uses libortp.
include $(CLEAR_VARS)
LOCAL_MODULE := ortpwrapper
LOCAL_SRC_FILES := rtpsendc.c
LOCAL_STATIC_LIBRARIES := ortp
LOCAL_C_INCLUDES += \
$(LOCAL_PATH) \
$(LOCAL_PATH)/include
LOCAL_LDLIBS := -llog
include $(BUILD_SHARED_LIBRARY)
Upvotes: 1