Added missing license headers to Java files
[platform/upstream/iotivity.git] / service / easy-setup / sampleapp / android / EasySetup / app / src / main / java / org / iotivity / service / easysetup / MainActivity.java
old mode 100644 (file)
new mode 100755 (executable)
index 69b81e0..f0b90c1
@@ -1,3 +1,25 @@
+/**\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
@@ -7,10 +29,8 @@ import org.iotivity.service.easysetup.core.EasySetupStatus;
 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
@@ -18,7 +38,6 @@ import android.content.Intent;
 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
@@ -49,42 +68,46 @@ public class MainActivity extends Activity {
 \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