Changes between Version 70 and Version 71 of Getting-Started/Android


Ignore:
Timestamp:
Sep 27, 2017 2:55:58 AM (7 years ago)
Author:
ming
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Getting-Started/Android

    v70 v71  
    44 
    55 
    6 Android target is available since 2.2. 
    7  
    86== Requirements == 
    97 
    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]. 
    119 * 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] 
    1311  * ~~Eclipse with [http://developer.android.com/tools/sdk/eclipse-adt.html ADT Plugin]~~ (deprecated since 2.6) 
    1412  * [https://developer.android.com/studio/index.html Android Studio] 
     
    1715== Build Preparation == 
    1816 
    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. 
    2018 2. Set your [wiki:Getting-Started/Build-Preparation config_site.h] to the following: 
    2119  {{{ 
     
    4341 * 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. 
    4442 * 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 like 
    46    {{{ 
    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. 
    5043 
    5144== Video Support == 
     
    6154==== OpenH264 (recommended) ==== 
    6255Provides video codec H.264, alternatively you can use ffmpeg (together with libx264). 
    63        1. Follow the instructions in ticket #1758 (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). 
    6457       1. Copy all library .so files into your Android application project directory, for example: 
    6558{{{ 
     
    9285Specify third-party video libraries when invoking {{{./configure-android}}}, e.g: 
    9386{{{ 
    94 $ ./configure-android --with-openh264=/Users/me/openh264/android --with-libyuv=/Users/me/libyuv-android/jni 
    95 }}} 
    96  
    97 Make sure openh264 and libyuv are detected by {{{./configure-android}}}: 
     87$ ./configure-android --with-openh264=/Users/me/openh264/android 
     88}}} 
     89 
     90Make sure openh264 is detected by {{{./configure-android}}}: 
    9891{{{ 
    9992... 
    10093Using OpenH264 prefix... /Users/me/openh264/android 
    10194checking 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. 
    10899 
    109100=== Adding Video Capture Device to Your Application === 
     
    292283 }}} 
    293284 
     285{{{#!comment 
     286###Is this still relevant? 
     287 
    294288=== Issue with using OpenSSL on Android M === 
    295289 
     
    300294}}} 
    301295The solution would be to include the OpenSSL library in your project/APK. 
     296 
     297}}} 
    302298 
    303299== Important Issue(s) when Developing Android Apps == #issues 
     
    336332}}} 
    337333 
     334=== Build failure or configure-android error with "--use-ndk-cflags" using android-ndk-r13 or later === #err_ndkr13 
     335 
     336Release notes to !r13 stated that NDK_TOOLCHAIN_VERSION now defaults to Clang, resulting error on configure-android which expects gcc: 
     337{{{ 
     338configure-android error: compiler not found, please check environment settings (TARGET_ABI, etc) 
     339}}} 
     340 
     341It can also cause PJSIP to fail to build on android-ndk-r15. 
     342 
     343As a workaround, you can specify NDK_TOOLCHAIN_VERSION (to 4.9) to use gcc. 
     344{{{ 
     345NDK_TOOLCHAIN_VERSION=4.9 TARGET_ABI=armeabi-v7a ./configure-android --use-ndk-cflags 
     346}}} 
    338347 
    339348=== !UnsatisfiedLinkError exception with "cannot locate 'rand'" message === #failloadlib 
     
    356365- You built the lib using newer APP_PLATFORM on an older device. Please have a look at [#failloadlib here] 
    357366 
     367{{{#!comment 
    358368=== Error configure-android with "--use-ndk-cflags" using android-ndk-r11 or later === #err_ndkr11  
    359369 
     
    366376Please apply the fix in ticket #1950. 
    367377 
    368 === Error configure-android with "--use-ndk-cflags" using android-ndk-r13 or later === #err_ndkr13 
    369  
    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-cflags 
    378378}}} 
    379379