- Download ogg from http://downloads.xiph.org/releases/ogg/ (for example I downloaded libogg-1.1.4.tar.gz)
- untar the file in your local directory:
$ tar zxf libogg-1.1.4.tar.gz - create a jni directory and put the following text into a file named jni/Android.mk:
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := ogg
LOCAL_CFLAGS := \
-DFIXED_POINT -DUSE_KISS_FFT -DEXPORT="" -UHAVE_CONFIG_H \
-D_ANDROID
LOCAL_C_INCLUDES := \
../libogg-1.1.4/include
LOCAL_SRC_FILES := \
../libogg-1.1.4/src/bitwise.c \
../libogg-1.1.4/src/framing.c
include $(BUILD_SHARED_LIBRARY) - Now your directory should look like the following:
$ ls
jni/ libogg-1.1.4/ libogg-1.1.4.tar.gz - change directory to jni and run ndk-build:
$ cd jni; ndk-build V=1
After many years of searching the web for tips and tricks about computers, operating systems and programming languages, it's finally time to give back and post solutions to common problems I'm dealing with.
Thursday, May 9, 2013
How to compile libogg for Android
To compile libogg for Android, you just need to create an appropriate jni/Android.mk makefile with the minimum set of files and options needed to compile libogg for Android.
Labels:
Android
Subscribe to:
Post Comments (Atom)
Danilo, Can you post a skelleton project on android studio with this content?
ReplyDeleteRicardo,
Deletesorry but I'm not familiar with Android studio.