+/**\r
+ * ***************************************************************\r
+ * <p/>\r
+ * Copyright 2015 Samsung Electronics All Rights Reserved.\r
+ * <p/>\r
+ * <p/>\r
+ * <p/>\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ * <p/>\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ * <p/>\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ * <p/>\r
+ * ****************************************************************\r
+ */\r
+\r
package org.iotivity.service.easysetup;\r
\r
import java.io.IOException;\r
import org.iotivity.service.easysetup.core.EnrolleeDevice;\r
import org.iotivity.service.easysetup.core.EnrolleeState;\r
import org.iotivity.service.easysetup.impl.EnrolleeDeviceFactory;\r
-import org.iotivity.service.easysetup.impl.EnrolleeDeviceWiFiOnboarding;\r
import org.iotivity.service.easysetup.impl.WiFiOnBoardingConfig;\r
import org.iotivity.service.easysetup.impl.WiFiProvConfig;\r
-import org.iotivity.service.easysetup.mediator.EnrolleeInfo;\r
import org.iotivity.service.easysetup.mediator.ProvisionEnrollee;\r
\r
import android.app.Activity;\r
import android.graphics.Bitmap;\r
import android.net.wifi.WifiConfiguration;\r
import android.os.Bundle;\r
-import android.view.Menu;\r
import android.view.View;\r
import android.view.View.OnClickListener;\r
import android.widget.Button;\r
\r
textView1 = (TextView) findViewById(R.id.textView1);\r
\r
- // Provisioning Process\r
+ // Provisioning Process - This instantiation will be removed in the next version\r
provisionEnrolleInstance = new ProvisionEnrollee(this);\r
-\r
/* Invocation of APIs using the Easy Setup SDK APIs */\r
\r
/* Create Easy Setup Service instance*/\r
- mEasySetupService = EasySetupService.getInstance(getApplicationContext(), new EasySetupStatus() {\r
+ mEasySetupService = EasySetupService.getInstance(getApplicationContext(),\r
+ new EasySetupStatus() {\r
\r
- @Override\r
- public void onFinished(EnrolleeDevice enrolledevice) {\r
- final String msg = enrolledevice.isSetupSuccessful() ? "Device configured successfully" : "Device configuration failed";\r
- runOnUiThread(new Runnable() {\r
@Override\r
- public void run() {\r
- Toast.makeText(getApplicationContext(), msg, Toast.LENGTH_SHORT).show();\r
+ public void onFinished(EnrolleeDevice enrolledevice) {\r
+ final String msg = enrolledevice.isSetupSuccessful() ?\r
+ "Device configured successfully" : "Device configuration failed";\r
+ runOnUiThread(new Runnable() {\r
+ @Override\r
+ public void run() {\r
+ Toast.makeText(getApplicationContext(),\r
+ msg, Toast.LENGTH_SHORT).show();\r
+ }\r
+ });\r
}\r
- });\r
- }\r
\r
- @Override\r
- public void onProgress(EnrolleeState state) {\r
- runOnUiThread(new Runnable() {\r
@Override\r
- public void run() {\r
- Toast.makeText(getApplicationContext(), "Device state changed", Toast.LENGTH_SHORT).show();\r
+ public void onProgress(EnrolleeState state) {\r
+ runOnUiThread(new Runnable() {\r
+ @Override\r
+ public void run() {\r
+ Toast.makeText(getApplicationContext(),\r
+ "Device state changed", Toast.LENGTH_SHORT).show();\r
+ }\r
+ });\r
}\r
- });\r
- }\r
\r
- });\r
+ });\r
\r
/* Create EnrolleeDevice Factory instance*/\r
mDeviceFactory = EnrolleeDeviceFactory.newInstance(getApplicationContext());\r
\r
/* Create a device using Factory instance*/\r
- mDevice = mDeviceFactory.newEnrolleeDevice(getOnBoardingWifiConfig(), getEnrollerWifiConfig());\r
+ mDevice = mDeviceFactory.newEnrolleeDevice(getOnBoardingWifiConfig(),\r
+ getEnrollerWifiConfig());\r
\r
addListenerForStartAP();\r
addListenerForStopAP();\r