diff --git a/README.md b/README.md
new file mode 100644
index 0000000..79f6557
--- /dev/null
+++ b/README.md
@@ -0,0 +1,29 @@
+# Automata
+“Automata (IIITA - IoT) , A Smart Campus Initiative To Save Electricity”
+## User Interface
+
+
+
+
+
+### Android app is available on Google Play:
+
+[](https://play.google.com/store/apps/details?id=anonymous.automata)
+
+## About
+
+“_Automata (IIITA - IoT) , A Smart Campus Initiative To Save Electricity_” is an IoT solution to save electricity in our campus buildings . We aim to provide an easy to use interface to control the lights and fans in our campus . We shall have three major components in our project namely **The Server** , **Android Mobile Application** and **Hardware** . There are two modes in which our IoT model will operate :
+
+* **Automatic Mode :** The IoT will work purely based on the percept sequence it receives from its sensors .
+
+* **Manual Control Mode :** The operator will have to control the lights and fans manually from the app’s control panel .
+
+We have used ESP8266 and raspberry pi to build a complete sensor network. The raspberry pi runs an API server which connects it to our android mobile application.The android mobile application presents user with a user friendly UI and provides full control over their appliances . The user can view the current state of the room . In Our mobile application we have two major sections namely:
+
+* **Control Center**
+
+In this section of the app we will provided the manual control to the operator to turn on / off the lights and fans .
+
+* **Monitor**
+
+In this section of the app we will display the data collected from the sensors in readable format to our operator / user .
diff --git a/UI_art/0.png b/UI_art/0.png
new file mode 100644
index 0000000..d0ccf6b
Binary files /dev/null and b/UI_art/0.png differ
diff --git a/UI_art/1.png b/UI_art/1.png
new file mode 100644
index 0000000..b65166b
Binary files /dev/null and b/UI_art/1.png differ
diff --git a/UI_art/2.png b/UI_art/2.png
new file mode 100644
index 0000000..c6d4470
Binary files /dev/null and b/UI_art/2.png differ
diff --git a/UI_art/3.png b/UI_art/3.png
new file mode 100644
index 0000000..bd1d391
Binary files /dev/null and b/UI_art/3.png differ
diff --git a/app/build.gradle b/app/build.gradle
index 1c16360..8eb1ab2 100755
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -7,8 +7,8 @@ android {
applicationId "anonymous.automata"
minSdkVersion 15
targetSdkVersion 25
- versionCode 1
- versionName "1.0"
+ versionCode 3
+ versionName "1.6"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
diff --git a/app/src/main/java/anonymous/automata/Automata.java b/app/src/main/java/anonymous/automata/Automata.java
index 16f1ef7..e22a397 100644
--- a/app/src/main/java/anonymous/automata/Automata.java
+++ b/app/src/main/java/anonymous/automata/Automata.java
@@ -2,6 +2,8 @@
import android.app.Application;
import android.content.SharedPreferences;
+import android.webkit.URLUtil;
+import android.widget.Toast;
import com.google.firebase.messaging.FirebaseMessaging;
import com.loopj.android.http.AsyncHttpClient;
@@ -43,12 +45,13 @@ public void onCreate() {
String value_ip = settings.getString("server_ip", "");
//Set Default Settings Values
- if (value_mode == null) {
+ if (!(value_mode.equals("0")|value_mode.equals("1"))) {
SharedPreferences.Editor editor = settings.edit();
editor.putString("auto_mode", "0");
editor.commit();
}
- if ( value_ip == null ) {
+
+ if ( !(URLUtil.isValidUrl(value_ip) & (value_ip.length()>=10 )) ) {
SharedPreferences.Editor editor = settings.edit();
editor.putString("server_ip", "http://192.168.1.2");
value_ip = "http://192.168.1.2";