Changes between Version 81 and Version 82 of Getting-Started/Android
- Timestamp:
- Feb 16, 2022 11:09:43 AM (3 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Getting-Started/Android
v81 v82 9 9 * Optional if you want to build and and run the sample applications (i.e: pjsua2 and pjsua): 10 10 * [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)12 11 * [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.14 12 15 13 == Build Preparation == … … 59 57 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). 60 58 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 63 59 === Notes === 64 60 * 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. … … 71 67 - native capture 72 68 - 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) 74 70 75 71 === Requirements === … … 77 73 ==== OpenH264 (this is recommended if you need H264 codec) ==== 78 74 Provides 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. 80 76 1. Copy all library .so files into your Android application project directory, for example: 81 77 {{{ … … 85 81 ==== libvpx (if you need VP8 or VP9 codec) ==== 86 82 [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 #177691 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/armeabi94 }}}95 83 96 84 ==== ffmpeg (optional) ==== … … 207 195 }}} 208 196 209 {{{#!comment210 ###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 223 197 == Trying our sample application and creating your own 224 198 … … 364 338 }}} 365 339 366 === Build failure or configure-android error with "--use-ndk-cflags" using android-ndk-r13 or later === #err_ndkr13367 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-cflags378 }}}379 380 === !UnsatisfiedLinkError exception with "cannot locate 'rand'" message === #failloadlib381 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-android392 }}}393 394 340 === !UnsatisfiedLinkError exception with "Native method not found: org.pjsip.pjsua2.pjsua2JNI.swig_module_init" message === #no_swig_module_init 395 341 The reason might be: … … 397 343 - You built the lib using newer APP_PLATFORM on an older device. Please have a look at [#failloadlib here] 398 344 399 {{{#!comment400 === Error configure-android with "--use-ndk-cflags" using android-ndk-r11 or later === #err_ndkr11401 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 var406 }}}407 408 Please apply the fix in ticket #1950.409 410 }}}411 412 345 === A review of Android audio output latency === #latency 413 346