if target_os == 'linux':
SConscript('unittest/SConscript')
-# Go to build sample apps
-SConscript('examples/SConscript')
-
# Go to build c++ wrapper
SConscript('cpp-wrapper/SConscript')
if target_os == 'android':
SConscript('android/SConscript')
+
+# Go to build sample apps
+SConscript('examples/SConscript')
\ No newline at end of file
SConscript('consumer/SConscript')
# Go to build sample apps using wrapper
-SConscript('examples/linux/SConscript')
+if target_os == 'linux':
+ SConscript('examples/linux/SConscript')
--- /dev/null
+#//******************************************************************
+#//
+#// Copyright 2016 Samsung Electronics All Rights Reserved.
+#//
+#//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
+#//
+#// Licensed under the Apache License, Version 2.0 (the "License");
+#// you may not use this file except in compliance with the License.
+#// You may obtain a copy of the License at
+#//
+#// http://www.apache.org/licenses/LICENSE-2.0
+#//
+#// Unless required by applicable law or agreed to in writing, software
+#// distributed under the License is distributed on an "AS IS" BASIS,
+#// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#// See the License for the specific language governing permissions and
+#// limitations under the License.
+#//
+#//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
+
+import os
+import platform
+Import('env')
+
+android_home = env.get('ANDROID_HOME')
+
+ANDROID_TARGET_ARCH = env.get('TARGET_ARCH')
+if env.get('RELEASE'):
+ ANDROID_RELEASE="release"
+else:
+ ANDROID_RELEASE="debug"
+
+os.environ['ANDROID_HOME'] = env.get('ANDROID_HOME')
+os.environ['ANDROID_NDK_HOME'] = env.get('ANDROID_NDK')
+
+if not os.path.exists(android_home + '/platforms/android-21') or not os.path.exists(android_home + '/build-tools/20.0.0'):
+ print '''
+***************************************** Info ********************************
+* Either 'Android API 21' is not installed or 'Android SDK Build Tools *
+* 20.0.0' is not installed. The Android SDK Manager will now open. Please *
+* be sure to deselect all options, then select the following 2 packages: *
+* 1. Under "Tools" select "Android SDK Build-tools" Revision 20. *
+* 2. Under "Android 5.0.1 (API 21)" select "SDK Platform" *
+* 3. Continue by selecting "Install 2 Packages" *
+* *
+* NOTE: If you have an http proxy, please press ctrl+c now and edit/create *
+* the following file in your $HOME directory as follows: *
+* *
+* Edit/Create file: "$HOME/.android/androidtool.cfg" *
+* *
+* http.proxyPort=<YOUR_PORT_NUMBER> *
+* sdkman.monitor.density=108 *
+* http.proxyHost=<YOUR_HTTP_PROXY_ADDRESS> *
+* sdkman.show.update.only=true *
+* sdkman.ask.adb.restart=false *
+* sdkman.force.http=true *
+* sdkman.show.updateonly=true *
+* *
+*******************************************************************************
+
+...Opening Android SDK Manager now. Once you are finished, the build will continue.
+'''
+ os.system(android_home + '/tools/android')
+
+def ensure_libs(target, source, env):
+ return target, [source,
+ env.get('BUILD_DIR') + 'libnotification_provider_jni.so',
+ env.get('BUILD_DIR') + 'libnotification_provider_wrapper.so',
+ env.get('BUILD_DIR') + 'libnotification_provider.so',
+ env.get('BUILD_DIR') + 'libnotification_consumer_jni.so',
+ env.get('BUILD_DIR') + 'libnotification_consumer_wrapper.so',
+ env.get('BUILD_DIR') + 'libnotification_consumer.so']
+
+jdk_env = Environment(ENV=os.environ)
+jdk_env['BUILDERS']['Gradle'] = Builder(action = env.get('ANDROID_GRADLE') +
+ ' build -bservice/notification/examples/android/NotiConsumerExample/build.gradle -PTARGET_ARCH=%s -PRELEASE=%s --stacktrace' %(ANDROID_TARGET_ARCH, ANDROID_RELEASE),
+ emitter = ensure_libs)
+jdk_env['BUILD_DIR'] = env.get('BUILD_DIR')
+cmdBuildNotificationConsumerApp=jdk_env.Gradle(target="app/apk",
+ source=["app/src/main/java/com/sec/noticonsumerexample/MainActivity.java",
+ "app/src/main/java/com/sec/noticonsumerexample/ConsumerSample.java"])
+
+Depends(cmdBuildNotificationConsumerApp, env.get('notificationAAR'))
-apply plugin: 'com.android.application'\r
-\r
-android {\r
- compileSdkVersion 23\r
- buildToolsVersion "23.0.1"\r
-\r
- defaultConfig {\r
- applicationId "sample.notification.service.iotivity.org.notificationconsumersample"\r
- minSdkVersion 21\r
- targetSdkVersion 23\r
- versionCode 1\r
- versionName "1.0"\r
- }\r
-}\r
-\r
-dependencies {\r
- compile fileTree(include: ['*.jar'], dir: 'libs')\r
- compile 'com.android.support:appcompat-v7:23.0.1'\r
- compile project(':iotivity-base-armeabi-release')\r
- compile project(':iotivity-armeabi-notification-service-release')\r
-}\r
+apply plugin: 'com.android.application'
+
+android {
+ compileSdkVersion 21
+ buildToolsVersion "20.0.0"
+
+ packagingOptions {
+ pickFirst 'lib/armeabi/libocstack-jni.so'
+ pickFirst 'lib/armeabi-v7a/libocstack-jni.so'
+ pickFirst 'lib/x86/libocstack-jni.so'
+ }
+
+ defaultConfig {
+ applicationId "sample.notification.service.iotivity.org.notificationconsumersample"
+ minSdkVersion 21
+ targetSdkVersion 21
+ versionCode 1
+ versionName "1.0"
+ }
+
+ lintOptions {
+ abortOnError false
+ }
+}
+
+dependencies {
+ compile fileTree(include: ['*.jar'], dir: 'libs')
+ compile ":iotivity-base-${TARGET_ARCH}-${RELEASE}@aar"
+ compile ":iotivity-${TARGET_ARCH}-notification-service-${RELEASE}@aar"
+}
import android.os.Bundle;\r
import android.os.Handler;\r
import android.os.Message;\r
-import android.support.v7.app.AppCompatActivity;\r
+import android.app.Activity;\r
import android.util.Log;\r
import android.view.View;\r
import android.widget.Button;\r
import org.iotivity.service.ns.common.TopicsList;\r
import org.iotivity.service.ns.common.Topic;\r
\r
-public class MainActivity extends AppCompatActivity\r
+public class MainActivity extends Activity\r
{\r
private final String TAG = "NS_MAIN_ACTIVITY";\r
\r
<resources>\r
\r
- <!-- Base application theme. -->\r
- <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">\r
- <!-- Customize your theme here. -->\r
- <item name="colorPrimary">@color/colorPrimary</item>\r
- <item name="colorPrimaryDark">@color/colorPrimaryDark</item>\r
- <item name="colorAccent">@color/colorAccent</item>\r
+ <!--\r
+ Base application theme, dependent on API level. This theme is replaced\r
+ by AppBaseTheme from res/values-vXX/styles.xml on newer devices.\r
+ -->\r
+ <style name="AppBaseTheme" parent="android:Theme.Light">\r
+ <!--\r
+ Theme customizations available in newer API levels can go in\r
+ res/values-vXX/styles.xml, while customizations related to\r
+ backward-compatibility can go here.\r
+ -->\r
</style>\r
\r
-</resources>\r
+ <!-- Application theme. -->\r
+ <style name="AppTheme" parent="AppBaseTheme">\r
+ <!-- All customizations that are NOT specific to a particular API-level can go here. -->\r
+ </style>\r
+\r
+</resources>
\ No newline at end of file
-// Top-level build file where you can add configuration options common to all sub-projects/modules.\r
-\r
-buildscript {\r
- repositories {\r
- jcenter()\r
- }\r
- dependencies {\r
- classpath 'com.android.tools.build:gradle:1.5.0'\r
-\r
- // NOTE: Do not place your application dependencies here; they belong\r
- // in the individual module build.gradle files\r
- }\r
-}\r
-\r
-allprojects {\r
- repositories {\r
- jcenter()\r
- }\r
-}\r
-\r
-task clean(type: Delete) {\r
- delete rootProject.buildDir\r
-}\r
+// Top-level build file where you can add configuration options common to all sub-projects/modules.
+
+buildscript {
+ repositories {
+ jcenter()
+ }
+ dependencies {
+ classpath 'com.android.tools.build:gradle:1.5.0'
+
+ // NOTE: Do not place your application dependencies here; they belong
+ // in the individual module build.gradle files
+ }
+}
+
+allprojects {
+ repositories {
+ jcenter()
+
+ flatDir {
+ dirs '../../../../android/notification-service/build/outputs/aar'
+ dirs '../../../../../../android/android_api/base/build/outputs/aar'
+ }
+ }
+}
+
+task clean(type: Delete) {
+ delete rootProject.buildDir
+}
--- /dev/null
+#//******************************************************************
+#//
+#// Copyright 2016 Samsung Electronics All Rights Reserved.
+#//
+#//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
+#//
+#// Licensed under the Apache License, Version 2.0 (the "License");
+#// you may not use this file except in compliance with the License.
+#// You may obtain a copy of the License at
+#//
+#// http://www.apache.org/licenses/LICENSE-2.0
+#//
+#// Unless required by applicable law or agreed to in writing, software
+#// distributed under the License is distributed on an "AS IS" BASIS,
+#// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#// See the License for the specific language governing permissions and
+#// limitations under the License.
+#//
+#//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
+
+import os
+import platform
+Import('env')
+
+android_home = env.get('ANDROID_HOME')
+
+ANDROID_TARGET_ARCH = env.get('TARGET_ARCH')
+if env.get('RELEASE'):
+ ANDROID_RELEASE="release"
+else:
+ ANDROID_RELEASE="debug"
+
+os.environ['ANDROID_HOME'] = env.get('ANDROID_HOME')
+os.environ['ANDROID_NDK_HOME'] = env.get('ANDROID_NDK')
+
+if not os.path.exists(android_home + '/platforms/android-21') or not os.path.exists(android_home + '/build-tools/20.0.0'):
+ print '''
+***************************************** Info ********************************
+* Either 'Android API 21' is not installed or 'Android SDK Build Tools *
+* 20.0.0' is not installed. The Android SDK Manager will now open. Please *
+* be sure to deselect all options, then select the following 2 packages: *
+* 1. Under "Tools" select "Android SDK Build-tools" Revision 20. *
+* 2. Under "Android 5.0.1 (API 21)" select "SDK Platform" *
+* 3. Continue by selecting "Install 2 Packages" *
+* *
+* NOTE: If you have an http proxy, please press ctrl+c now and edit/create *
+* the following file in your $HOME directory as follows: *
+* *
+* Edit/Create file: "$HOME/.android/androidtool.cfg" *
+* *
+* http.proxyPort=<YOUR_PORT_NUMBER> *
+* sdkman.monitor.density=108 *
+* http.proxyHost=<YOUR_HTTP_PROXY_ADDRESS> *
+* sdkman.show.update.only=true *
+* sdkman.ask.adb.restart=false *
+* sdkman.force.http=true *
+* sdkman.show.updateonly=true *
+* *
+*******************************************************************************
+
+...Opening Android SDK Manager now. Once you are finished, the build will continue.
+'''
+ os.system(android_home + '/tools/android')
+
+def ensure_libs(target, source, env):
+ return target, [source,
+ env.get('BUILD_DIR') + 'libnotification_provider_jni.so',
+ env.get('BUILD_DIR') + 'libnotification_provider_wrapper.so',
+ env.get('BUILD_DIR') + 'libnotification_provider.so',
+ env.get('BUILD_DIR') + 'libnotification_consumer_jni.so',
+ env.get('BUILD_DIR') + 'libnotification_consumer_wrapper.so',
+ env.get('BUILD_DIR') + 'libnotification_consumer.so']
+
+jdk_env = Environment(ENV=os.environ)
+jdk_env['BUILDERS']['Gradle'] = Builder(action = env.get('ANDROID_GRADLE') +
+ ' build -bservice/notification/examples/android/NotiProviderExample/build.gradle -PTARGET_ARCH=%s -PRELEASE=%s --stacktrace' %(ANDROID_TARGET_ARCH, ANDROID_RELEASE),
+ emitter = ensure_libs)
+jdk_env['BUILD_DIR'] = env.get('BUILD_DIR')
+cmdBuildNotificationProviderApp=jdk_env.Gradle(target="app/apk",
+ source=["app/src/main/java/com/sec/notiproviderexample/MainActivity.java",
+ "app/src/main/java/com/sec/notiproviderexample/NotiListener.java",
+ "app/src/main/java/com/sec/notiproviderexample/ProviderSample.java"])
+
+Depends(cmdBuildNotificationProviderApp, env.get('notificationAAR'))
-apply plugin: 'com.android.application'\r
-\r
-android {\r
- compileSdkVersion 23\r
- buildToolsVersion "23.0.1"\r
-\r
- defaultConfig {\r
- applicationId "sample.notification.service.iotivity.org.notificationsample"\r
- minSdkVersion 21\r
- targetSdkVersion 23\r
- versionCode 1\r
- versionName "1.0"\r
- }\r
-}\r
-\r
-dependencies {\r
- compile fileTree(include: ['*.jar'], dir: 'libs')\r
- compile 'com.android.support:appcompat-v7:23.0.1'\r
-}\r
+apply plugin: 'com.android.application'
+
+android {
+ compileSdkVersion 21
+ buildToolsVersion "20.0.0"
+
+ packagingOptions {
+ pickFirst 'lib/armeabi/libocstack-jni.so'
+ pickFirst 'lib/armeabi-v7a/libocstack-jni.so'
+ pickFirst 'lib/x86/libocstack-jni.so'
+ }
+
+ defaultConfig {
+ applicationId "sample.notification.service.iotivity.org.notificationsample"
+ minSdkVersion 21
+ targetSdkVersion 21
+ versionCode 1
+ versionName "1.0"
+ }
+
+ lintOptions {
+ abortOnError false
+ }
+}
+
+dependencies {
+ compile fileTree(include: ['*.jar'], dir: 'libs')
+ compile ":iotivity-base-${TARGET_ARCH}-${RELEASE}@aar"
+ compile ":iotivity-${TARGET_ARCH}-notification-service-${RELEASE}@aar"
+}
import android.os.Bundle;\r
import android.os.Handler;\r
import android.os.Message;\r
-import android.support.v7.app.AppCompatActivity;\r
import android.util.Log;\r
import android.view.View;\r
import android.widget.Button;\r
import android.widget.RadioButton;\r
import android.widget.TextView;\r
import android.widget.Toast;\r
+import android.app.Activity;\r
\r
import org.iotivity.service.ns.common.MediaContents;\r
\r
import java.text.DateFormat;\r
import java.util.Date;\r
\r
-public class MainActivity extends AppCompatActivity {\r
+public class MainActivity extends Activity {\r
\r
private final String TAG = "NS_MAIN_ACTIVITY";\r
private static final int CONSUMER_SUBSCRIBED = 1;\r
<resources>\r
\r
- <!-- Base application theme. -->\r
- <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">\r
- <!-- Customize your theme here. -->\r
- <item name="colorPrimary">@color/colorPrimary</item>\r
- <item name="colorPrimaryDark">@color/colorPrimaryDark</item>\r
- <item name="colorAccent">@color/colorAccent</item>\r
+ <!--\r
+ Base application theme, dependent on API level. This theme is replaced\r
+ by AppBaseTheme from res/values-vXX/styles.xml on newer devices.\r
+ -->\r
+ <style name="AppBaseTheme" parent="android:Theme.Light">\r
+ <!--\r
+ Theme customizations available in newer API levels can go in\r
+ res/values-vXX/styles.xml, while customizations related to\r
+ backward-compatibility can go here.\r
+ -->\r
</style>\r
\r
-</resources>\r
+ <!-- Application theme. -->\r
+ <style name="AppTheme" parent="AppBaseTheme">\r
+ <!-- All customizations that are NOT specific to a particular API-level can go here. -->\r
+ </style>\r
+\r
+</resources>
\ No newline at end of file
-// Top-level build file where you can add configuration options common to all sub-projects/modules.\r
-\r
-buildscript {\r
- repositories {\r
- jcenter()\r
- }\r
- dependencies {\r
- classpath 'com.android.tools.build:gradle:1.5.0'\r
-\r
- // NOTE: Do not place your application dependencies here; they belong\r
- // in the individual module build.gradle files\r
- }\r
-}\r
-\r
-allprojects {\r
- repositories {\r
- jcenter()\r
- }\r
-}\r
-\r
-task clean(type: Delete) {\r
- delete rootProject.buildDir\r
-}\r
+// Top-level build file where you can add configuration options common to all sub-projects/modules.
+
+buildscript {
+ repositories {
+ jcenter()
+ }
+ dependencies {
+ classpath 'com.android.tools.build:gradle:1.5.0'
+
+ // NOTE: Do not place your application dependencies here; they belong
+ // in the individual module build.gradle files
+ }
+}
+
+allprojects {
+ repositories {
+ jcenter()
+
+ flatDir {
+ dirs '../../../../android/notification-service/build/outputs/aar'
+ dirs '../../../../../../android/android_api/base/build/outputs/aar'
+ }
+ }
+}
+
+task clean(type: Delete) {
+ delete rootProject.buildDir
+}
--- /dev/null
+#//******************************************************************
+#//
+#// Copyright 2016 Samsung Electronics All Rights Reserved.
+#//
+#//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
+#//
+#// Licensed under the Apache License, Version 2.0 (the "License");
+#// you may not use this file except in compliance with the License.
+#// You may obtain a copy of the License at
+#//
+#// http://www.apache.org/licenses/LICENSE-2.0
+#//
+#// Unless required by applicable law or agreed to in writing, software
+#// distributed under the License is distributed on an "AS IS" BASIS,
+#// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#// See the License for the specific language governing permissions and
+#// limitations under the License.
+#//
+#//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
+
+SConscript('NotiProviderExample/SConscript')
+SConscript('NotiConsumerExample/SConscript')