Changes between Version 81 and Version 82 of Getting-Started/Android


Ignore:
Timestamp:
Feb 16, 2022 11:09:43 AM (2 years ago)
Author:
ming
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Getting-Started/Android

    v81 v82  
    99 * Optional if you want to build and and run the sample applications (i.e: pjsua2 and pjsua): 
    1010  * [http://www.swig.org/download.html SWIG] 
    11   * ~~Eclipse with [http://developer.android.com/tools/sdk/eclipse-adt.html ADT Plugin]~~ (deprecated since 2.6) 
    1211  * [https://developer.android.com/studio/index.html Android Studio] 
    13   * Telnet application to interact with PJSUA command line. If you are not familiar with telnet, please find a tutorial suitable for your development platform. 
    1412 
    1513== Build Preparation == 
     
    5957   Also you should adjust [https://developer.android.com/ndk/guides/abis.html#gc Application.mk] and [https://developer.android.com/ndk/guides/abis.html#am library packaging path] (see also #1803). 
    6058 
    61  * If your app is intended to run on older Android devices, you may need to set {{{APP_PLATFORM}}} to {{{android-20}}} or lower, please check [#failloadlib this issue]. 
    62  
    6359=== Notes === 
    6460 * 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. 
     
    7167 - native capture 
    7268 - native OpenGL ES 2.0 renderer (requires Android 2.2 (API level 8) or higher). 
    73  - H.264 codec (via OpenH264 library, see below) 
     69 - H.264 codec (via OpenH264 library or AMediaCodec, see below) 
    7470 
    7571=== Requirements === 
     
    7773==== OpenH264 (this is recommended if you need H264 codec) ==== 
    7874Provides video codec H.264, alternatively you can use ffmpeg (together with libx264). 
    79        1. Follow the instructions in ticket #1947 (or ticket #1758 if you use PJSIP before version 2.6). 
     75       1. Follow the instructions in ticket #1947. 
    8076       1. Copy all library .so files into your Android application project directory, for example: 
    8177{{{ 
     
    8581==== libvpx (if you need VP8 or VP9 codec) ==== 
    8682       [https://www.webmproject.org/code/ libvpx]. 
    87  
    88 ==== libyuv (recommended) ==== 
    89 Provides format conversion and video manipulation, alternatively you can use ffmpeg. If you are using 2.5.5 or newer, libyuv should be built and enabled automatically, see ticket #1937 for more info. If you are using 2.5.1 or older: 
    90        1. Follow the instructions in ticket #1776 
    91        1. Copy all library .so files into your Android application project directory, for example: 
    92 {{{ 
    93 cp /Users/me/libyuv-android/*.so /Users/me/pjproject-2.0/pjsip-apps/src/swig/java/android/libs/armeabi 
    94 }}} 
    9583 
    9684==== ffmpeg (optional) ==== 
     
    207195 }}} 
    208196 
    209 {{{#!comment 
    210 ###Is this still relevant? 
    211  
    212 === Issue with using OpenSSL on Android M === 
    213  
    214 As reported [https://plus.google.com/+AndroidDevelopers/posts/bLqbRJ5o5id here], Google has moved from OpenSSL to BoringSSL, and hence app that links against platform libraries (such as libcrypto.so) will likely break. 
    215 On Android M, you might get error like this: 
    216 {{{ 
    217 java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "OPENSSL_add_all_algorithms_noconf" referenced by "/data/app/someapp/lib/arm/libMyAppApp-arm-android-eabi.so" 
    218 }}} 
    219 The solution would be to include the OpenSSL library in your project/APK. 
    220  
    221 }}} 
    222  
    223197== Trying our sample application and creating your own 
    224198 
     
    364338}}} 
    365339 
    366 === Build failure or configure-android error with "--use-ndk-cflags" using android-ndk-r13 or later === #err_ndkr13 
    367  
    368 Release notes to !r13 stated that NDK_TOOLCHAIN_VERSION now defaults to Clang, resulting error on configure-android which expects gcc: 
    369 {{{ 
    370 configure-android error: compiler not found, please check environment settings (TARGET_ABI, etc) 
    371 }}} 
    372  
    373 It can also cause PJSIP to fail to build on android-ndk-r15. 
    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 
    378 }}} 
    379  
    380 === !UnsatisfiedLinkError exception with "cannot locate 'rand'" message === #failloadlib 
    381  
    382 This may occur when running pjsua2 sample app: 
    383 {{{ 
    384 Exception Ljava/lang/UnsatisfiedLinkError; thrown while initializing Lorg/pjsip/pjsua2/app/MyApp; 
    385 ... 
    386 java.lang.UnsatisfiedLinkError: Cannot load library: reloc_library[1285]:    37 cannot locate 'rand'... 
    387 }}} 
    388  
    389 As described [http://stackoverflow.com/questions/27338318/cannot-load-library-reloc-library1285-cannot-locate-rand here], this happens if you've built your native components with the android-21 target, but are trying to run it on a device with an older Android version, so re-run configure with APP_PLATFORM set to lower platform version, e.g: 
    390 {{{ 
    391 APP_PLATFORM=android-19 ./configure-android 
    392 }}} 
    393  
    394340=== !UnsatisfiedLinkError exception with "Native method not found: org.pjsip.pjsua2.pjsua2JNI.swig_module_init" message === #no_swig_module_init 
    395341The reason might be: 
     
    397343- You built the lib using newer APP_PLATFORM on an older device. Please have a look at [#failloadlib here] 
    398344 
    399 {{{#!comment 
    400 === Error configure-android with "--use-ndk-cflags" using android-ndk-r11 or later === #err_ndkr11  
    401  
    402 Starting from !r11, Android NDK has removed the sample folder and changed the toolchain version, hence the configure-android with "--use-ndk-cflags" will fail with this error: 
    403 {{{ 
    404 samples/hello-jni: No such file or directory.  Stop. 
    405 configure-android error: failed to run ndk-build, check ANDROID_NDK_ROOT env var 
    406 }}} 
    407  
    408 Please apply the fix in ticket #1950. 
    409  
    410 }}} 
    411  
    412345=== A review of Android audio output latency === #latency 
    413346