I spoke about ant in my previous blog.
This blog will continue to use ant to compile the android open-source project: sipdroid
1. Download source code
SVN is required to download the source code, and SVN and configuration are downloaded by yourself.
Project Introduction: http://code.google.com/p/sipdroid/
Source code download: http://code.google.com/p/sipdroid/source/checkout
2. Compile
After the download, the project source code is located at/sipdroid-read-only.
Modify sipdroid-read-only to sipdroid
cd /home/mark/workspace/mProandroid update project -p sipdroid/ -t android-8
Then, do the following:
cd sipdroidant debug
If you see the following information, congratulations, the compilation is successful.
After compilation, an APK file is generated in the sipdroid/bin directory.
3. Import eclipse
Open eclipse and import the project.
OK. Start the study!
4. Compile the library file
When ndk is used to compile the files under the JNI file, an error is returned:
Android NDK: There is no Android.mk under /home/mark/workspace/mPro/sipdroid/jni/jni Android NDK: If this is intentional please define APP_BUILD_SCRIPT to point Android NDK: to a valid NDK build script. /home/mark/android/android-ndk-r5c/build/core/add-application.mk:126: *** Android NDK: Aborting... . Stop.
Then, modify the application. mk file and compile the file. An error is returned:
Android NDK: /home/mark/workspace/mPro/sipdroid/jni/../jni/Android.mk:silkcommon: LOCAL_MODULE_FILENAME must not contain a file extension /home/mark/android/android-ndk-r5c/build/core/build-static-library.mk:29: *** Android NDK: Aborting . Stop.
Solution:
Find the Android. mk file in the JNI directory of the source code, which contains the following content in line 90th:
SILK := silkLOCAL_MODULE := silkcommonLOCAL_SRC_FILES := $(SILK)/src/SKP_Silk_A2NLSF.c \
Changed:
include $(CLEAR_VARS)SILK := silkLOCAL_MODULE := silkcommonLOCAL_SRC_FILES := $(SILK)/src/SKP_Silk_A2NLSF.c \
Compile again!