Merge branch 'master' into easysetup & CBOR changes
[platform/upstream/iotivity.git] / service / easy-setup / readme.txt
1
2 Steps to build and deploy Easysetup Mediator in Android platform
3
4 1) Compilation using Scons
5         0) Prerequisite exports for Android
6                 export ANDROID_HOME=<ANDROID_HOME>
7                 export ANDROID_NDK=<ANDROID_NDK>
8         a) In the IoTivity root source folder execute
9                  scons TARGET_OS=android TARGET_ARCH=armeabi TARGET_TRANSPORT=IP RELEASE=0
10         
11         b) If the project is setup correctly, you should see a BUILD SUCCESSFUL message on the terminal
12                 You should see the .aar files generated inside of '<iotivity>/android/android_api/base/build/outputs/aar' directory. The .aar files contain jni directory and also a .jar file
13                 
14         c) Now navigate to the Easysetup NDK folder 
15                 <iotivity-root>/service/easy-setup/sdk/mediator/android
16                 
17         d) Execute NDK-Build with the following command to cross compiled Easysetup JNI .so files
18                  ~/madan/android-ndk-r10d/ndk-build
19                  
20         e) Step (d) will generate cross compiled Easysetup JNI .so files in the following folder
21                 
22 2) Compilation using Android Studio
23         
24         0) Prerequisite for running the Android application
25                 Install Android Studio and use the Android SDK manager to update the Android API to 21
26         
27         a) Import following projects to the Studio using the "File->New->Import Project"
28                 - service\easy-setup\sdk\android\EasySetupCore
29                 - service\easy-setup\sampleapp\android\EasySetup
30         
31         b) EasySetupCore is dependent on the .aar files generated in 1.b 
32                 1) To add an .aar file to the 'EasySetupCore' project,
33                         a.Right click on EasySetup->New->Module->Import .JAR or .AAR Package
34                         b.Select the .aar file(iotivity-armeabi-base-*.aar) from the location in steps 1.b
35                         c.Right click on EasySetup->Open Module Settings
36                         d.Select each sample app module under 'Modules'->Dependencies->Add->Module Dependency
37                         
38         c)      Build EasySetupCore project using "Android Studio->Build->Make Module "easySetupCore"
39                 If the project is setup correctly, you should see a BUILD SUCCESSFUL in the Android Studio Gradle Build terminal
40                         You should see the .aar file generated inside of 
41                         'iotivity\service\easy-setup\sdk\mediator\android\easySetupCore\build\outputs\aar'
42         
43         d) EasySetup application is also dependent on the .so files generated in 1.d step
44                 1) Drag and drop the following .so files in to the EasySetup\app\src\main\jniLibs\armeabi folder
45                         - libeasysetup-jni.so [Easy Setup file]
46                         
47         e) EasySetup is also dependent on the .aar files generated in 1.b and 2.c steps
48                 1) To add an .aar file to the 'EasySetup' project,
49                         a.Right click on EasySetup->New->Module->Import .JAR or .AAR Package
50                         b.Select the .aar file from the location in steps 1.b and 2.b above
51                         c.Right click on EasySetup->Open Module Settings
52                         d.Select each sample app module under 'Modules'->Dependencies->Add->Module Dependency
53                         e.The .aar files (easySetupCore-*.aar & iotivity-armeabi-base-*.aar) selected in step 2.c.1.b above should be present. Select it.
54         
55                         
56         e) Run "Easy Setup" as an Android application
57         
58 Folder structure
59 iotivity/
60 └── service
61         └── easy-setup/
62                 │── SConscript
63                 │── sdk
64                 │     └── inc
65                 │     └── src
66                 │     └── android
67                 │     └── arduino
68                 │             └──wifi
69                 │                     └──inc            
70                 │                     └──src            
71                 │── sampleapp
72                 │     └──android
73                 │     └──arduino                
74                 │     └──linux
75                 └── README - You are reading this.
76
77