IoTivity uses the Android Java Coding Standard for Java code. In consequence, OTGC Android App uses the same coding standard.
The OTGC Android App uses the binary distribution of the IoTivity-lite Android API.
IoTivity-lite Android API is compiled for a minimum SDK of API 21: Android 5.0 (Lollipop), so OTGC Android App shall use the same value.
To import the IoTivity-lite Android API Binary into the OTGC Android App project:
-
Go to <iotivity-lite>/swig/iotivity-lite-java/libs.
-
Copy iotivity-lite.jar into <otgc-android>/otgc/src/main/jniLibs.
-
Copy libiotivity-lite-jni.so into <otgc-android>/otgc/src/main/<target_arch>
where <target_arch> is one of the following values: x86, x86_64, armeabi, armeabi-v7a, armeabi-v7a-hard or arm64-v8a.
Android Studio loads the library, including the contents of the library module. IoTivity-lite Android APIs can now be used in the OTGC Android App project.
The steps required to build the binary of the IoTivity-lite Android API is shown below:
- Change to the swig branch.
git checkout swig
- Go to the android directory.
cd <iotivity-lite>/port/android
- Execute the command to build the library.
make NDK_HOME=<ndk-directory> ANDROID_API=21 DEBUG=1 SECURE=1 IPV4=1 TCP=0 PKI=1 DYNAMIC=1 CLOUD=0 JAVA=1 IDD=1
Once built, the library can be found at:
<iotivity-lite>/swig/iotivity-lite-java/libs
This library is released under Apache 2.0 license (http://www.apache.org/licenses/LICENSE-2.0.txt).
Please see the file 'LICENSE.md' in the root folder for further information.