How to build app - simonyang81/QDMobile-android GitHub Wiki
This article is based on the Ubuntu Linux 14.04
Install and configure Java environment
- You can download JDK8 from http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
- Use
java -version
to check your java configuration, If everything was done correctly, you should see the following
Install and configure Android SDK
Android Developer Link: http://developer.android.com/index.html
Use sh android
to install android sdk after you download it, you should see the following
Configure SDK environment, may need to install lib32z1 lib32ncurses5 lib32bz2-1.0 lib32stdc++6
Execute adb
, you should see the following if the configuration is successfully
Install and configure Android NDK
Android Developer Link: http://developer.android.com/index.html
Execute ndk-build -v
to check your NDK configuration, you should see the following
Install dependent packages
You'll need following package you may need to adapt depending to your distribution packages names
subversion git quilt unzip wget swig2.0 python make yasm
The following is screenshot for installing subversion
Clone Code
git clone https://github.com/simonyang81/CSipSimple-2470
- ActionBarSherlock: is a backward compatible way to use Fragments and Action Bar pattern of android newer versions
- CSipSimple: The CSipSimple-App source code
- CSipSimpleBranded
- CSipSimpleCodecG729
- CSipSimpleCodecPack
- CSipSimpleVideoPlugin: The CSipSimple-Video source code
But don’t make when successful, you should do the following
-
Download http://code.google.com/p/bkvoice/downloads/detail?name=SILK_SDK_SRC_v1.0.9.zip&can=2&q=
-
Create folder sources in /jni/silk/
-
Unzip and copy them to sources
Build native library
Go into source folder
cd /CSipSimple-2470/CSipSimple
Launch make to build the native part of the library and dependancies
sudo make
You should see the following if everything was done correctly
There are some .so files in /CSipSimple-2470/CSipSimple/libs as shown in the picture below
Backup these .so files, then make video
Have to modify jni\pjsip\android_toolchain\pjmedia\Video.mk to make
# Ffmpeg codec
BASE_FFMPEG_BUILD_DIR := $(LOCAL_PATH)/../../../ffmpeg/build/ffmpeg/$(TARGET_ARCH_ABI)/lib
LOCAL_LDLIBS += $(BASE_FFMPEG_BUILD_DIR)/libavcodec.a \
$(BASE_FFMPEG_BUILD_DIR)/libavformat.a \
$(BASE_FFMPEG_BUILD_DIR)/libswscale.a \
$(BASE_FFMPEG_BUILD_DIR)/libavutil.a
# Add X264
BASE_X264_BUILD_DIR := $(LOCAL_PATH)/../../../ffmpeg/build/x264/$(TARGET_ARCH_ABI)/lib
LOCAL_LDLIBS += $(BASE_X264_BUILD_DIR)/libx264.a
Modify jni\ffmpeg\build_ffmpeg.sh
Find the line where the mthumb option is set in the EXTRA_CFLAGS variable. You will find it below the following comment
# X264 libs and includes
EXTRA_CFLAGS="$EXTRA_CFLAGS -DANDROID -D__thumb__ -I$X264_INCLUDES"
if [ "$TARGET_ARCH_ABI" == "armeabi-v7a" ] || [ "$TARGET_ARCH_ABI" == "armeabi" ] ; then
EXTRA_CFLAGS="$EXTRA_CFLAGS -mthumb"
fi
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -L$X264_LIBS -Wl,-rpath-link,$X264_LIBS"
The above lines set the mthumb option only when the architecture is armeabi or armeabi-v7a.
Go into source folder
cd /CSipSimple-2470/CSipSimple
Make Video Libs
make VideoLibs
You should see the following if everything was done correctly
You can find libpj_video_android.so and libpj_vpx.so in CSipSimpleVideoPlugin\libs\armeabi-v7a and CSipSimpleVideoPlugin\libs\armeabi folders