From: Madan Lanka Date: Thu, 17 Sep 2015 00:50:16 +0000 (-0400) Subject: Removed Eesysetup implementation for validation X-Git-Tag: 1.2.0+RC1~1086^2~21 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ef90213c82dd688628011498a222ef1d4d495ab5;p=platform%2Fupstream%2Fiotivity.git Removed Eesysetup implementation for validation Removed Easysetup implementation due to pending internal code validation step. The support will be added after validation is completed Change-Id: I8cc1499a1d033ed0eeb5cfff1ceb0c729e2968d4 Signed-off-by: Madan Lanka Reviewed-on: https://gerrit.iotivity.org/gerrit/2611 Tested-by: jenkins-iotivity Reviewed-by: Uze Choi Tested-by: Uze Choi --- diff --git a/service/SConscript b/service/SConscript index 6d62ac3..be349be 100644 --- a/service/SConscript +++ b/service/SConscript @@ -41,9 +41,6 @@ if target_os not in ['arduino','darwin']: # Build notification manager project SConscript('notification-manager/SConscript') -if target_os in ['arduino','android', 'linux']: - SConscript('easy-setup/SConscript') - # Build resource-encapsulation project if target_os not in ['tizen']: SConscript('resource-encapsulation/SConscript') diff --git a/service/easy-setup/Build_Instructions_Android_Arduino.txt b/service/easy-setup/Build_Instructions_Android_Arduino.txt deleted file mode 100755 index e320e1a..0000000 --- a/service/easy-setup/Build_Instructions_Android_Arduino.txt +++ /dev/null @@ -1,131 +0,0 @@ -=== Prerequisites === - -* 1. Scons - -Please refer to the following page to install scons: - http://www.scons.org/doc/production/HTML/scons-user.html#chap-build-install -(Note: on Windows, install Python 2.x before installing scons) - -* 2. IDE/SDK Pre-requites -To build for some OS (Android / Arduino / IOS ...), an IDE/SDK may be required, -please go to the relative page to download and install the required IDE/SDK. - -Note: Connectivity module building has been changed. We have to build connectivity - from the iotivity root folder. - -++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -Android Build: -++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -Steps to build and deploy Easysetup Mediator in Android platform -1) Compilation using Scons - 0) Prerequisite exports for Android - export ANDROID_HOME= - export ANDROID_NDK= - - a) In the IoTivity root source folder execute - scons TARGET_OS=android TARGET_ARCH=armeabi TARGET_TRANSPORT=IP RELEASE=0 - - b) If the project is setup correctly, you should see a BUILD SUCCESSFUL message on the terminal - You should see the .aar files generated inside of '/android/android_api/base/build/outputs/aar' directory. The .aar files contain jni directory and also a .jar file - - c) Now navigate to the Easysetup NDK folder - /service/easy-setup/sdk/mediator/android - - d) Execute NDK-Build with the following command to cross compiled Easysetup JNI .so files - ~/madan/android-ndk-r10d/ndk-build - - e) Step (d) will generate cross compiled Easysetup JNI .so files in the following folder - -2) Compilation using Android Studio - - 0) Prerequisite for running the Android application - Install Android Studio and use the Android SDK manager to update the Android API to 21 - - a) Import following projects to the Studio using the "File->New->Import Project" - - service\easy-setup\sdk\android\EasySetupCore - - service\easy-setup\sampleapp\android\EasySetup - - b) EasySetupCore is dependent on the .aar files generated in 1.b - 1) To add an .aar file to the 'EasySetupCore' project, - a.Right click on EasySetup->New->Module->Import .JAR or .AAR Package - b.Select the .aar file(iotivity-armeabi-base-*.aar) from the location in steps 1.b - c.Right click on EasySetup->Open Module Settings - d.Select each sample app module under 'Modules'->Dependencies->Add->Module Dependency - - c) Build EasySetupCore project using "Android Studio->Build->Make Module "easySetupCore" - If the project is setup correctly, you should see a BUILD SUCCESSFUL in the Android Studio Gradle Build terminal - You should see the .aar file generated inside of - 'iotivity\service\easy-setup\sdk\mediator\android\easySetupCore\build\outputs\aar' - - d) EasySetup application is also dependent on the .so files generated in 1.d step - 1) Drag and drop the following .so files in to the EasySetup\app\src\main\jniLibs\armeabi folder - - libeasysetup-jni.so [Easy Setup file] - - e) EasySetup is also dependent on the .aar files generated in 1.b and 2.c steps - 1) To add an .aar file to the 'EasySetup' project, - a.Right click on EasySetup->New->Module->Import .JAR or .AAR Package - b.Select the .aar file from the location in steps 1.b and 2.b above - c.Right click on EasySetup->Open Module Settings - d.Select each sample app module under 'Modules'->Dependencies->Add->Module Dependency - e.The .aar files (easySetupCore-*.aar & iotivity-armeabi-base-*.aar) selected in step 2.c.1.b above should be present. Select it. - - - e) Run "Easy Setup" as an Android application - -++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -Arduino Build: -++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -Steps to build and deploy Easysetup Mediator in Arduino platform -1) Compilation using Scons for Arduino Due - a) Set up Arduino first before building. Refer to "connectivity\build\arduino\Arduino_Setup_README.txt" file for help. - b) Go to "iotivity/" folder. - c) Prerequisite exports for Arduino - export ARDUINO_HOME= - d) Start Arduino IDE. Select ""Tools->Port->Programming port" - e) scons TARGET_OS=arduino BOARD=arduino_due_x_dbg TARGET_ARCH=arm SHIELD=WIFI - - With debug or logging - scons TARGET_OS=arduino BOARD=arduino_due_x_dbg TARGET_ARCH=arm SHIELD=WIFI RELEASE=0 - - With installation to Arduino - scons TARGET_OS=arduino BOARD=arduino_due_x_dbg TARGET_ARCH=arm SHIELD=WIFI RELEASE=0 UPLOAD=true - NOTE: BOARD=arduino_due_x_dbg|arduino_due_x. Default is arduino_due_x_dbg. - - Possible values for are: - -> IP : - $ scons TARGET_OS=arduino BOARD=arduino_due_x_dbg TARGET_ARCH=arm SHIELD=WIFI RELEASE=0 - -> BLE : - $ scons TARGET_OS=arduino BOARD=arduino_due_x_dbg TARGET_ARCH=arm SHIELD=WIFI RELEASE=0 - - Note :- Only single transport can be built at a time for Arduino - f) The above command will build sample. The "thinserver.hex" can be found at "out/arduino/arm/release/service/easy-setup/sampleapp/arduino/thinserver/" - g) After building sample, script will try to install on "/dev/ttyACM0" port in 'sudo' mode. - To skip installation, set command line argument 'UPLOAD=false' or without UPLOAD option - h) To set BLE Shield Name, include the option DEVICE_NAME during scons build. - -> $ scons TARGET_OS=arduino BOARD=arduino_due_x_dbg TARGET_ARCH=arm SHIELD=BLE RELEASE=0 DEVICE_NAME=OIC - - Specified Device name length MUST be less than 10 characters. RBL Library has this limitation. - By Default DEVICE_NAME=OIC-DEVICE, if device name option is not specified - - To change the port number, please modify "port" variable in __upload() function in: "/build/arduino/SConscript". - - -++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -Folder structure: -++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - -iotivity/ -└── service - └── easy-setup/ - │── SConscript - │── sdk - │ └── inc - │ └── src - │ └── android - │ └── arduino - │ └──wifi - │ └──inc - │ └──src - │── sampleapp - │ └──android - │ └──arduino - │ └──linux - └── Build_Instructions_Android_Arduino.txt - You are reading this. \ No newline at end of file diff --git a/service/easy-setup/SConscript b/service/easy-setup/SConscript deleted file mode 100644 index 36096c2..0000000 --- a/service/easy-setup/SConscript +++ /dev/null @@ -1,110 +0,0 @@ -#****************************************************************** -# -# Copyright 2014 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. -# -#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= - -## -# easy-setup project build script -## - -import os - -Import('env') - -env.AppendUnique(CPPDEFINES = ['EASY_SETUP_CA_INIT']) - -easy_setup_env = env.Clone() -target_os = env.get('TARGET_OS') - -lib_env = env.Clone() -if target_os == 'android': - SConscript(env.get('SRC_DIR') + '/service/third_party_libs.scons', exports = 'lib_env') - -###################################################################### -# Build flags -###################################################################### -easy_setup_env.AppendUnique(CPPPATH = ['sdk/inc', 'sdk/src', 'sdk/common']) - -if target_os not in ['windows', 'winrt']: - easy_setup_env.AppendUnique(CXXFLAGS = ['-std=c++0x', '-Wall']) - if target_os not in ['android', 'arduino']: - easy_setup_env.AppendUnique(CXXFLAGS = ['-pthread']) - -if target_os in ['android', 'linux']: - easy_setup_env.AppendUnique(LIBPATH = [env.get('BUILD_DIR')]) - easy_setup_env.AppendUnique(RPATH = [env.get('BUILD_DIR')]) - easy_setup_env.AppendUnique(CXXFLAGS = ['-frtti', '-fexceptions']) - if target_os not in ['linux', 'arduino']: - easy_setup_env.PrependUnique(LIBS = ['oc', 'octbstack', 'oc_logger', 'connectivity_abstraction', 'gnustl_shared']) - if not env.get('RELEASE'): - easy_setup_env.AppendUnique(LIBS = ['log']) - else: - easy_setup_env.PrependUnique(LIBS = ['oc', 'octbstack', 'oc_logger', 'pthread', 'connectivity_abstraction']) - -if target_os == 'arduino': - easy_setup_env.AppendUnique(CPPPATH = [ - '../../resource/oc_logger/include', - '../../resource/csdk/logger/include', - '../../resource/csdk/stack/include', - '../../extlibs/cjson', - 'sdk/enrollee/arduino/wifi', - 'sdk/enrollee/common/src', - 'sdk/enrollee/common/inc']) - -if target_os in ['android','linux']: - easy_setup_env.PrependUnique(CPPPATH = [ - env.get('SRC_DIR') + '/resource/c_common/oic_malloc/include', - env.get('SRC_DIR') + '/resource/csdk/connectivity/common/inc', - env.get('SRC_DIR') + '/resource/csdk/connectivity/api', - env.get('SRC_DIR') + '/resource/csdk/stack/include', - env.get('SRC_DIR') + '/resource/csdk/logger/include', - env.get('SRC_DIR') + '/resource/csdk/security/include', - env.get('SRC_DIR') + '/extlibs/cjson', - 'sdk/common', - 'sdk/mediator/inc']) - -###################################################################### -# Source files and Targets -###################################################################### - -if target_os == 'arduino': - es_sdk_static = easy_setup_env.StaticLibrary('ESSDKLibrary', - ['sdk/enrollee/common/src/easysetup.cpp', - 'sdk/enrollee/common/src/resourceHandler.cpp', - 'sdk/enrollee/arduino/wifi/networkHandler.cpp']) - easy_setup_env.InstallTarget(es_sdk_static, 'libESSDK') - - -if target_os == 'android': - es_sdk_shared = easy_setup_env.StaticLibrary('libESSDK', - ['sdk/mediator/src/easysetupmgr.cpp', - 'sdk/mediator/src/camutex_pthreads.c', - 'sdk/mediator/src/provisioninghandler.cpp']) - easy_setup_env.InstallTarget(es_sdk_shared, 'libESSDK') - -if target_os == 'linux': - es_sdk_shared = easy_setup_env.SharedLibrary('ESSDKLibrary', - ['sdk/mediator/src/easysetupmgr.cpp', - 'sdk/mediator/src/camutex_pthreads.c', - 'sdk/mediator/src/provisioninghandler.cpp']) - easy_setup_env.InstallTarget(es_sdk_shared, 'libESSDK') - -#Go to build sample apps -SConscript('sampleapp/SConscript') - - diff --git a/service/easy-setup/sampleapp/SConscript b/service/easy-setup/sampleapp/SConscript deleted file mode 100644 index 13c1c3a..0000000 --- a/service/easy-setup/sampleapp/SConscript +++ /dev/null @@ -1,46 +0,0 @@ -#****************************************************************** -# -# Copyright 2014 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. -# -#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= - -## -# sampleapp build script -## - -Import('env') - -# Add third party libraries -lib_env = env.Clone() - -sample_env = lib_env.Clone() -target_os = env.get('TARGET_OS') - -###################################################################### -# Build flags -###################################################################### - -###################################################################### -# Source files and Targets -###################################################################### -if target_os == 'arduino' : - # Build linux sample app - SConscript('arduino/thinserver/SConscript') - -if target_os == 'linux' : - # Build linux sample app - SConscript('linux/richclient/SConscript') diff --git a/service/easy-setup/sampleapp/android/.gitignore b/service/easy-setup/sampleapp/android/.gitignore deleted file mode 100644 index 6451fc5..0000000 --- a/service/easy-setup/sampleapp/android/.gitignore +++ /dev/null @@ -1,50 +0,0 @@ -#built application files -*.apk -*.ap_ - -# files for the dex VM -*.dex - -# Java class files -*.class - -# generated files -bin/ -gen/ - -# Local configuration file (sdk path, etc) -local.properties - -# Proguard folder generated by Eclipse -proguard/ - -# Windows thumbnail db -Thumbs.db - -# OSX files -.DS_Store - -# Eclipse project files -.classpath -.project - -#Android Studio & Gradle -.gradle -/local.properties -/.idea/workspace.xml -/.idea/libraries -.DS_Store -/build/* -/base/build/* -/base/obj/* -/base/libs/* -/sample/* - -#Some older projects -/*/out -/*/*/build -/*/*/production -*.iws -*.ipr -*~ -*.swp \ No newline at end of file diff --git a/service/easy-setup/sampleapp/android/EasySetup/EasySetupGradle.iml b/service/easy-setup/sampleapp/android/EasySetup/EasySetupGradle.iml deleted file mode 100644 index 4ac7e4f..0000000 --- a/service/easy-setup/sampleapp/android/EasySetup/EasySetupGradle.iml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/service/easy-setup/sampleapp/android/EasySetup/app/build.gradle b/service/easy-setup/sampleapp/android/EasySetup/app/build.gradle deleted file mode 100755 index c249744..0000000 --- a/service/easy-setup/sampleapp/android/EasySetup/app/build.gradle +++ /dev/null @@ -1,21 +0,0 @@ -apply plugin: 'com.android.application' -android { - compileSdkVersion 21 - buildToolsVersion '21.1.2' - - defaultConfig { - applicationId "org.iotivity.service.easysetup" - minSdkVersion 21 - targetSdkVersion 21 - } - - buildTypes { - release { - minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt' - } - } -} - -dependencies { -} \ No newline at end of file diff --git a/service/easy-setup/sampleapp/android/EasySetup/app/src/main/AndroidManifest.xml b/service/easy-setup/sampleapp/android/EasySetup/app/src/main/AndroidManifest.xml deleted file mode 100755 index b2a4e26..0000000 --- a/service/easy-setup/sampleapp/android/EasySetup/app/src/main/AndroidManifest.xml +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/service/easy-setup/sampleapp/android/EasySetup/app/src/main/java/org/iotivity/service/easysetup/MainActivity.java b/service/easy-setup/sampleapp/android/EasySetup/app/src/main/java/org/iotivity/service/easysetup/MainActivity.java deleted file mode 100755 index bb3f15d..0000000 --- a/service/easy-setup/sampleapp/android/EasySetup/app/src/main/java/org/iotivity/service/easysetup/MainActivity.java +++ /dev/null @@ -1,293 +0,0 @@ -/** - * *************************************************************** - *

- * Copyright 2015 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. - *

- * **************************************************************** - */ - -package org.iotivity.service.easysetup; - -import java.io.IOException; - -import org.iotivity.service.easysetup.core.EasySetupService; -import org.iotivity.service.easysetup.core.EasySetupStatus; -import org.iotivity.service.easysetup.core.EnrolleeDevice; -import org.iotivity.service.easysetup.core.EnrolleeState; -import org.iotivity.service.easysetup.core.IpOnBoardingConnection; -import org.iotivity.service.easysetup.impl.EnrolleeDeviceFactory; -import org.iotivity.service.easysetup.impl.WiFiOnBoardingConfig; -import org.iotivity.service.easysetup.impl.WiFiProvConfig; - -import android.app.Activity; -import android.content.Intent; -import android.graphics.Bitmap; -import android.net.wifi.WifiConfiguration; -import android.os.Bundle; -import android.os.Handler; -import android.os.Message; -import android.util.Log; -import android.view.View; -import android.view.View.OnClickListener; -import android.widget.Button; -import android.widget.EditText; -import android.widget.ImageView; -import android.widget.ProgressBar; -import android.widget.TextView; -import android.widget.Toast; - -public class MainActivity extends Activity { - - - /*Status to update the UI */ - public static final int SUCCESS = 0; - public static final int FAILED = 1; - public static final int STATE_CHANGED = 2; - - static final int REQUEST_IMAGE_CAPTURE = 1; - ImageView imageView; - - EditText mSsidText; - EditText mPassText; - - EditText mEnrolleeSsidText; - EditText mmEnrolleePasswordPassText; - - - TextView mDeviceIpTextView; - TextView mDeviceMacTextView; - - - TextView mResultTextView; - ProgressBar mProgressbar; - Button mStartButton; - Button mStopButton; - Handler mHandler = new ThreadHandler(); - - /** - * Objects to be instantiated by the programmer - */ - WiFiProvConfig mWiFiProvConfig; - WiFiOnBoardingConfig mWiFiOnBoardingConfig; - EasySetupService mEasySetupService; - EnrolleeDeviceFactory mDeviceFactory; - EnrolleeDevice mDevice; - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.activity_main); - - /* Initialize widgets to get user input for target network's SSID & password*/ - mSsidText = (EditText) findViewById(R.id.ssid); - mPassText = (EditText) findViewById(R.id.password); - mEnrolleeSsidText = (EditText) findViewById(R.id.enrolleeSsid); - mmEnrolleePasswordPassText = (EditText) findViewById(R.id.enrolleePass); - mDeviceIpTextView = (TextView) findViewById(R.id.ipAddr); - mDeviceMacTextView = (TextView) findViewById(R.id.hardAddr); - - mResultTextView = (TextView) findViewById(R.id.status); - mProgressbar = (ProgressBar) findViewById(R.id.progressBar); - - - - - /* Create Easy Setup Service instance*/ - mEasySetupService = EasySetupService.getInstance(getApplicationContext(), - new EasySetupStatus() { - - @Override - public void onFinished(final EnrolleeDevice enrolledevice) { - Log.i("MainActivity", "onFinished() is received " + enrolledevice - .isSetupSuccessful()); - if (enrolledevice.isSetupSuccessful()) { - mHandler.sendEmptyMessage(SUCCESS); - } else { - mHandler.sendEmptyMessage(FAILED); - } - } - - @Override - public void onProgress(EnrolleeState state) { - Log.i("MainActivity", "onProgress() is received "); - mHandler.sendEmptyMessage(STATE_CHANGED); - } - - }); - - /* Create EnrolleeDevice Factory instance*/ - mDeviceFactory = EnrolleeDeviceFactory.newInstance(getApplicationContext()); - - /* Create a device using Factory instance*/ - mDevice = mDeviceFactory.newEnrolleeDevice(getOnBoardingWifiConfig(), - getEnrollerWifiConfig()); - - addListenerForStartAP(); - addListenerForStopAP(); - } - - public WiFiProvConfig getEnrollerWifiConfig() { - /* Provide the credentials for the Mediator Soft AP to be connected by Enrollee*/ - mWiFiProvConfig = new WiFiProvConfig("hub2.4G", "11112222"); - mEnrolleeSsidText.setText("hub2.4G"); - mmEnrolleePasswordPassText.setText("11112222"); - - return mWiFiProvConfig; - } - - public WiFiOnBoardingConfig getOnBoardingWifiConfig() { - mWiFiOnBoardingConfig = new WiFiOnBoardingConfig(); - - /* Provide the target credentials to be provisioned to the Enrollee by Mediator*/ - mWiFiOnBoardingConfig.setSSId("EasySetup123"); - mWiFiOnBoardingConfig.setSharedKey("EasySetup123"); - mWiFiOnBoardingConfig.setAuthAlgo(WifiConfiguration.AuthAlgorithm.OPEN); - mWiFiOnBoardingConfig.setKms(WifiConfiguration.KeyMgmt.WPA_PSK); - - // Updating the UI with default credentials - mSsidText.setText("EasySetup123"); - mPassText.setText("EasySetup123"); - - return mWiFiOnBoardingConfig; - } - - - public void onDestroy() { - super.onDestroy(); - /*Reset the Easy setup process*/ - if(mEasySetupService != null) - { - mEasySetupService.finish(); - } - } - - public void addListenerForStartAP() { - mStartButton = (Button) findViewById(R.id.startSetup); - - mStartButton.setOnClickListener(new OnClickListener() { - @Override - public void onClick(View arg0) { - try { - - mProgressbar.setVisibility(View.VISIBLE); - mProgressbar.setIndeterminate(true); - mStartButton.setEnabled(false); - mResultTextView.setText(R.string.running); - - //Reset Device information - mDeviceIpTextView.setText(R.string.not_available); - mDeviceMacTextView.setText(R.string.not_available); - - - String ssid = mSsidText.getText().toString(); - String password = mPassText.getText().toString(); - - String enrolleeSsid = mEnrolleeSsidText.getText().toString(); - String enrolleePassword = mmEnrolleePasswordPassText.getText().toString(); - - mWiFiProvConfig = new WiFiProvConfig(enrolleeSsid, enrolleePassword); - - mWiFiOnBoardingConfig.setSSId(ssid); - mWiFiOnBoardingConfig.setSharedKey(password); - - - mEasySetupService.startSetup(mDevice); - - mStopButton.setEnabled(true); - - - } catch (IOException e) { - e.printStackTrace(); - } - - } - }); - } - - public void addListenerForStopAP() { - mStopButton = (Button) findViewById(R.id.stopSetup); - - mStopButton.setOnClickListener(new OnClickListener() { - @Override - public void onClick(View arg0) { - mStartButton.setEnabled(true); - mStopButton.setEnabled(false); - mResultTextView.setText(R.string.stopped); - mProgressbar.setIndeterminate(false); - mProgressbar.setVisibility(View.INVISIBLE); - mEasySetupService.stopSetup(mDevice); - } - }); - } - - @Override - protected void onActivityResult(int requestCode, int resultCode, Intent data) { - if (requestCode == REQUEST_IMAGE_CAPTURE && resultCode == RESULT_OK) { - Bundle extras = data.getExtras(); - Bitmap imageBitmap = (Bitmap) extras.get("data"); - imageView.setImageBitmap(imageBitmap); - } - } - - class ThreadHandler extends Handler { - @Override - public void handleMessage(Message msg) { - - switch (msg.what) { - case SUCCESS: { - - mProgressbar.setIndeterminate(false); - mStopButton.setEnabled(false); - mStartButton.setEnabled(true); - mProgressbar.setVisibility(View.INVISIBLE); - String resultMsg = "Device configured successfully"; - mResultTextView.setText(R.string.success); - - /* Update device information on the Ui */ - IpOnBoardingConnection connection = (IpOnBoardingConnection) mDevice - .getConnection(); - mDeviceIpTextView.setText(connection.getIp()); - mDeviceMacTextView.setText(connection.getHardwareAddress()); - - Toast.makeText(getApplicationContext(), resultMsg, Toast.LENGTH_SHORT).show(); - break; - } - case FAILED: { - - mProgressbar.setIndeterminate(false); - mStopButton.setEnabled(false); - mStartButton.setEnabled(true); - mProgressbar.setVisibility(View.INVISIBLE); - String resultMsg = "Device configuration failed"; - mResultTextView.setText(R.string.failed); - Toast.makeText(getApplicationContext(), resultMsg, Toast.LENGTH_SHORT).show(); - break; - } - - case STATE_CHANGED: { - String resultMsg = "Device state changed"; - Toast.makeText(getApplicationContext(), resultMsg, Toast.LENGTH_SHORT).show(); - break; - } - - } - - - } - } - -} diff --git a/service/easy-setup/sampleapp/android/EasySetup/app/src/main/res/drawable-hdpi/background.png b/service/easy-setup/sampleapp/android/EasySetup/app/src/main/res/drawable-hdpi/background.png deleted file mode 100644 index 561cce8..0000000 Binary files a/service/easy-setup/sampleapp/android/EasySetup/app/src/main/res/drawable-hdpi/background.png and /dev/null differ diff --git a/service/easy-setup/sampleapp/android/EasySetup/app/src/main/res/drawable-hdpi/cancel.png b/service/easy-setup/sampleapp/android/EasySetup/app/src/main/res/drawable-hdpi/cancel.png deleted file mode 100644 index da342e5..0000000 Binary files a/service/easy-setup/sampleapp/android/EasySetup/app/src/main/res/drawable-hdpi/cancel.png and /dev/null differ diff --git a/service/easy-setup/sampleapp/android/EasySetup/app/src/main/res/drawable-hdpi/ic_launcher.png b/service/easy-setup/sampleapp/android/EasySetup/app/src/main/res/drawable-hdpi/ic_launcher.png deleted file mode 100644 index 288b665..0000000 Binary files a/service/easy-setup/sampleapp/android/EasySetup/app/src/main/res/drawable-hdpi/ic_launcher.png and /dev/null differ diff --git a/service/easy-setup/sampleapp/android/EasySetup/app/src/main/res/drawable-hdpi/icon.png b/service/easy-setup/sampleapp/android/EasySetup/app/src/main/res/drawable-hdpi/icon.png deleted file mode 100644 index 24a8af2..0000000 Binary files a/service/easy-setup/sampleapp/android/EasySetup/app/src/main/res/drawable-hdpi/icon.png and /dev/null differ diff --git a/service/easy-setup/sampleapp/android/EasySetup/app/src/main/res/layout/activity_main.xml b/service/easy-setup/sampleapp/android/EasySetup/app/src/main/res/layout/activity_main.xml deleted file mode 100755 index 4c2e087..0000000 --- a/service/easy-setup/sampleapp/android/EasySetup/app/src/main/res/layout/activity_main.xml +++ /dev/null @@ -1,224 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -