Changes between Version 70 and Version 71 of Getting-Started/Android
- Timestamp:
- Sep 27, 2017 2:55:58 AM (7 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Getting-Started/Android
v70 v71 4 4 5 5 6 Android target is available since 2.2.7 8 6 == Requirements == 9 7 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] (minimum version r8b).8 * 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 9 * Optional if you want to build and and run the sample applications (i.e: pjsua2 and pjsua): 12 * [http://www.swig.org/download.html SWIG] (minimum version 2.0.5)10 * [http://www.swig.org/download.html SWIG] 13 11 * ~~Eclipse with [http://developer.android.com/tools/sdk/eclipse-adt.html ADT Plugin]~~ (deprecated since 2.6) 14 12 * [https://developer.android.com/studio/index.html Android Studio] … … 17 15 == Build Preparation == 18 16 19 1. [wiki:Getting-Started/Download-Source#GettingfromSubversiontrunk Get the source code from repository], 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).17 1. [wiki:Getting-Started/Download-Source#GettingfromSubversiontrunk Get the source code from repository], if you haven't already. 20 18 2. Set your [wiki:Getting-Started/Build-Preparation config_site.h] to the following: 21 19 {{{ … … 43 41 * The {{{./configure-android}}} is a wrapper that calls the standard {{{./configure}}} script with settings suitable for Android target. Standard {{{./configure}}} options should be applicable to this script too. Please check {{{./configure-android --help}}} for more info. 44 42 * Other customizations are similar to what is explained in [wiki:Getting-Started/Autoconf Building with GNU] page. 45 * For some targets, there may be error like46 {{{47 error: undefined reference to '__stack_chk_fail_local'48 }}}49 this can be fixed by adding {{{-fno-stack-protector}}} into CFLAGS, e.g: via {{{user.mak}}} file.50 43 51 44 == Video Support == … … 61 54 ==== OpenH264 (recommended) ==== 62 55 Provides video codec H.264, alternatively you can use ffmpeg (together with libx264). 63 1. Follow the instructions in ticket #1 758 (or ticket #1947 if you use PJSIP version 2.6 or above).56 1. Follow the instructions in ticket #1947 (or ticket #1758 if you use PJSIP before version 2.6). 64 57 1. Copy all library .so files into your Android application project directory, for example: 65 58 {{{ … … 92 85 Specify third-party video libraries when invoking {{{./configure-android}}}, e.g: 93 86 {{{ 94 $ ./configure-android --with-openh264=/Users/me/openh264/android --with-libyuv=/Users/me/libyuv-android/jni95 }}} 96 97 Make sure openh264 and libyuv aredetected by {{{./configure-android}}}:87 $ ./configure-android --with-openh264=/Users/me/openh264/android 88 }}} 89 90 Make sure openh264 is detected by {{{./configure-android}}}: 98 91 {{{ 99 92 ... 100 93 Using OpenH264 prefix... /Users/me/openh264/android 101 94 checking OpenH264 availability... ok 102 Using libyuv prefix... /Users/me/libyuv-android/jni 103 checking for I420Scale in -lyuv... yes 104 ... 105 }}} 106 107 '''Update''': since PJSIP 2.5.5, libyuv is included in the PJSIP package and configure script param {{{--with-libyuv}}} is removed, check ticket #1937 for more info. 95 ... 96 }}} 97 98 '''Note''': if you use PJSIP before version 2.6, you need to specify external libyuv via the configure script param {{{--with-libyuv}}}, check ticket #1776 for more info. 108 99 109 100 === Adding Video Capture Device to Your Application === … … 292 283 }}} 293 284 285 {{{#!comment 286 ###Is this still relevant? 287 294 288 === Issue with using OpenSSL on Android M === 295 289 … … 300 294 }}} 301 295 The solution would be to include the OpenSSL library in your project/APK. 296 297 }}} 302 298 303 299 == Important Issue(s) when Developing Android Apps == #issues … … 336 332 }}} 337 333 334 === Build failure or configure-android error with "--use-ndk-cflags" using android-ndk-r13 or later === #err_ndkr13 335 336 Release notes to !r13 stated that NDK_TOOLCHAIN_VERSION now defaults to Clang, resulting error on configure-android which expects gcc: 337 {{{ 338 configure-android error: compiler not found, please check environment settings (TARGET_ABI, etc) 339 }}} 340 341 It can also cause PJSIP to fail to build on android-ndk-r15. 342 343 As a workaround, you can specify NDK_TOOLCHAIN_VERSION (to 4.9) to use gcc. 344 {{{ 345 NDK_TOOLCHAIN_VERSION=4.9 TARGET_ABI=armeabi-v7a ./configure-android --use-ndk-cflags 346 }}} 338 347 339 348 === !UnsatisfiedLinkError exception with "cannot locate 'rand'" message === #failloadlib … … 356 365 - You built the lib using newer APP_PLATFORM on an older device. Please have a look at [#failloadlib here] 357 366 367 {{{#!comment 358 368 === Error configure-android with "--use-ndk-cflags" using android-ndk-r11 or later === #err_ndkr11 359 369 … … 366 376 Please apply the fix in ticket #1950. 367 377 368 === Error configure-android with "--use-ndk-cflags" using android-ndk-r13 or later === #err_ndkr13369 370 Release notes to !r13 stated that NDK_TOOLCHAIN_VERSION now defaults to Clang, resulting error on configure-android which expects gcc:371 {{{372 configure-android error: compiler not found, please check environment settings (TARGET_ABI, etc)373 }}}374 375 As a workaround, you can specify NDK_TOOLCHAIN_VERSION (to 4.9) to use gcc.376 {{{377 NDK_TOOLCHAIN_VERSION=4.9 TARGET_ABI=armeabi-v7a ./configure-android --use-ndk-cflags378 378 }}} 379 379