help_vars = Variables()
if not env.get('ANDROID_NDK'):
SConscript('../../extlibs/android/ndk/SConscript')
- help_vars.Add(PathVariable('ANDROID_NDK', 'Android NDK root directory', os.path.join(env.get('SRC_DIR'), 'extlibs', 'android', 'ndk', 'android-ndk-r10d')))
+ help_vars.Add(PathVariable('ANDROID_NDK', 'Android NDK root directory', os.path.join(env.get('SRC_DIR'), 'extlibs', 'android', 'ndk', 'android-ndk-r10e')))
if not env.get('ANDROID_GRADLE'):
SConscript('../../extlibs/android/gradle/SConscript')
* # scons ANDROID_NDK=<path to android NDK> ... *
*******************************************************************************
'''
- android_ndk = os.path.join(env.get('SRC_DIR'), 'extlibs', 'android', 'ndk', 'android-ndk-r10d')
+ android_ndk = os.path.join(env.get('SRC_DIR'), 'extlibs', 'android', 'ndk', 'android-ndk-r10e')
if env.get('ANDROID_GRADLE'):
android_gradle = env.get('ANDROID_GRADLE')
env.AppendUnique(LIBS = ['mbedtls','mbedx509','mbedcrypto'])
else:
env.AppendUnique(LIBS = ['mbedcrypto'])
-
+
# From android-5 (API > 20), all application must be built with flags '-fPIE' '-pie'.
# Due to the limitation of Scons, it's required to added it into the command line
# directly (otherwise, it will also be added when build share library)
# Build flags
######################################################################
src_dir = env.get('SRC_DIR')
-path = os.path.join(src_dir, 'extlibs', 'android', 'ndk', 'android-ndk-r10d')
+path = os.path.join(src_dir, 'extlibs', 'android', 'ndk', 'android-ndk-r10e')
# check 'ndk' library, if it doesn't exits, ask user to download it
if not os.path.exists(path):
if host_os == 'linux2' :
archType = 8 * struct.calcsize("P")
if archType == 64:
- env.Download('android-ndk-r10d.bin', 'http://dl.google.com/android/ndk/android-ndk-r10d-linux-x86_64.bin')
+ env.Download('android-ndk-r10e.bin', 'http://dl.google.com/android/ndk/android-ndk-r10e-linux-x86_64.bin')
else:
- env.Download('android-ndk-r10d.bin', 'http://dl.google.com/android/ndk/android-ndk-r10d-linux-x86.bin')
+ env.Download('android-ndk-r10e.bin', 'http://dl.google.com/android/ndk/android-ndk-r10e-linux-x86.bin')
- os.system("chmod a+x android-ndk-r10d.bin")
- os.system("./android-ndk-r10d.bin")
+ os.system("chmod a+x android-ndk-r10e.bin")
+ os.system("./android-ndk-r10e.bin")
else:
if target_arch in ['x86_64']:
- env.Download('android-ndk-r10d', 'http://dl.google.com/android/ndk/android-ndk-r10d-windows-x86_64.exe')
+ env.Download('android-ndk-r10e', 'http://dl.google.com/android/ndk/android-ndk-r10e-windows-x86_64.exe')
if target_arch in ['x86']:
- env.Download('android-ndk-r10d', 'http://dl.google.com/android/ndk/android-ndk-r10d-windows-x86.exe')
+ env.Download('android-ndk-r10e', 'http://dl.google.com/android/ndk/android-ndk-r10e-windows-x86.exe')
Keyword arguments:
avd_name -- the name of the created android virtual device
console_port -- the port number that will attempt to be used
- by the when starting the avd
+ by the when starting the avd
'''
command = 'emulator -avd ' + avd_name + ' -port ' + console_port + ' -wipe-data -no-boot-anim -no-window'
subprocess.Popen([command], shell=True)
'''
Use gradlew to build the android smoke tests
'''
- os.environ['ANDROID_NDK_HOME'] = os.path.abspath(os.getcwd() + '/../../extlibs/android/ndk/android-ndk-r10d')
+ os.environ['ANDROID_NDK_HOME'] = os.path.abspath(os.getcwd() + '/../../extlibs/android/ndk/android-ndk-r10e')
command = './gradlew assembleAndroidTest'
subprocess.Popen([command], shell=True).wait()
def create_avd(avd_name, target, abi):
'''
- Create a new android virtual device
+ Create a new android virtual device
Keyword arguments:
avd_name -- the name of the created avd
'''
avalible_port = find_avalible_console_port()
avd_name = 'smoke_test_avd_' + avalible_port
-
+
create_avd(avd_name, target, abi)
-
+
start_avd(avd_name, avalible_port)
wait_for_avd_boot(avalible_port)
-
+
build_smoketests();
install_smoketests(avalible_port)
run_smoketests(avalible_port)
-
+
kill_avd(avalible_port)
delete_avd(avd_name)
if __name__ == "__main__":
main(sys.argv[1:])
-
-
===================================
•Preconditons :
•Supported version : 5.0 ( Lollipop )
-•Required NDK version : android-ndk-r10d ( https://developer.android.com/tools/sdk/ndk/index.html )
+•Required NDK version : android-ndk-r10e ( https://developer.android.com/tools/sdk/ndk/index.html )
Building CA Library for android :
<iotivity-root>/service/easy-setup/mediator/richsdk/android
d) Execute NDK-Build with the following command to cross compiled Easysetup JNI .so files
- <iotivity>/extlibs/android/ndk/android-ndk-r10d/ndk-build
+ <iotivity>/extlibs/android/ndk/android-ndk-r10e/ndk-build
e) Step (d) will generate cross compiled Easysetup JNI .so files in the following folder
<iotivity>/service/easy-setup/mediator/richsdk/android/libs/armeabi
then
mkdir -p ${ANDROID_NDK}
pushd ${ANDROID_NDK}
- wget_if_not_exists "android-ndk-r10d-linux-x86_64.bin" http://dl.google.com/android/ndk/android-ndk-r10d-linux-x86_64.bin
- chmod a+x android-ndk-r10d-linux-x86_64.bin
- ./android-ndk-r10d-linux-x86_64.bin
+ wget_if_not_exists "android-ndk-r10e-linux-x86_64.bin" http://dl.google.com/android/ndk/android-ndk-r10e-linux-x86_64.bin
+ chmod a+x android-ndk-r10e-linux-x86_64.bin
+ ./android-ndk-r10e-linux-x86_64.bin
popd
fi