Changes between Version 18 and Version 19 of Getting-Started/Android
- Timestamp:
- Apr 29, 2013 9:50:48 AM (12 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Getting-Started/Android
v18 v19 9 9 10 10 * Besides the [http://developer.android.com/sdk/index.html Android SDK], you will also need the [http://developer.android.com/tools/sdk/ndk/index.html Android NDK]. 11 * Optional: [http://www.swig.org/download.html SWIG] if you want to build the sample application apjsua.11 * Optional: [http://www.swig.org/download.html SWIG] if you want to build the sample application pjsua. 12 12 13 13 == Build Preparation == 14 14 15 1. [wiki:Getting-Started/Download-Source Get the source code], if you haven't already. 15 1. [wiki:Getting-Started/Download-Source Get the source code], if you haven't already. This tutorial applies to PJSIP version 2.2 and above (or the 2.1 from SVN trunk dated 2013/04/24 or later). 16 16 2. Set your [wiki:Getting-Started/Build-Preparation config_site.h] to the following: 17 17 {{{ … … 37 37 * other customizations are similar to what is explained in [wiki:Getting-Started/Autoconf Building with GNU] page. 38 38 39 == Building and running apjsua sample application == #apjsua39 == Building and running pjsua sample application == #pjsua 40 40 41 We have apjsua sample application located under {{{pjsip-apps/src/apjsua}}}. It is not built by default, and you need [http://www.swig.org/download.html SWIG] to build it.41 We have pjsua sample application located under {{{pjsip-apps/src/pjsua/android}}}. It is not built by default, and you need [http://www.swig.org/download.html SWIG] to build it. 42 42 43 Follow these steps to build apjsua:43 Follow these steps to build pjsua: 44 44 1. Make sure SWIG is in the build environment PATH. 45 - Alternatively, update SWIG path in {{{$PJDIR/pjsip-apps/src/ apjsua/jni/Android.mk}}} file.46 1. Run {{{ndk-build}}} from directory {{{$PJDIR/pjsip-apps/src/ apjsua}}}, note that the Android NDK root should be in the PATH, e.g:45 - Alternatively, update SWIG path in {{{$PJDIR/pjsip-apps/src/pjsua/android/jni/Android.mk}}} file. 46 1. Run {{{ndk-build}}} from directory {{{$PJDIR/pjsip-apps/src/pjsua/android}}}, note that the Android NDK root should be in the PATH, e.g: 47 47 {{{ 48 48 $ cd /path/to/your/pjsip/dir 49 $ cd pjsip-apps/src/ apjsua49 $ cd pjsip-apps/src/pjsua/android 50 50 $ ndk-build 51 51 }}} 52 1. Create Android project from apjsua. In Eclipse:52 1. Create Android project from pjsua. In Eclipse: 53 53 a. From menu: '''File''' --> '''New''' --> '''Project''' 54 54 a. Select '''Android Project from Existing Code''', press '''Next''' 55 a. In ''Root Directory'', put the location of '''apjsua''' source code (i.e. {{{$PJDIR/pjsip-apps/src/apjsua}}}) and press '''Finish''' 56 1. You may need to select different Android SDK than what is configured in apjsua. You can do this from the project's '''Properties'''. 57 1. You can modify {{{apjsua/res/raw/config.txt}}} for apjsua's config file. 55 a. In ''Root Directory'', put the location of '''pjsua''' source code (i.e. {{{$PJDIR/pjsip-apps/src/pjsua/android}}}) and press '''Finish''' 56 1. You may need to select different Android SDK than what is configured in pjsua. You can do this from the project's '''Properties'''. 58 57 1. Run it. 58 1. You will see telnet instructions on the device's screen. Telnet to this address to operate the application. 59 59 60 60 … … 63 63 Here are the steps for debugging PJSIP native code using Eclipse: 64 64 1. Build PJSIP with debugging enabled, e.g: insert {{{CFLAGS += -g}}} into {{{user.mak}}} in PJSIP root directory. 65 1. Make sure that the JNI part of the application is built using {{{ndk-build}}}. For reference, check apjsua's {{{Android.mk}}} build config in {{{pjsip-apps/src/apjsua/jni}}}, it contains sample of how to import PJSIP build settings (build search paths, build flags, etc) and SWIG invocation.65 1. Make sure that the JNI part of the application is built using {{{ndk-build}}}. For reference, check pjsua's {{{Android.mk}}} build config in {{{pjsip-apps/src/pjsua/android/jni}}}, it contains sample of how to import PJSIP build settings (build search paths, build flags, etc) and SWIG invocation. 66 66 1. Enable NDK plugin for Eclipse, check [http://tools.android.com/recent/usingthendkplugin this] and follow the instructions. 67 67 - CDT can also be fetched from [http://www.eclipse.org/cdt/downloads.php CDT download page], normally Eclipse for C/C++ will have CDT installed, just make sure that the CDT version is 7.0.2 or newer.