Changes between Version 52 and Version 53 of Getting-Started/Android


Ignore:
Timestamp:
May 11, 2015 9:13:27 AM (6 years ago)
Author:
ming
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Getting-Started/Android

    v52 v53  
    221221 1. Load the PJSIP project to Eclipse (if not yet), and try put breakpoint anywhere in the PJSIP code before launching the Android application debug configuration in Eclipse. 
    222222 
     223== OpenSSL Support == 
     224 
     225 1. Build OpenSSL (tested with OpenSSL 1.0.2a) for Android. The instruction provided here is specifically for arm64. For other architectures, modify accordingly. Please visit [http://stackoverflow.com/questions/11929773/compiling-the-latest-openssl-for-android this page] for reference and some examples. Note: change the NDK path below. 
     226 {{{ 
     227cd openssl-1.0.2a 
     228 
     229export NDK=[your_android_ndk_path]/android-ndk-r10d 
     230 
     231$NDK/build/tools/make-standalone-toolchain.sh --platform=android-21 --toolchain=aarch64-linux-android-4.9 --install-dir=`pwd`/android-toolchain-arm64 
     232export TOOLCHAIN_PATH=`pwd`/android-toolchain-arm64/bin 
     233export TOOL=aarch64-linux-android 
     234export NDK_TOOLCHAIN_BASENAME=${TOOLCHAIN_PATH}/${TOOL} 
     235export CC=$NDK_TOOLCHAIN_BASENAME-gcc 
     236export CXX=$NDK_TOOLCHAIN_BASENAME-g++ 
     237export LINK=${CXX} 
     238export LD=$NDK_TOOLCHAIN_BASENAME-ld 
     239export AR=$NDK_TOOLCHAIN_BASENAME-ar 
     240export RANLIB=$NDK_TOOLCHAIN_BASENAME-ranlib 
     241export STRIP=$NDK_TOOLCHAIN_BASENAME-strip 
     242export ARCH_FLAGS= 
     243export ARCH_LINK= 
     244export CPPFLAGS=" ${ARCH_FLAGS} -fpic -ffunction-sections -funwind-tables -fstack-protector -fno-strict-aliasing -finline-limit=64 " 
     245export CXXFLAGS=" ${ARCH_FLAGS} -fpic -ffunction-sections -funwind-tables -fstack-protector -fno-strict-aliasing -finline-limit=64 -frtti -fexceptions " 
     246export CFLAGS=" ${ARCH_FLAGS} -fpic -ffunction-sections -funwind-tables -fstack-protector -fno-strict-aliasing -finline-limit=64 " 
     247export LDFLAGS=" ${ARCH_LINK} " 
     248 
     249./Configure android 
     250make 
     251 }}} 
     252 Then copy the libraries into libs folder: 
     253 {{{ 
     254mkdir libs 
     255cp lib*.a libs/ 
     256 }}} 
     257 1. Specify OpenSSL location when running {{{configure-android}}}, for example (with Bash): (change the openssl path folder) 
     258 {{{ 
     259TARGET_ABI=arm64-v8a ./configure-android --use-ndk-cflags --with-ssl=[your_openssl_path]/openssl-1.0.2a 
     260 }}} 
     261 And check that OpenSSL is detected by the configure script: 
     262 {{{ 
     263... 
     264checking for OpenSSL installations.. 
     265checking openssl/ssl.h usability... yes 
     266checking openssl/ssl.h presence... no 
     267aconfigure: WARNING: openssl/ssl.h: accepted by the compiler, rejected by the preprocessor! 
     268aconfigure: WARNING: openssl/ssl.h: proceeding with the compiler's result 
     269checking for openssl/ssl.h... yes 
     270checking for ERR_load_BIO_strings in -lcrypto... yes 
     271checking for SSL_library_init in -lssl... yes 
     272OpenSSL library found, SSL support enabled 
     273... 
     274 }}} 
     275 1. Build the libraries: 
     276 {{{ 
     277make dep && make 
     278 }}} 
     279 If you encounter linking errors, you need to add this in user.mak: 
     280 {{{ 
     281export LIBS += "-ldl -lz" 
     282 }}} 
    223283 
    224284== Important Issue(s) when Developing Android Apps == #issues