diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..39fb081
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,9 @@
+*.iml
+.gradle
+/local.properties
+/.idea/workspace.xml
+/.idea/libraries
+.DS_Store
+/build
+/captures
+.externalNativeBuild
diff --git a/.idea/compiler.xml b/.idea/compiler.xml
new file mode 100644
index 0000000..96cc43e
--- /dev/null
+++ b/.idea/compiler.xml
@@ -0,0 +1,22 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/copyright/profiles_settings.xml b/.idea/copyright/profiles_settings.xml
new file mode 100644
index 0000000..e7bedf3
--- /dev/null
+++ b/.idea/copyright/profiles_settings.xml
@@ -0,0 +1,3 @@
+
+
+
\ No newline at end of file
diff --git a/.idea/gradle.xml b/.idea/gradle.xml
new file mode 100644
index 0000000..7ac24c7
--- /dev/null
+++ b/.idea/gradle.xml
@@ -0,0 +1,18 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
new file mode 100644
index 0000000..fe21240
--- /dev/null
+++ b/.idea/misc.xml
@@ -0,0 +1,52 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 1.8
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/modules.xml b/.idea/modules.xml
new file mode 100644
index 0000000..1f4de78
--- /dev/null
+++ b/.idea/modules.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/runConfigurations.xml b/.idea/runConfigurations.xml
new file mode 100644
index 0000000..7f68460
--- /dev/null
+++ b/.idea/runConfigurations.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/.gitignore b/app/.gitignore
new file mode 100644
index 0000000..796b96d
--- /dev/null
+++ b/app/.gitignore
@@ -0,0 +1 @@
+/build
diff --git a/app/build.gradle b/app/build.gradle
new file mode 100644
index 0000000..6892d2d
--- /dev/null
+++ b/app/build.gradle
@@ -0,0 +1,36 @@
+apply plugin: 'com.android.application'
+
+android {
+ compileSdkVersion 26
+ buildToolsVersion '26.0.2'
+ defaultConfig {
+ applicationId "com.example.wot.parentapp"
+ minSdkVersion 19
+ targetSdkVersion 26
+ versionCode 1
+ versionName "1.0"
+ testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
+ }
+ buildTypes {
+ release {
+ minifyEnabled false
+ proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
+ }
+ }
+}
+
+dependencies {
+ compile fileTree(dir: 'libs', include: ['*.jar'])
+ androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
+ exclude group: 'com.android.support', module: 'support-annotations'
+ })
+ compile 'com.android.support:appcompat-v7:26.+'
+ compile 'com.android.support:support-v4:26.+'
+ compile 'com.android.support:design:26.+'
+ compile 'com.android.support:cardview-v7:26.+'
+ compile 'cn.fanrunqi:waveprogress:1.0.1'
+ compile 'com.github.bumptech.glide:glide:3.7.0'
+ compile 'com.android.support.constraint:constraint-layout:1.0.2'
+ compile 'com.google.android.gms:play-services-maps:11.0.4'
+ testCompile 'junit:junit:4.12'
+}
diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro
new file mode 100644
index 0000000..993d41d
--- /dev/null
+++ b/app/proguard-rules.pro
@@ -0,0 +1,25 @@
+# Add project specific ProGuard rules here.
+# By default, the flags in this file are appended to flags specified
+# in C:\Users\WOT\AppData\Local\Android\Sdk/tools/proguard/proguard-android.txt
+# You can edit the include path and order by changing the proguardFiles
+# directive in build.gradle.
+#
+# For more details, see
+# http://developer.android.com/guide/developing/tools/proguard.html
+
+# Add any project specific keep options here:
+
+# If your project uses WebView with JS, uncomment the following
+# and specify the fully qualified class name to the JavaScript interface
+# class:
+#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
+# public *;
+#}
+
+# Uncomment this to preserve the line number information for
+# debugging stack traces.
+#-keepattributes SourceFile,LineNumberTable
+
+# If you keep the line number information, uncomment this to
+# hide the original source file name.
+#-renamesourcefileattribute SourceFile
diff --git a/app/src/androidTest/java/com/example/wot/parentapp/ExampleInstrumentedTest.java b/app/src/androidTest/java/com/example/wot/parentapp/ExampleInstrumentedTest.java
new file mode 100644
index 0000000..7ffd6eb
--- /dev/null
+++ b/app/src/androidTest/java/com/example/wot/parentapp/ExampleInstrumentedTest.java
@@ -0,0 +1,26 @@
+package com.example.wot.parentapp;
+
+import android.content.Context;
+import android.support.test.InstrumentationRegistry;
+import android.support.test.runner.AndroidJUnit4;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import static org.junit.Assert.*;
+
+/**
+ * Instrumentation test, which will execute on an Android device.
+ *
+ * @see Testing documentation
+ */
+@RunWith(AndroidJUnit4.class)
+public class ExampleInstrumentedTest {
+ @Test
+ public void useAppContext() throws Exception {
+ // Context of the app under test.
+ Context appContext = InstrumentationRegistry.getTargetContext();
+
+ assertEquals("com.example.wot.parentapp", appContext.getPackageName());
+ }
+}
diff --git a/app/src/debug/res/values/google_maps_api.xml b/app/src/debug/res/values/google_maps_api.xml
new file mode 100644
index 0000000..10233eb
--- /dev/null
+++ b/app/src/debug/res/values/google_maps_api.xml
@@ -0,0 +1,26 @@
+
+
+
+ AIzaSyAv445ajywBSmqyhJZRZcTJ4vHrpwRwvJE
+
+
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
new file mode 100644
index 0000000..711183c
--- /dev/null
+++ b/app/src/main/AndroidManifest.xml
@@ -0,0 +1,54 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/ic_launcher-web.png b/app/src/main/ic_launcher-web.png
new file mode 100644
index 0000000..14a7acb
Binary files /dev/null and b/app/src/main/ic_launcher-web.png differ
diff --git a/app/src/main/java/com/example/wot/parentapp/BatteryActivity.java b/app/src/main/java/com/example/wot/parentapp/BatteryActivity.java
new file mode 100644
index 0000000..15cd37e
--- /dev/null
+++ b/app/src/main/java/com/example/wot/parentapp/BatteryActivity.java
@@ -0,0 +1,152 @@
+package com.example.wot.parentapp;
+
+import android.app.ProgressDialog;
+import android.content.Intent;
+import android.content.SharedPreferences;
+import android.net.Uri;
+import android.os.AsyncTask;
+import android.support.v7.app.AppCompatActivity;
+import android.os.Bundle;
+import android.util.Log;
+import android.widget.Toast;
+
+import java.io.BufferedReader;
+import java.io.BufferedWriter;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.OutputStream;
+import java.io.OutputStreamWriter;
+import java.net.HttpURLConnection;
+import java.net.MalformedURLException;
+import java.net.URL;
+
+import cn.fanrunqi.waveprogress.WaveProgressView;
+
+import static java.net.HttpURLConnection.HTTP_OK;
+
+public class BatteryActivity extends AppCompatActivity {
+
+ WaveProgressView waveProgressView;
+ SharedPreferences sharedPreferences;
+ SharedPreferences.Editor editor;
+ String cid;
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_battery);
+
+ waveProgressView = (WaveProgressView)findViewById(R.id.waveProgressbar);
+ sharedPreferences = getSharedPreferences("PARENT",MODE_PRIVATE);
+ cid= sharedPreferences.getString("CHILD","no child");
+
+ new BatteryTask().execute(cid);
+
+
+ }
+
+ private class BatteryTask extends AsyncTask
+ {
+ ProgressDialog pd = new ProgressDialog(BatteryActivity.this);
+ HttpURLConnection connection;
+ URL url;
+
+ @Override
+ protected void onPreExecute() {
+ super.onPreExecute();
+ pd.setMessage("Loading...");
+ pd.setCancelable(false);
+ pd.show();
+
+ }
+
+ @Override
+ protected String doInBackground(String... strings) {
+
+ try {
+
+ url=new URL("https://app-1503993646.000webhostapp.com/parentchild/getbattery.php");
+
+ } catch (MalformedURLException e1) {
+ e1.printStackTrace();
+ }
+ try {
+ connection=(HttpURLConnection)url.openConnection();
+ connection.setRequestMethod("POST");
+ connection.setConnectTimeout(10000);
+ connection.setReadTimeout(15000);
+ connection.setDoInput(true);
+ connection.setDoOutput(true);
+
+ Uri.Builder builder =new Uri.Builder();
+ builder.appendQueryParameter("cid",strings[0]);
+
+
+
+ String query = builder.build().getEncodedQuery();
+
+ OutputStream os=connection.getOutputStream();
+ BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(os,"UTF-8"));
+ writer.write(query);
+ writer.flush();
+ writer.close();
+ os.close();
+ connection.connect();
+
+ int rc = connection.getResponseCode();
+ if(rc == HTTP_OK)
+ {
+ InputStream inputStream = connection.getInputStream();
+ BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream));
+ StringBuilder sb=new StringBuilder();
+ String line;
+ while ((line=reader.readLine())!=null)
+ {
+ sb.append(line);
+ }
+ return sb.toString();
+ }
+ else{
+ Log.i("Error","Unsuccessfulcode"+rc);
+ return "unsuccessfull";
+ }
+
+
+ } catch (IOException e1) {
+ e1.printStackTrace();
+ return "Exception";
+ }
+
+
+ }
+
+ @Override
+ protected void onPostExecute(String s) {
+ super.onPostExecute(s);
+ pd.dismiss();
+ Log.i("LoginResult",s);
+ if(s.equals("0 results"))
+ {
+ // Toast.makeText(LoginActivity.this, "Invalid username or password", Toast.LENGTH_SHORT).show();
+ }
+ else if (s.equalsIgnoreCase("exception") || s.equalsIgnoreCase("unsuccessful")) {
+
+ Toast.makeText(BatteryActivity.this, "OOPs! Something went wrong. Connection Problem.", Toast.LENGTH_LONG).show();
+ finish();
+ }
+
+ else {
+ int percentage = Integer.parseInt(s);
+ waveProgressView.setCurrent(percentage,s+" %"); // 77, "788M/1024M"
+ waveProgressView.setMaxProgress(100);
+ waveProgressView.setText("#3949ab",100);//"#FFFF00", 41
+ waveProgressView.setWaveColor("#5b9ef4"); //"#5b9ef4"
+
+ waveProgressView.setWave(Float.parseFloat("30"),Float.parseFloat("200"));
+ waveProgressView.setmWaveSpeed(50);//The larger the value, the slower the vibration
+ // startActivity(new Intent(LoginActivity.this,SelectChildActivity.class));
+ }
+
+ }
+ }
+}
diff --git a/app/src/main/java/com/example/wot/parentapp/BlockSitesActivity.java b/app/src/main/java/com/example/wot/parentapp/BlockSitesActivity.java
new file mode 100644
index 0000000..4deba9c
--- /dev/null
+++ b/app/src/main/java/com/example/wot/parentapp/BlockSitesActivity.java
@@ -0,0 +1,288 @@
+package com.example.wot.parentapp;
+
+import android.app.ProgressDialog;
+import android.content.Intent;
+import android.content.SharedPreferences;
+import android.net.Uri;
+import android.os.AsyncTask;
+import android.support.v7.app.AppCompatActivity;
+import android.os.Bundle;
+import android.support.v7.widget.Toolbar;
+import android.util.Log;
+import android.view.View;
+import android.widget.AdapterView;
+import android.widget.Button;
+import android.widget.EditText;
+import android.widget.ListView;
+import android.widget.TextView;
+import android.widget.Toast;
+
+import org.json.JSONArray;
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.io.BufferedReader;
+import java.io.BufferedWriter;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.OutputStream;
+import java.io.OutputStreamWriter;
+import java.net.HttpURLConnection;
+import java.net.MalformedURLException;
+import java.net.URL;
+
+import static java.net.HttpURLConnection.HTTP_OK;
+
+public class BlockSitesActivity extends AppCompatActivity {
+
+ ListView listView;
+ Button button;
+ EditText editText;
+ Toolbar toolbar;
+ SharedPreferences sharedPreferences;
+ String cid,text;
+ BlockSitesAdapter blockSitesAdapter;
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_block_sites);
+
+ button = (Button)findViewById(R.id.blocksitebtn);
+ editText = (EditText)findViewById(R.id.blocksiteet);
+ listView = (ListView)findViewById(R.id.blocksitelist);
+ toolbar = (Toolbar)findViewById(R.id.toolbar);
+
+ setSupportActionBar(toolbar);
+ sharedPreferences = getSharedPreferences("PARENT",MODE_PRIVATE);
+ cid= sharedPreferences.getString("CHILD","no child");
+ new SitesTask().execute(cid);
+ button.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ text = editText.getText().toString();
+ new AddSitesTask().execute(cid,text);
+
+ }
+ });
+
+ }
+
+ private class SitesTask extends AsyncTask
+ {
+ ProgressDialog pd = new ProgressDialog(BlockSitesActivity.this);
+ HttpURLConnection connection;
+ URL url;
+
+ @Override
+ protected void onPreExecute() {
+ super.onPreExecute();
+ pd.setMessage("Loading...");
+ pd.setCancelable(false);
+ pd.show();
+
+ }
+
+ @Override
+ protected String doInBackground(String... strings) {
+
+ try {
+
+ url=new URL("https://app-1503993646.000webhostapp.com/parentchild/retrievesites.php");
+
+ } catch (MalformedURLException e1) {
+ e1.printStackTrace();
+ }
+ try {
+ connection=(HttpURLConnection)url.openConnection();
+ connection.setRequestMethod("POST");
+ connection.setConnectTimeout(10000);
+ connection.setReadTimeout(15000);
+ connection.setDoInput(true);
+ connection.setDoOutput(true);
+
+ Uri.Builder builder =new Uri.Builder();
+ builder.appendQueryParameter("cid",strings[0]);
+
+
+
+ String query = builder.build().getEncodedQuery();
+
+ OutputStream os=connection.getOutputStream();
+ BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(os,"UTF-8"));
+ writer.write(query);
+ writer.flush();
+ writer.close();
+ os.close();
+ connection.connect();
+
+ int rc = connection.getResponseCode();
+ if(rc == HTTP_OK)
+ {
+ InputStream inputStream = connection.getInputStream();
+ BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream));
+ StringBuilder sb=new StringBuilder();
+ String line;
+ while ((line=reader.readLine())!=null)
+ {
+ sb.append(line);
+ }
+ return sb.toString();
+ }
+ else{
+ Log.i("Error","Unsuccessfulcode"+rc);
+ return "unsuccessfull";
+ }
+
+
+ } catch (IOException e1) {
+ e1.printStackTrace();
+ return "Exception";
+ }
+
+
+ }
+
+ @Override
+ protected void onPostExecute(String s) {
+ super.onPostExecute(s);
+ pd.dismiss();
+ Log.i("LoginResult",s);
+ if(s.equals("0 results"))
+ {
+ Toast.makeText(BlockSitesActivity.this, "No blocked sites", Toast.LENGTH_SHORT).show();
+ }
+ else if (s.equalsIgnoreCase("exception") || s.equalsIgnoreCase("unsuccessful")) {
+
+ Toast.makeText(BlockSitesActivity.this, "OOPs! Something went wrong. Connection Problem.", Toast.LENGTH_LONG).show();
+
+ }
+
+ else {
+ String[] sites,ids;
+ try {
+ JSONObject jsonObject = new JSONObject(s);
+ JSONArray jsonArray = jsonObject.optJSONArray("sites");
+ sites = new String[jsonArray.length()];
+ ids = new String[jsonArray.length()];
+ for(int i=0;i
+ {
+ ProgressDialog pd = new ProgressDialog(BlockSitesActivity.this);
+ HttpURLConnection connection;
+ URL url;
+
+ @Override
+ protected void onPreExecute() {
+ super.onPreExecute();
+ pd.setMessage("Loading...");
+ pd.setCancelable(false);
+ pd.show();
+
+ }
+
+ @Override
+ protected String doInBackground(String... strings) {
+
+ try {
+
+ url=new URL("https://app-1503993646.000webhostapp.com/parentchild/sendsites.php");
+
+ } catch (MalformedURLException e1) {
+ e1.printStackTrace();
+ }
+ try {
+ connection=(HttpURLConnection)url.openConnection();
+ connection.setRequestMethod("POST");
+ connection.setConnectTimeout(10000);
+ connection.setReadTimeout(15000);
+ connection.setDoInput(true);
+ connection.setDoOutput(true);
+
+ Uri.Builder builder =new Uri.Builder();
+ builder.appendQueryParameter("cid",strings[0]);
+ builder.appendQueryParameter("site",strings[1]);
+
+
+
+ String query = builder.build().getEncodedQuery();
+
+ OutputStream os=connection.getOutputStream();
+ BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(os,"UTF-8"));
+ writer.write(query);
+ writer.flush();
+ writer.close();
+ os.close();
+ connection.connect();
+
+ int rc = connection.getResponseCode();
+ if(rc == HTTP_OK)
+ {
+ InputStream inputStream = connection.getInputStream();
+ BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream));
+ StringBuilder sb=new StringBuilder();
+ String line;
+ while ((line=reader.readLine())!=null)
+ {
+ sb.append(line);
+ }
+ return sb.toString();
+ }
+ else{
+ Log.i("Error","Unsuccessfulcode"+rc);
+ return "unsuccessfull";
+ }
+
+
+ } catch (IOException e1) {
+ e1.printStackTrace();
+ return "Exception";
+ }
+
+
+ }
+
+ @Override
+ protected void onPostExecute(String s) {
+ super.onPostExecute(s);
+ pd.dismiss();
+ Log.i("LoginResult",s);
+ if(s.equals("failed"))
+ {
+ Toast.makeText(BlockSitesActivity.this, "Failed to set", Toast.LENGTH_SHORT).show();
+ }
+ else if (s.equalsIgnoreCase("exception") || s.equalsIgnoreCase("unsuccessful")) {
+
+ Toast.makeText(BlockSitesActivity.this, "OOPs! Something went wrong. Connection Problem.", Toast.LENGTH_LONG).show();
+
+ }
+
+ else if(s.equals("success")){
+ editText.setText("");
+ new SitesTask().execute(cid);
+ Toast.makeText(BlockSitesActivity.this, "Successfully added", Toast.LENGTH_SHORT).show();
+ }
+
+ }
+ }
+}
diff --git a/app/src/main/java/com/example/wot/parentapp/BlockSitesAdapter.java b/app/src/main/java/com/example/wot/parentapp/BlockSitesAdapter.java
new file mode 100644
index 0000000..82bd076
--- /dev/null
+++ b/app/src/main/java/com/example/wot/parentapp/BlockSitesAdapter.java
@@ -0,0 +1,189 @@
+package com.example.wot.parentapp;
+
+import android.app.Activity;
+import android.app.ProgressDialog;
+import android.content.Context;
+import android.net.Uri;
+import android.os.AsyncTask;
+import android.support.annotation.IdRes;
+import android.support.annotation.LayoutRes;
+import android.support.annotation.NonNull;
+import android.support.annotation.Nullable;
+import android.support.v7.widget.RecyclerView;
+import android.util.Log;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.ArrayAdapter;
+import android.widget.ImageButton;
+import android.widget.ImageView;
+import android.widget.TextView;
+import android.widget.Toast;
+
+import java.io.BufferedReader;
+import java.io.BufferedWriter;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.OutputStream;
+import java.io.OutputStreamWriter;
+import java.net.HttpURLConnection;
+import java.net.MalformedURLException;
+import java.net.URL;
+
+import static java.net.HttpURLConnection.HTTP_OK;
+
+/**
+ * Created by WOT on 9/9/2017.
+ */
+
+public class BlockSitesAdapter extends ArrayAdapter {
+
+ Activity activity;
+ String[] sites,ids;
+ public BlockSitesAdapter( Activity activity, int resource, String[] sites,String[] ids) {
+ super(activity, resource, sites);
+ this.activity = activity;
+ this.sites=sites;
+ this.ids = ids;
+ }
+
+ private class ViewHolder{
+ TextView sitetxt,idtxt;
+ ImageButton editimg,deleteim;
+
+ }
+
+ @Override
+ public View getView(int position, View convertView, ViewGroup parent) {
+
+ View view;
+ view = convertView;
+ final ViewHolder viewHolder;
+ if(convertView ==null)
+ {
+ LayoutInflater inflater = activity.getLayoutInflater();
+ view = inflater.inflate(R.layout.blocksiteslayout,parent,false);
+
+ viewHolder = new ViewHolder();
+ viewHolder.sitetxt = (TextView)view.findViewById(R.id.blocksitetxt);
+ viewHolder.idtxt = (TextView)view.findViewById(R.id.blocksiteidtxt);
+ viewHolder.editimg = (ImageButton) view.findViewById(R.id.siteeditim);
+ viewHolder.deleteim = (ImageButton)view.findViewById(R.id.sitedeleteim);
+ viewHolder.sitetxt.setText(sites[position]);
+ viewHolder.idtxt.setText(ids[position]);
+
+
+
+ viewHolder.deleteim.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ String id = viewHolder.idtxt.getText().toString();
+
+
+ new DeleteSitesTask().execute(id);
+ }
+ });
+
+ }
+ return view;
+ }
+
+ private class DeleteSitesTask extends AsyncTask
+ {
+ ProgressDialog pd = new ProgressDialog(activity);
+ HttpURLConnection connection;
+ URL url;
+
+ @Override
+ protected void onPreExecute() {
+ super.onPreExecute();
+ pd.setMessage("Loading...");
+ pd.setCancelable(false);
+ pd.show();
+
+ }
+
+ @Override
+ protected String doInBackground(String... strings) {
+
+ try {
+
+ url=new URL("https://app-1503993646.000webhostapp.com/parentchild/deletesites.php");
+
+ } catch (MalformedURLException e1) {
+ e1.printStackTrace();
+ }
+ try {
+ connection=(HttpURLConnection)url.openConnection();
+ connection.setRequestMethod("POST");
+ connection.setConnectTimeout(10000);
+ connection.setReadTimeout(15000);
+ connection.setDoInput(true);
+ connection.setDoOutput(true);
+
+ Uri.Builder builder =new Uri.Builder();
+ builder.appendQueryParameter("id",strings[0]);
+
+
+
+ String query = builder.build().getEncodedQuery();
+
+ OutputStream os=connection.getOutputStream();
+ BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(os,"UTF-8"));
+ writer.write(query);
+ writer.flush();
+ writer.close();
+ os.close();
+ connection.connect();
+
+ int rc = connection.getResponseCode();
+ if(rc == HTTP_OK)
+ {
+ InputStream inputStream = connection.getInputStream();
+ BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream));
+ StringBuilder sb=new StringBuilder();
+ String line;
+ while ((line=reader.readLine())!=null)
+ {
+ sb.append(line);
+ }
+ return sb.toString();
+ }
+ else{
+ Log.i("Error","Unsuccessfulcode"+rc);
+ return "unsuccessfull";
+ }
+
+
+ } catch (IOException e1) {
+ e1.printStackTrace();
+ return "Exception";
+ }
+
+
+ }
+
+ @Override
+ protected void onPostExecute(String s) {
+ super.onPostExecute(s);
+ pd.dismiss();
+ Log.i("LoginResult",s);
+ if(s.equals("failed"))
+ {
+ Toast.makeText(activity, "Failed to delete", Toast.LENGTH_SHORT).show();
+ }
+ else if (s.equalsIgnoreCase("exception") || s.equalsIgnoreCase("unsuccessful")) {
+
+ Toast.makeText(activity, "OOPs! Something went wrong. Connection Problem.", Toast.LENGTH_LONG).show();
+
+ }
+
+ else if(s.equals("success")){
+ activity.finish();
+ Toast.makeText(activity, "Deleted", Toast.LENGTH_SHORT).show();
+ }
+
+ }
+ }
+}
diff --git a/app/src/main/java/com/example/wot/parentapp/ChildAccess.java b/app/src/main/java/com/example/wot/parentapp/ChildAccess.java
new file mode 100644
index 0000000..a9a0bfa
--- /dev/null
+++ b/app/src/main/java/com/example/wot/parentapp/ChildAccess.java
@@ -0,0 +1,169 @@
+package com.example.wot.parentapp;
+
+import android.app.ProgressDialog;
+import android.content.Intent;
+import android.content.SharedPreferences;
+import android.net.Uri;
+import android.os.AsyncTask;
+import android.support.v7.app.AppCompatActivity;
+import android.os.Bundle;
+import android.util.Log;
+import android.view.View;
+import android.widget.Button;
+import android.widget.RadioButton;
+import android.widget.RadioGroup;
+import android.widget.Toast;
+
+import org.json.JSONArray;
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.io.BufferedReader;
+import java.io.BufferedWriter;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.OutputStream;
+import java.io.OutputStreamWriter;
+import java.net.HttpURLConnection;
+import java.net.MalformedURLException;
+import java.net.URL;
+
+import static java.net.HttpURLConnection.HTTP_OK;
+
+public class ChildAccess extends AppCompatActivity {
+
+ RadioGroup radioGroup;
+ Button button;
+ String s,text,cid;
+ SharedPreferences sharedPreferences;
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_child_access);
+
+ sharedPreferences = getSharedPreferences("PARENT",MODE_PRIVATE);
+ cid= sharedPreferences.getString("CHILD","no child");
+ final RadioGroup radioGroup = (RadioGroup)findViewById(R.id.radiog);
+ button = (Button)findViewById(R.id.sbtn);
+ button.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ int id=radioGroup.getCheckedRadioButtonId();
+ RadioButton rb=(RadioButton)findViewById(id);
+ text = rb.getText().toString().trim();
+ Log.i("rbText",text);
+ if(text.equals("Allow Access"))
+ {
+ s="true";
+ }
+ else
+ {
+ s="false";
+ }
+ new SendAccess().execute(cid,s);
+ }
+ });
+ }
+
+ private class SendAccess extends AsyncTask
+ {
+ ProgressDialog pd = new ProgressDialog(ChildAccess.this);
+ HttpURLConnection connection;
+ URL url;
+
+ @Override
+ protected void onPreExecute() {
+ super.onPreExecute();
+ pd.setMessage("Loading...");
+ pd.setCancelable(false);
+ pd.show();
+
+ }
+
+ @Override
+ protected String doInBackground(String... strings) {
+
+ try {
+
+ url=new URL("https://app-1503993646.000webhostapp.com/parentchild/sendaccess.php");
+
+ } catch (MalformedURLException e1) {
+ e1.printStackTrace();
+ }
+ try {
+ connection=(HttpURLConnection)url.openConnection();
+ connection.setRequestMethod("POST");
+ connection.setConnectTimeout(10000);
+ connection.setReadTimeout(15000);
+ connection.setDoInput(true);
+ connection.setDoOutput(true);
+
+ Uri.Builder builder =new Uri.Builder();
+ builder.appendQueryParameter("cid",strings[0]);
+ builder.appendQueryParameter("access",strings[1]);
+
+
+
+ String query = builder.build().getEncodedQuery();
+
+ OutputStream os=connection.getOutputStream();
+ BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(os,"UTF-8"));
+ writer.write(query);
+ writer.flush();
+ writer.close();
+ os.close();
+ connection.connect();
+
+ int rc = connection.getResponseCode();
+ if(rc == HTTP_OK)
+ {
+ InputStream inputStream = connection.getInputStream();
+ BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream));
+ StringBuilder sb=new StringBuilder();
+ String line;
+ while ((line=reader.readLine())!=null)
+ {
+ sb.append(line);
+ }
+ return sb.toString();
+ }
+ else{
+ Log.i("Error","Unsuccessfulcode"+rc);
+ return "unsuccessfull";
+ }
+
+
+ } catch (IOException e1) {
+ e1.printStackTrace();
+ return "Exception";
+ }
+
+
+ }
+
+ @Override
+ protected void onPostExecute(String s) {
+ super.onPostExecute(s);
+ pd.dismiss();
+ Log.i("SelectChildResult",s);
+ if(s.equals("0 results"))
+ {
+ Toast.makeText(ChildAccess.this, "Invalid", Toast.LENGTH_SHORT).show();
+ }
+ else if (s.equalsIgnoreCase("exception") || s.equalsIgnoreCase("unsuccessful")) {
+
+ Toast.makeText(ChildAccess.this, "OOPs! Something went wrong. Connection Problem.", Toast.LENGTH_LONG).show();
+
+ }
+ else if(s.equals("success"))
+ {
+ Toast.makeText(ChildAccess.this, "Successfully updated", Toast.LENGTH_SHORT).show();
+ startActivity(new Intent(ChildAccess.this,HomeActivity.class));
+ finish();
+ }
+
+
+ }
+ }
+}
diff --git a/app/src/main/java/com/example/wot/parentapp/HomeActivity.java b/app/src/main/java/com/example/wot/parentapp/HomeActivity.java
new file mode 100644
index 0000000..38d1934
--- /dev/null
+++ b/app/src/main/java/com/example/wot/parentapp/HomeActivity.java
@@ -0,0 +1,59 @@
+package com.example.wot.parentapp;
+
+import android.content.Intent;
+import android.support.v7.app.AppCompatActivity;
+import android.os.Bundle;
+import android.support.v7.widget.CardView;
+import android.view.View;
+
+public class HomeActivity extends AppCompatActivity {
+
+ CardView screencard,sitecard,batterycard,trackcard,usagecard;
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_home);
+
+ screencard = (CardView)findViewById(R.id.cardscreenshot);
+ sitecard = (CardView)findViewById(R.id.cardblock);
+ batterycard = (CardView)findViewById(R.id.cardbattery);
+ trackcard = (CardView)findViewById(R.id.cardplace);
+ usagecard = (CardView)findViewById(R.id.cardusage);
+
+ screencard.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ startActivity(new Intent(HomeActivity.this,ScreenshotActivity.class));
+ }
+ });
+
+ sitecard.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ startActivity(new Intent(HomeActivity.this,BlockSitesActivity.class));
+ }
+ });
+
+ batterycard.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ startActivity(new Intent(HomeActivity.this,BatteryActivity.class));
+ }
+ });
+
+ trackcard.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ startActivity(new Intent(HomeActivity.this,MapsActivity.class));
+ }
+ });
+
+ usagecard.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ startActivity(new Intent(HomeActivity.this,ChildAccess.class));
+ }
+ });
+ }
+}
diff --git a/app/src/main/java/com/example/wot/parentapp/LoginActivity.java b/app/src/main/java/com/example/wot/parentapp/LoginActivity.java
new file mode 100644
index 0000000..7b32007
--- /dev/null
+++ b/app/src/main/java/com/example/wot/parentapp/LoginActivity.java
@@ -0,0 +1,170 @@
+package com.example.wot.parentapp;
+
+import android.app.ProgressDialog;
+import android.content.Intent;
+import android.content.SharedPreferences;
+import android.net.Uri;
+import android.os.AsyncTask;
+import android.support.v7.app.AppCompatActivity;
+import android.os.Bundle;
+import android.util.Log;
+import android.view.View;
+import android.widget.Button;
+import android.widget.EditText;
+import android.widget.TextView;
+import android.widget.Toast;
+
+import java.io.BufferedReader;
+import java.io.BufferedWriter;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.OutputStream;
+import java.io.OutputStreamWriter;
+import java.net.HttpURLConnection;
+import java.net.MalformedURLException;
+import java.net.URL;
+
+import static java.net.HttpURLConnection.HTTP_OK;
+
+public class LoginActivity extends AppCompatActivity {
+
+ TextView signup;
+ Button signin;
+ String mail,pass;
+ EditText mailet,passet;
+ SharedPreferences sharedPreferences;
+ SharedPreferences.Editor editor;
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_login);
+
+ signin = (Button)findViewById(R.id.signinbtn);
+ signup = (TextView)findViewById(R.id.loginsignuptxt);
+ mailet = (EditText)findViewById(R.id.loginmail);
+ passet = (EditText)findViewById(R.id.loginpass);
+
+ sharedPreferences= getSharedPreferences("PARENT",MODE_PRIVATE);
+
+ signin.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ mail= mailet.getText().toString().trim();
+ pass = passet.getText().toString().trim();
+ new LoginTask().execute(mail,pass);
+ }
+ });
+
+ signup.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ startActivity(new Intent(LoginActivity.this,SignUpActivity.class));
+ }
+ });
+ }
+
+ private class LoginTask extends AsyncTask
+ {
+ ProgressDialog pd = new ProgressDialog(LoginActivity.this);
+ HttpURLConnection connection;
+ URL url;
+
+ @Override
+ protected void onPreExecute() {
+ super.onPreExecute();
+ pd.setMessage("Loading...");
+ pd.setCancelable(false);
+ pd.show();
+
+ }
+
+ @Override
+ protected String doInBackground(String... strings) {
+
+ try {
+
+ url=new URL("https://app-1503993646.000webhostapp.com/parentchild/parentlogin.php");
+
+ } catch (MalformedURLException e1) {
+ e1.printStackTrace();
+ }
+ try {
+ connection=(HttpURLConnection)url.openConnection();
+ connection.setRequestMethod("POST");
+ connection.setConnectTimeout(10000);
+ connection.setReadTimeout(15000);
+ connection.setDoInput(true);
+ connection.setDoOutput(true);
+
+ Uri.Builder builder =new Uri.Builder();
+ builder.appendQueryParameter("username",strings[0]);
+ builder.appendQueryParameter("password",strings[1]);
+
+
+
+ String query = builder.build().getEncodedQuery();
+
+ OutputStream os=connection.getOutputStream();
+ BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(os,"UTF-8"));
+ writer.write(query);
+ writer.flush();
+ writer.close();
+ os.close();
+ connection.connect();
+
+ int rc = connection.getResponseCode();
+ if(rc == HTTP_OK)
+ {
+ InputStream inputStream = connection.getInputStream();
+ BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream));
+ StringBuilder sb=new StringBuilder();
+ String line;
+ while ((line=reader.readLine())!=null)
+ {
+ sb.append(line);
+ }
+ return sb.toString();
+ }
+ else{
+ Log.i("Error","Unsuccessfulcode"+rc);
+ return "unsuccessfull";
+ }
+
+
+ } catch (IOException e1) {
+ e1.printStackTrace();
+ return "Exception";
+ }
+
+
+ }
+
+ @Override
+ protected void onPostExecute(String s) {
+ super.onPostExecute(s);
+ pd.dismiss();
+ Log.i("LoginResult",s);
+ if(s.equals("0 results"))
+ {
+ Toast.makeText(LoginActivity.this, "Invalid username or password", Toast.LENGTH_SHORT).show();
+ }
+ else if (s.equalsIgnoreCase("exception") || s.equalsIgnoreCase("unsuccessful")) {
+
+ Toast.makeText(LoginActivity.this, "OOPs! Something went wrong. Connection Problem.", Toast.LENGTH_LONG).show();
+
+ }
+
+ else {
+
+ editor= sharedPreferences.edit();
+ editor.putString("USER",s);
+ editor.apply();
+ // Toast.makeText(LoginActivity.this, "success", Toast.LENGTH_SHORT).show();
+ startActivity(new Intent (LoginActivity.this,SelectChildActivity.class));
+ }
+
+ }
+ }
+
+}
diff --git a/app/src/main/java/com/example/wot/parentapp/MapsActivity.java b/app/src/main/java/com/example/wot/parentapp/MapsActivity.java
new file mode 100644
index 0000000..a303fef
--- /dev/null
+++ b/app/src/main/java/com/example/wot/parentapp/MapsActivity.java
@@ -0,0 +1,188 @@
+package com.example.wot.parentapp;
+
+import android.app.ProgressDialog;
+import android.content.Intent;
+import android.content.SharedPreferences;
+import android.net.Uri;
+import android.os.AsyncTask;
+import android.support.v4.app.FragmentActivity;
+import android.os.Bundle;
+import android.util.Log;
+import android.widget.Toast;
+
+import com.google.android.gms.maps.CameraUpdateFactory;
+import com.google.android.gms.maps.GoogleMap;
+import com.google.android.gms.maps.OnMapReadyCallback;
+import com.google.android.gms.maps.SupportMapFragment;
+import com.google.android.gms.maps.model.LatLng;
+import com.google.android.gms.maps.model.MarkerOptions;
+
+import org.json.JSONArray;
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.io.BufferedReader;
+import java.io.BufferedWriter;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.OutputStream;
+import java.io.OutputStreamWriter;
+import java.net.HttpURLConnection;
+import java.net.MalformedURLException;
+import java.net.URL;
+
+import static java.net.HttpURLConnection.HTTP_OK;
+
+public class MapsActivity extends FragmentActivity implements OnMapReadyCallback {
+
+ private GoogleMap mMap;
+ double lon,lat;
+ String longitude,latitude,cid;
+ SharedPreferences sharedPreferences;
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_maps);
+ sharedPreferences = getSharedPreferences("PARENT",MODE_PRIVATE);
+ cid= sharedPreferences.getString("CHILD","no child");
+ new LocationTask().execute(cid);
+ }
+
+
+
+ @Override
+ public void onMapReady(GoogleMap googleMap) {
+ mMap = googleMap;
+
+ lon = Double.parseDouble(longitude);
+ lat = Double.parseDouble(latitude);
+ // Add a marker in Sydney and move the camera
+ LatLng location = new LatLng(lat, lon);
+ Log.i("Location",location.toString());
+ mMap.addMarker(new MarkerOptions().position(location).title("Child Location"));
+ mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(location, 10.0f));
+
+ }
+
+ private class LocationTask extends AsyncTask
+ {
+ ProgressDialog pd = new ProgressDialog(MapsActivity.this);
+ HttpURLConnection connection;
+ URL url;
+
+ @Override
+ protected void onPreExecute() {
+ super.onPreExecute();
+ pd.setMessage("Loading...");
+ pd.setCancelable(false);
+ pd.show();
+
+ }
+
+ @Override
+ protected String doInBackground(String... strings) {
+
+ try {
+
+ url=new URL("https://app-1503993646.000webhostapp.com/parentchild/getlocation.php");
+
+ } catch (MalformedURLException e1) {
+ e1.printStackTrace();
+ }
+ try {
+ connection=(HttpURLConnection)url.openConnection();
+ connection.setRequestMethod("POST");
+ connection.setConnectTimeout(10000);
+ connection.setReadTimeout(15000);
+ connection.setDoInput(true);
+ connection.setDoOutput(true);
+
+ Uri.Builder builder =new Uri.Builder();
+ builder.appendQueryParameter("cid",strings[0]);
+
+
+
+ String query = builder.build().getEncodedQuery();
+
+ OutputStream os=connection.getOutputStream();
+ BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(os,"UTF-8"));
+ writer.write(query);
+ writer.flush();
+ writer.close();
+ os.close();
+ connection.connect();
+
+ int rc = connection.getResponseCode();
+ if(rc == HTTP_OK)
+ {
+ InputStream inputStream = connection.getInputStream();
+ BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream));
+ StringBuilder sb=new StringBuilder();
+ String line;
+ while ((line=reader.readLine())!=null)
+ {
+ sb.append(line);
+ }
+ return sb.toString();
+ }
+ else{
+ Log.i("Error","Unsuccessfulcode"+rc);
+ return "unsuccessfull";
+ }
+
+
+ } catch (IOException e1) {
+ e1.printStackTrace();
+ return "Exception";
+ }
+
+
+ }
+
+ @Override
+ protected void onPostExecute(String s) {
+ super.onPostExecute(s);
+ pd.dismiss();
+ Log.i("LoginResult",s);
+ if(s.equals("0 results"))
+ {
+ Toast.makeText(MapsActivity.this, "Location not available", Toast.LENGTH_SHORT).show();
+ finish();
+ }
+ else if (s.equalsIgnoreCase("exception") || s.equalsIgnoreCase("unsuccessful")) {
+
+ Toast.makeText(MapsActivity.this, "OOPs! Something went wrong. Connection Problem.", Toast.LENGTH_LONG).show();
+ finish();
+
+ }
+
+ else {
+ try {
+ JSONObject jsonObject = new JSONObject(s);
+ JSONArray jsonArray = jsonObject.optJSONArray("location");
+ for(int i=0;i
+ {
+ ProgressDialog pd = new ProgressDialog(ScreenshotActivity.this);
+ HttpURLConnection connection;
+ URL url;
+
+ @Override
+ protected void onPreExecute() {
+ super.onPreExecute();
+ pd.setMessage("Loading...");
+ pd.setCancelable(false);
+ pd.show();
+
+ }
+
+ @Override
+ protected String doInBackground(String... strings) {
+
+ try {
+
+ url=new URL("https://app-1503993646.000webhostapp.com/parentchild/getscreen.php");
+
+ } catch (MalformedURLException e1) {
+ e1.printStackTrace();
+ }
+ try {
+ connection=(HttpURLConnection)url.openConnection();
+ connection.setRequestMethod("POST");
+ connection.setConnectTimeout(10000);
+ connection.setReadTimeout(15000);
+ connection.setDoInput(true);
+ connection.setDoOutput(true);
+
+ Uri.Builder builder =new Uri.Builder();
+ builder.appendQueryParameter("cid",strings[0]);
+
+
+
+ String query = builder.build().getEncodedQuery();
+
+ OutputStream os=connection.getOutputStream();
+ BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(os,"UTF-8"));
+ writer.write(query);
+ writer.flush();
+ writer.close();
+ os.close();
+ connection.connect();
+
+ int rc = connection.getResponseCode();
+ if(rc == HTTP_OK)
+ {
+ InputStream inputStream = connection.getInputStream();
+ BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream));
+ StringBuilder sb=new StringBuilder();
+ String line;
+ while ((line=reader.readLine())!=null)
+ {
+ sb.append(line);
+ }
+ return sb.toString();
+ }
+ else{
+ Log.i("Error","Unsuccessfulcode"+rc);
+ return "unsuccessfull";
+ }
+
+
+ } catch (IOException e1) {
+ e1.printStackTrace();
+ return "Exception";
+ }
+
+
+ }
+
+ @Override
+ protected void onPostExecute(String s) {
+ super.onPostExecute(s);
+ pd.dismiss();
+ Log.i("LoginResult",s);
+ if(s.equals("0 results"))
+ {
+ Toast.makeText(ScreenshotActivity.this, "Screenshot not available", Toast.LENGTH_SHORT).show();
+ finish();
+ }
+ else if (s.equalsIgnoreCase("exception") || s.equalsIgnoreCase("unsuccessful")) {
+
+ Toast.makeText(ScreenshotActivity.this, "OOPs! Something went wrong. Connection Problem.", Toast.LENGTH_LONG).show();
+ finish();
+
+ }
+
+ else {
+
+
+ Glide.with(ScreenshotActivity.this).load(s).placeholder(R.drawable.parentapp_logo).into(imageView);
+
+ }
+
+ }
+ }
+
+ @Override
+ public boolean onCreateOptionsMenu(Menu menu) {
+ getMenuInflater().inflate(R.menu.screenshot_menu,menu);
+ return super.onCreateOptionsMenu(menu);
+ }
+
+ @Override
+ public boolean onOptionsItemSelected(MenuItem item) {
+ int id = item.getItemId();
+ if(id==R.id.screenshot_refresh)
+ {
+ new ScreenshotTask().execute(cid);
+ }
+ return super.onOptionsItemSelected(item);
+ }
+}
diff --git a/app/src/main/java/com/example/wot/parentapp/SelectChildActivity.java b/app/src/main/java/com/example/wot/parentapp/SelectChildActivity.java
new file mode 100644
index 0000000..e210636
--- /dev/null
+++ b/app/src/main/java/com/example/wot/parentapp/SelectChildActivity.java
@@ -0,0 +1,184 @@
+package com.example.wot.parentapp;
+
+import android.app.ProgressDialog;
+import android.content.Intent;
+import android.content.SharedPreferences;
+import android.net.Uri;
+import android.os.AsyncTask;
+import android.support.v7.app.AppCompatActivity;
+import android.os.Bundle;
+import android.util.Log;
+import android.view.View;
+import android.widget.AdapterView;
+import android.widget.ListView;
+import android.widget.TextView;
+import android.widget.Toast;
+
+import org.json.JSONArray;
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.io.BufferedReader;
+import java.io.BufferedWriter;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.OutputStream;
+import java.io.OutputStreamWriter;
+import java.net.HttpURLConnection;
+import java.net.MalformedURLException;
+import java.net.URL;
+
+import static java.net.HttpURLConnection.HTTP_OK;
+
+public class SelectChildActivity extends AppCompatActivity {
+
+ ListView listView;
+ SharedPreferences sharedPreferences;
+ SharedPreferences.Editor editor;
+ String user;
+ SelectChildAdapter selectChildAdapter;
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_select_child);
+
+ sharedPreferences = getSharedPreferences("PARENT",MODE_PRIVATE);
+ listView = (ListView)findViewById(R.id.selectchildlist);
+ user = sharedPreferences.getString("USER","no user");
+ Log.i("user",user);
+ new LoginTask().execute(user);
+ listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
+ @Override
+ public void onItemClick(AdapterView> adapterView, View view, int i, long l) {
+ TextView idtxt = (TextView)view.findViewById(R.id.selectchildid);
+ editor = sharedPreferences.edit();
+ editor.putString("CHILD",idtxt.getText().toString());
+ editor.apply();
+ // Toast.makeText(SelectChildActivity.this, idtxt.getText().toString(), Toast.LENGTH_SHORT).show();
+ startActivity(new Intent(SelectChildActivity.this,HomeActivity.class));
+ }
+ });
+ }
+
+ private class LoginTask extends AsyncTask
+ {
+ ProgressDialog pd = new ProgressDialog(SelectChildActivity.this);
+ HttpURLConnection connection;
+ URL url;
+
+ @Override
+ protected void onPreExecute() {
+ super.onPreExecute();
+ pd.setMessage("Loading...");
+ pd.setCancelable(false);
+ pd.show();
+
+ }
+
+ @Override
+ protected String doInBackground(String... strings) {
+
+ try {
+
+ url=new URL("https://app-1503993646.000webhostapp.com/parentchild/childlist.php");
+
+ } catch (MalformedURLException e1) {
+ e1.printStackTrace();
+ }
+ try {
+ connection=(HttpURLConnection)url.openConnection();
+ connection.setRequestMethod("POST");
+ connection.setConnectTimeout(10000);
+ connection.setReadTimeout(15000);
+ connection.setDoInput(true);
+ connection.setDoOutput(true);
+
+ Uri.Builder builder =new Uri.Builder();
+ builder.appendQueryParameter("pid",strings[0]);
+
+
+
+ String query = builder.build().getEncodedQuery();
+
+ OutputStream os=connection.getOutputStream();
+ BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(os,"UTF-8"));
+ writer.write(query);
+ writer.flush();
+ writer.close();
+ os.close();
+ connection.connect();
+
+ int rc = connection.getResponseCode();
+ if(rc == HTTP_OK)
+ {
+ InputStream inputStream = connection.getInputStream();
+ BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream));
+ StringBuilder sb=new StringBuilder();
+ String line;
+ while ((line=reader.readLine())!=null)
+ {
+ sb.append(line);
+ }
+ return sb.toString();
+ }
+ else{
+ Log.i("Error","Unsuccessfulcode"+rc);
+ return "unsuccessfull";
+ }
+
+
+ } catch (IOException e1) {
+ e1.printStackTrace();
+ return "Exception";
+ }
+
+
+ }
+
+ @Override
+ protected void onPostExecute(String s) {
+ super.onPostExecute(s);
+ pd.dismiss();
+ Log.i("SelectChildResult",s);
+ if(s.equals("0 results"))
+ {
+ Toast.makeText(SelectChildActivity.this, "Invalid", Toast.LENGTH_SHORT).show();
+ }
+ else if (s.equalsIgnoreCase("exception") || s.equalsIgnoreCase("unsuccessful")) {
+
+ Toast.makeText(SelectChildActivity.this, "OOPs! Something went wrong. Connection Problem.", Toast.LENGTH_LONG).show();
+
+ }
+
+ else {
+ String[] name,id;
+ try {
+ JSONObject jsonObject = new JSONObject(s);
+ JSONArray jsonArray = jsonObject.optJSONArray("child");
+ name = new String[jsonArray.length()];
+ id = new String[jsonArray.length()];
+ if(jsonArray==null)
+ {
+ Toast.makeText(SelectChildActivity.this, "No child added", Toast.LENGTH_SHORT).show();
+ }
+ else {
+ for (int i = 0; i < jsonArray.length(); i++) {
+ JSONObject jsonObject1 = jsonArray.optJSONObject(i);
+ name[i] = jsonObject1.getString("name");
+ id[i] = jsonObject1.getString("id");
+ }
+
+ selectChildAdapter = new SelectChildAdapter(SelectChildActivity.this, R.layout.selectchildlayout, name, id);
+ listView.setAdapter(selectChildAdapter);
+ }
+ } catch (JSONException e) {
+ e.printStackTrace();
+ }
+
+ }
+
+ }
+ }
+
+}
diff --git a/app/src/main/java/com/example/wot/parentapp/SelectChildAdapter.java b/app/src/main/java/com/example/wot/parentapp/SelectChildAdapter.java
new file mode 100644
index 0000000..ffb5ee6
--- /dev/null
+++ b/app/src/main/java/com/example/wot/parentapp/SelectChildAdapter.java
@@ -0,0 +1,57 @@
+package com.example.wot.parentapp;
+
+import android.app.Activity;
+import android.content.Context;
+import android.support.annotation.IdRes;
+import android.support.annotation.LayoutRes;
+import android.support.annotation.NonNull;
+import android.support.annotation.Nullable;
+import android.support.v7.widget.CardView;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.ArrayAdapter;
+import android.widget.TextView;
+
+/**
+ * Created by WOT on 8/29/2017.
+ */
+
+public class SelectChildAdapter extends ArrayAdapter {
+
+ Activity activity;
+ String[] name;
+ String[] id;
+ public SelectChildAdapter(@NonNull Activity context, @LayoutRes int resource, String[] name,String[] id) {
+ super(context, resource, name);
+ this.activity = context;
+ this.name = name;
+ this.id = id;
+ }
+ private class ViewHolder
+ {
+ TextView nametxt,idtxt;
+ CardView cardView;
+ }
+
+ @NonNull
+ @Override
+ public View getView(int position, @Nullable View convertView, @NonNull ViewGroup parent) {
+
+ View v= convertView;
+ ViewHolder viewHolder;
+ if(v==null)
+ {
+ LayoutInflater inflater = (LayoutInflater)activity.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
+ v = inflater.inflate(R.layout.selectchildlayout,parent,false);
+ viewHolder = new ViewHolder();
+ viewHolder.nametxt = (TextView)v.findViewById(R.id.selectchildname);
+ viewHolder.idtxt = (TextView)v.findViewById(R.id.selectchildid);
+ viewHolder.cardView = (CardView) v.findViewById(R.id.selectchildcard);
+ viewHolder.nametxt.setText(name[position]);
+ viewHolder.idtxt.setText(id[position]);
+
+ }
+ return v;
+ }
+}
diff --git a/app/src/main/java/com/example/wot/parentapp/SignUpActivity.java b/app/src/main/java/com/example/wot/parentapp/SignUpActivity.java
new file mode 100644
index 0000000..bc13cc9
--- /dev/null
+++ b/app/src/main/java/com/example/wot/parentapp/SignUpActivity.java
@@ -0,0 +1,213 @@
+package com.example.wot.parentapp;
+
+import android.app.ProgressDialog;
+import android.content.Intent;
+import android.net.Uri;
+import android.os.AsyncTask;
+import android.support.design.widget.TextInputLayout;
+import android.support.v7.app.AppCompatActivity;
+import android.os.Bundle;
+import android.view.View;
+import android.widget.Button;
+import android.widget.EditText;
+import android.widget.RadioButton;
+import android.widget.RadioGroup;
+import android.widget.Toast;
+
+import java.io.BufferedReader;
+import java.io.BufferedWriter;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.OutputStream;
+import java.io.OutputStreamWriter;
+import java.net.HttpURLConnection;
+import java.net.MalformedURLException;
+import java.net.URL;
+
+import static java.net.HttpURLConnection.HTTP_OK;
+
+public class SignUpActivity extends AppCompatActivity {
+
+ EditText ename,eaddr,ephone,email;
+ RadioGroup radioGroup;
+ String name,addr,gender,phone,mail;
+ Button button;
+ TextInputLayout tname,taddr,tphone,tmail;
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_sign_up);
+
+ ename = (EditText)findViewById(R.id.signupname);
+ eaddr = (EditText)findViewById(R.id.signupaddress);
+ ephone = (EditText)findViewById(R.id.signupphone);
+ email = (EditText)findViewById(R.id.signupmail);
+ button = (Button)findViewById(R.id.signupbtn);
+ radioGroup = (RadioGroup)findViewById(R.id.signuprg);
+ tname = (TextInputLayout)findViewById(R.id.namelayout);
+ taddr = (TextInputLayout)findViewById(R.id.addresslayout);
+ tphone = (TextInputLayout)findViewById(R.id.phonelayout);
+ tmail = (TextInputLayout)findViewById(R.id.maillayout);
+
+ button.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ name = ename.getText().toString().trim();
+ addr = eaddr.getText().toString().trim();
+ phone = ephone.getText().toString().trim();
+ mail = email.getText().toString().trim();
+ int id = radioGroup.getCheckedRadioButtonId();
+ RadioButton radioButton = (RadioButton)findViewById(id);
+ gender = radioButton.getText().toString();
+
+ if(name.isEmpty())
+ {
+ tname.setErrorEnabled(true);
+ tname.setError("Enter your name");
+ return;
+ }
+ else
+ {
+ tname.setErrorEnabled(false);
+ }
+ if(addr.isEmpty())
+ {
+ taddr.setErrorEnabled(true);
+ taddr.setError("Enter Address");
+ return;
+ }
+ else
+ {
+ taddr.setErrorEnabled(false);
+ }
+ if(phone.isEmpty())
+ {
+ tphone.setErrorEnabled(true);
+ tphone.setError("Enter your phone number");
+ return;
+ }
+ else
+ {
+ tphone.setErrorEnabled(false);
+ }
+ if(mail.isEmpty()|| !android.util.Patterns.EMAIL_ADDRESS.matcher(mail).matches())
+ {
+ tmail.setErrorEnabled(true);
+ tmail.setError("Enter valid email");
+ return;
+ }
+ else {
+ tmail.setErrorEnabled(false);
+ }
+
+ new RegisterTask().execute(name,addr,gender,phone,mail);
+
+
+ }
+ });
+
+ }
+
+ private class RegisterTask extends AsyncTask
+ {
+ ProgressDialog pd = new ProgressDialog(SignUpActivity.this);
+ HttpURLConnection connection;
+ URL url;
+
+ @Override
+ protected void onPreExecute() {
+ super.onPreExecute();
+ pd.setMessage("Loading...");
+ pd.setCancelable(false);
+ pd.show();
+
+ }
+
+ @Override
+ protected String doInBackground(String... strings) {
+
+ try {
+
+ url=new URL("https://app-1503993646.000webhostapp.com/parentchild/signup.php");
+
+ } catch (MalformedURLException e1) {
+ e1.printStackTrace();
+ }
+ try {
+ connection=(HttpURLConnection)url.openConnection();
+ connection.setRequestMethod("POST");
+ connection.setConnectTimeout(10000);
+ connection.setReadTimeout(15000);
+ connection.setDoInput(true);
+ connection.setDoOutput(true);
+
+ Uri.Builder builder =new Uri.Builder();
+ builder.appendQueryParameter("name",strings[0]);
+ builder.appendQueryParameter("addr",strings[1]);
+ builder.appendQueryParameter("gender",strings[2]);
+ builder.appendQueryParameter("phone",strings[3]);
+ builder.appendQueryParameter("mail",strings[4]);
+
+
+
+ String query = builder.build().getEncodedQuery();
+
+ OutputStream os=connection.getOutputStream();
+ BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(os,"UTF-8"));
+ writer.write(query);
+ writer.flush();
+ writer.close();
+ os.close();
+ connection.connect();
+
+ int rc = connection.getResponseCode();
+ if(rc == HTTP_OK)
+ {
+ InputStream inputStream = connection.getInputStream();
+ BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream));
+ StringBuilder sb=new StringBuilder();
+ String line;
+ while ((line=reader.readLine())!=null)
+ {
+ sb.append(line);
+ }
+ return sb.toString();
+ }
+ else
+ return "unsuccessfull";
+
+ } catch (IOException e1) {
+ e1.printStackTrace();
+ return "Exception";
+ }
+
+
+ }
+
+ @Override
+ protected void onPostExecute(String s) {
+ super.onPostExecute(s);
+ pd.dismiss();
+ if(s.equalsIgnoreCase("Success"))
+ {
+ startActivity(new Intent(SignUpActivity.this,LoginActivity.class));
+ }
+
+ else if (s.equalsIgnoreCase("exception") || s.equalsIgnoreCase("unsuccessful")) {
+
+ Toast.makeText(SignUpActivity.this, "OOPs! Something went wrong. Connection Problem.", Toast.LENGTH_LONG).show();
+
+ }
+ else if(s.equals("Already registered"))
+ {
+ Toast.makeText(SignUpActivity.this,"You are already registered",Toast.LENGTH_LONG).show();
+ }
+ else {
+ Toast.makeText(SignUpActivity.this, "Error!", Toast.LENGTH_SHORT).show();
+ }
+
+ }
+ }
+
+}
diff --git a/app/src/main/java/com/example/wot/parentapp/SplashActivity.java b/app/src/main/java/com/example/wot/parentapp/SplashActivity.java
new file mode 100644
index 0000000..062e285
--- /dev/null
+++ b/app/src/main/java/com/example/wot/parentapp/SplashActivity.java
@@ -0,0 +1,45 @@
+package com.example.wot.parentapp;
+
+import android.annotation.SuppressLint;
+import android.content.Intent;
+import android.support.v7.app.ActionBar;
+import android.support.v7.app.AppCompatActivity;
+import android.os.Bundle;
+import android.os.Handler;
+import android.view.MotionEvent;
+import android.view.View;
+import android.view.Window;
+import android.view.WindowManager;
+
+/**
+ * An example full-screen activity that shows and hides the system UI (i.e.
+ * status bar and navigation/system bar) with user interaction.
+ */
+public class SplashActivity extends AppCompatActivity {
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ // remove title
+ requestWindowFeature(Window.FEATURE_NO_TITLE);
+ getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
+ WindowManager.LayoutParams.FLAG_FULLSCREEN);
+ setContentView(R.layout.activity_splash);
+ thread.start();
+ }
+ Thread thread = new Thread(new Runnable(){
+
+ @Override
+ public void run() {
+ try {
+ Thread.sleep(2000);
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ finally {
+ startActivity(new Intent(SplashActivity.this,LoginActivity.class));
+ finish();
+ }
+ }
+ });
+
+}
\ No newline at end of file
diff --git a/app/src/main/res/drawable/backgroundgradient.xml b/app/src/main/res/drawable/backgroundgradient.xml
new file mode 100644
index 0000000..9d01fcb
--- /dev/null
+++ b/app/src/main/res/drawable/backgroundgradient.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/drawable/circlebackground.xml b/app/src/main/res/drawable/circlebackground.xml
new file mode 100644
index 0000000..27b74f3
--- /dev/null
+++ b/app/src/main/res/drawable/circlebackground.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/drawable/ic_delete_black_24dp.xml b/app/src/main/res/drawable/ic_delete_black_24dp.xml
new file mode 100644
index 0000000..050330e
--- /dev/null
+++ b/app/src/main/res/drawable/ic_delete_black_24dp.xml
@@ -0,0 +1,9 @@
+
+
+
diff --git a/app/src/main/res/drawable/ic_edit_black_24dp.xml b/app/src/main/res/drawable/ic_edit_black_24dp.xml
new file mode 100644
index 0000000..599a5e3
--- /dev/null
+++ b/app/src/main/res/drawable/ic_edit_black_24dp.xml
@@ -0,0 +1,4 @@
+
+
+
diff --git a/app/src/main/res/drawable/ic_refresh_black_24dp.xml b/app/src/main/res/drawable/ic_refresh_black_24dp.xml
new file mode 100644
index 0000000..bd204e7
--- /dev/null
+++ b/app/src/main/res/drawable/ic_refresh_black_24dp.xml
@@ -0,0 +1,4 @@
+
+
+
diff --git a/app/src/main/res/drawable/parentapp_logo.png b/app/src/main/res/drawable/parentapp_logo.png
new file mode 100644
index 0000000..0b6e02c
Binary files /dev/null and b/app/src/main/res/drawable/parentapp_logo.png differ
diff --git a/app/src/main/res/layout/activity_battery.xml b/app/src/main/res/layout/activity_battery.xml
new file mode 100644
index 0000000..5f8b9c7
--- /dev/null
+++ b/app/src/main/res/layout/activity_battery.xml
@@ -0,0 +1,23 @@
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/layout/activity_block_sites.xml b/app/src/main/res/layout/activity_block_sites.xml
new file mode 100644
index 0000000..200ab00
--- /dev/null
+++ b/app/src/main/res/layout/activity_block_sites.xml
@@ -0,0 +1,49 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/layout/activity_child_access.xml b/app/src/main/res/layout/activity_child_access.xml
new file mode 100644
index 0000000..72b44c9
--- /dev/null
+++ b/app/src/main/res/layout/activity_child_access.xml
@@ -0,0 +1,55 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/layout/activity_home.xml b/app/src/main/res/layout/activity_home.xml
new file mode 100644
index 0000000..0f82f8b
--- /dev/null
+++ b/app/src/main/res/layout/activity_home.xml
@@ -0,0 +1,87 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/layout/activity_login.xml b/app/src/main/res/layout/activity_login.xml
new file mode 100644
index 0000000..97efcb4
--- /dev/null
+++ b/app/src/main/res/layout/activity_login.xml
@@ -0,0 +1,89 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/layout/activity_maps.xml b/app/src/main/res/layout/activity_maps.xml
new file mode 100644
index 0000000..ed42fa6
--- /dev/null
+++ b/app/src/main/res/layout/activity_maps.xml
@@ -0,0 +1,8 @@
+
diff --git a/app/src/main/res/layout/activity_screenshot.xml b/app/src/main/res/layout/activity_screenshot.xml
new file mode 100644
index 0000000..8f382a3
--- /dev/null
+++ b/app/src/main/res/layout/activity_screenshot.xml
@@ -0,0 +1,34 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/layout/activity_select_child.xml b/app/src/main/res/layout/activity_select_child.xml
new file mode 100644
index 0000000..a184b5f
--- /dev/null
+++ b/app/src/main/res/layout/activity_select_child.xml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
diff --git a/app/src/main/res/layout/activity_sign_up.xml b/app/src/main/res/layout/activity_sign_up.xml
new file mode 100644
index 0000000..11dd493
--- /dev/null
+++ b/app/src/main/res/layout/activity_sign_up.xml
@@ -0,0 +1,139 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/layout/activity_splash.xml b/app/src/main/res/layout/activity_splash.xml
new file mode 100644
index 0000000..9528cea
--- /dev/null
+++ b/app/src/main/res/layout/activity_splash.xml
@@ -0,0 +1,55 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/layout/blocksiteslayout.xml b/app/src/main/res/layout/blocksiteslayout.xml
new file mode 100644
index 0000000..78581e2
--- /dev/null
+++ b/app/src/main/res/layout/blocksiteslayout.xml
@@ -0,0 +1,61 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/layout/selectchildlayout.xml b/app/src/main/res/layout/selectchildlayout.xml
new file mode 100644
index 0000000..06c0063
--- /dev/null
+++ b/app/src/main/res/layout/selectchildlayout.xml
@@ -0,0 +1,26 @@
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/menu/screenshot_menu.xml b/app/src/main/res/menu/screenshot_menu.xml
new file mode 100644
index 0000000..15e1074
--- /dev/null
+++ b/app/src/main/res/menu/screenshot_menu.xml
@@ -0,0 +1,9 @@
+
+
\ No newline at end of file
diff --git a/app/src/main/res/mipmap-hdpi/ic_launcher.png b/app/src/main/res/mipmap-hdpi/ic_launcher.png
new file mode 100644
index 0000000..e776319
Binary files /dev/null and b/app/src/main/res/mipmap-hdpi/ic_launcher.png differ
diff --git a/app/src/main/res/mipmap-mdpi/ic_launcher.png b/app/src/main/res/mipmap-mdpi/ic_launcher.png
new file mode 100644
index 0000000..c65543f
Binary files /dev/null and b/app/src/main/res/mipmap-mdpi/ic_launcher.png differ
diff --git a/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/app/src/main/res/mipmap-xhdpi/ic_launcher.png
new file mode 100644
index 0000000..f7a1f9b
Binary files /dev/null and b/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ
diff --git a/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
new file mode 100644
index 0000000..71dd552
Binary files /dev/null and b/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ
diff --git a/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
new file mode 100644
index 0000000..d137ed3
Binary files /dev/null and b/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ
diff --git a/app/src/main/res/values/attrs.xml b/app/src/main/res/values/attrs.xml
new file mode 100644
index 0000000..7ce840e
--- /dev/null
+++ b/app/src/main/res/values/attrs.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml
new file mode 100644
index 0000000..7388b95
--- /dev/null
+++ b/app/src/main/res/values/colors.xml
@@ -0,0 +1,12 @@
+
+
+#4caf50
+#80e27e
+#087f23
+#3949ab
+#6f74dd
+#00227b
+
+#ffffff
+#66000000
+
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
new file mode 100644
index 0000000..8cdb369
--- /dev/null
+++ b/app/src/main/res/values/strings.xml
@@ -0,0 +1,7 @@
+
+ Parent App
+
+ Dummy Button
+ DUMMY\nCONTENT
+ Map
+
diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml
new file mode 100644
index 0000000..b77097e
--- /dev/null
+++ b/app/src/main/res/values/styles.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
+
diff --git a/app/src/release/res/values/google_maps_api.xml b/app/src/release/res/values/google_maps_api.xml
new file mode 100644
index 0000000..fa88c61
--- /dev/null
+++ b/app/src/release/res/values/google_maps_api.xml
@@ -0,0 +1,22 @@
+
+
+
+ YOUR_KEY_HERE
+
+
diff --git a/app/src/test/java/com/example/wot/parentapp/ExampleUnitTest.java b/app/src/test/java/com/example/wot/parentapp/ExampleUnitTest.java
new file mode 100644
index 0000000..e36a841
--- /dev/null
+++ b/app/src/test/java/com/example/wot/parentapp/ExampleUnitTest.java
@@ -0,0 +1,17 @@
+package com.example.wot.parentapp;
+
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+/**
+ * Example local unit test, which will execute on the development machine (host).
+ *
+ * @see Testing documentation
+ */
+public class ExampleUnitTest {
+ @Test
+ public void addition_isCorrect() throws Exception {
+ assertEquals(4, 2 + 2);
+ }
+}
\ No newline at end of file
diff --git a/build.gradle b/build.gradle
new file mode 100644
index 0000000..c33a638
--- /dev/null
+++ b/build.gradle
@@ -0,0 +1,23 @@
+// 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:3.0.0'
+
+ // NOTE: Do not place your application dependencies here; they belong
+ // in the individual module build.gradle files
+ }
+}
+
+allprojects {
+ repositories {
+ jcenter()
+ }
+}
+
+task clean(type: Delete) {
+ delete rootProject.buildDir
+}
diff --git a/gradle.properties b/gradle.properties
new file mode 100644
index 0000000..aac7c9b
--- /dev/null
+++ b/gradle.properties
@@ -0,0 +1,17 @@
+# Project-wide Gradle settings.
+
+# IDE (e.g. Android Studio) users:
+# Gradle settings configured through the IDE *will override*
+# any settings specified in this file.
+
+# For more details on how to configure your build environment visit
+# http://www.gradle.org/docs/current/userguide/build_environment.html
+
+# Specifies the JVM arguments used for the daemon process.
+# The setting is particularly useful for tweaking memory settings.
+org.gradle.jvmargs=-Xmx1536m
+
+# When configured, Gradle will run in incubating parallel mode.
+# This option should only be used with decoupled projects. More details, visit
+# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
+# org.gradle.parallel=true
diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar
new file mode 100644
index 0000000..13372ae
Binary files /dev/null and b/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
new file mode 100644
index 0000000..332076a
--- /dev/null
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,6 @@
+#Sat Oct 28 12:26:19 IST 2017
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip
diff --git a/gradlew b/gradlew
new file mode 100644
index 0000000..9d82f78
--- /dev/null
+++ b/gradlew
@@ -0,0 +1,160 @@
+#!/usr/bin/env bash
+
+##############################################################################
+##
+## Gradle start up script for UN*X
+##
+##############################################################################
+
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS=""
+
+APP_NAME="Gradle"
+APP_BASE_NAME=`basename "$0"`
+
+# Use the maximum available, or set MAX_FD != -1 to use that value.
+MAX_FD="maximum"
+
+warn ( ) {
+ echo "$*"
+}
+
+die ( ) {
+ echo
+ echo "$*"
+ echo
+ exit 1
+}
+
+# OS specific support (must be 'true' or 'false').
+cygwin=false
+msys=false
+darwin=false
+case "`uname`" in
+ CYGWIN* )
+ cygwin=true
+ ;;
+ Darwin* )
+ darwin=true
+ ;;
+ MINGW* )
+ msys=true
+ ;;
+esac
+
+# Attempt to set APP_HOME
+# Resolve links: $0 may be a link
+PRG="$0"
+# Need this for relative symlinks.
+while [ -h "$PRG" ] ; do
+ ls=`ls -ld "$PRG"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '/.*' > /dev/null; then
+ PRG="$link"
+ else
+ PRG=`dirname "$PRG"`"/$link"
+ fi
+done
+SAVED="`pwd`"
+cd "`dirname \"$PRG\"`/" >/dev/null
+APP_HOME="`pwd -P`"
+cd "$SAVED" >/dev/null
+
+CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
+
+# Determine the Java command to use to start the JVM.
+if [ -n "$JAVA_HOME" ] ; then
+ if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+ # IBM's JDK on AIX uses strange locations for the executables
+ JAVACMD="$JAVA_HOME/jre/sh/java"
+ else
+ JAVACMD="$JAVA_HOME/bin/java"
+ fi
+ if [ ! -x "$JAVACMD" ] ; then
+ die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+ fi
+else
+ JAVACMD="java"
+ which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+fi
+
+# Increase the maximum file descriptors if we can.
+if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
+ MAX_FD_LIMIT=`ulimit -H -n`
+ if [ $? -eq 0 ] ; then
+ if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
+ MAX_FD="$MAX_FD_LIMIT"
+ fi
+ ulimit -n $MAX_FD
+ if [ $? -ne 0 ] ; then
+ warn "Could not set maximum file descriptor limit: $MAX_FD"
+ fi
+ else
+ warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
+ fi
+fi
+
+# For Darwin, add options to specify how the application appears in the dock
+if $darwin; then
+ GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
+fi
+
+# For Cygwin, switch paths to Windows format before running java
+if $cygwin ; then
+ APP_HOME=`cygpath --path --mixed "$APP_HOME"`
+ CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
+ JAVACMD=`cygpath --unix "$JAVACMD"`
+
+ # We build the pattern for arguments to be converted via cygpath
+ ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
+ SEP=""
+ for dir in $ROOTDIRSRAW ; do
+ ROOTDIRS="$ROOTDIRS$SEP$dir"
+ SEP="|"
+ done
+ OURCYGPATTERN="(^($ROOTDIRS))"
+ # Add a user-defined pattern to the cygpath arguments
+ if [ "$GRADLE_CYGPATTERN" != "" ] ; then
+ OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
+ fi
+ # Now convert the arguments - kludge to limit ourselves to /bin/sh
+ i=0
+ for arg in "$@" ; do
+ CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
+ CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
+
+ if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
+ eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
+ else
+ eval `echo args$i`="\"$arg\""
+ fi
+ i=$((i+1))
+ done
+ case $i in
+ (0) set -- ;;
+ (1) set -- "$args0" ;;
+ (2) set -- "$args0" "$args1" ;;
+ (3) set -- "$args0" "$args1" "$args2" ;;
+ (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
+ (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
+ (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
+ (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
+ (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
+ (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
+ esac
+fi
+
+# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
+function splitJvmOpts() {
+ JVM_OPTS=("$@")
+}
+eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
+JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
+
+exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
diff --git a/gradlew.bat b/gradlew.bat
new file mode 100644
index 0000000..8a0b282
--- /dev/null
+++ b/gradlew.bat
@@ -0,0 +1,90 @@
+@if "%DEBUG%" == "" @echo off
+@rem ##########################################################################
+@rem
+@rem Gradle startup script for Windows
+@rem
+@rem ##########################################################################
+
+@rem Set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" setlocal
+
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS=
+
+set DIRNAME=%~dp0
+if "%DIRNAME%" == "" set DIRNAME=.
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
+
+@rem Find java.exe
+if defined JAVA_HOME goto findJavaFromJavaHome
+
+set JAVA_EXE=java.exe
+%JAVA_EXE% -version >NUL 2>&1
+if "%ERRORLEVEL%" == "0" goto init
+
+echo.
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:findJavaFromJavaHome
+set JAVA_HOME=%JAVA_HOME:"=%
+set JAVA_EXE=%JAVA_HOME%/bin/java.exe
+
+if exist "%JAVA_EXE%" goto init
+
+echo.
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:init
+@rem Get command-line arguments, handling Windowz variants
+
+if not "%OS%" == "Windows_NT" goto win9xME_args
+if "%@eval[2+2]" == "4" goto 4NT_args
+
+:win9xME_args
+@rem Slurp the command line arguments.
+set CMD_LINE_ARGS=
+set _SKIP=2
+
+:win9xME_args_slurp
+if "x%~1" == "x" goto execute
+
+set CMD_LINE_ARGS=%*
+goto execute
+
+:4NT_args
+@rem Get arguments from the 4NT Shell from JP Software
+set CMD_LINE_ARGS=%$
+
+:execute
+@rem Setup the command line
+
+set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
+
+@rem Execute Gradle
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
+
+:end
+@rem End local scope for the variables with windows NT shell
+if "%ERRORLEVEL%"=="0" goto mainEnd
+
+:fail
+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
+rem the _cmd.exe /c_ return code!
+if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
+exit /b 1
+
+:mainEnd
+if "%OS%"=="Windows_NT" endlocal
+
+:omega
diff --git a/settings.gradle b/settings.gradle
new file mode 100644
index 0000000..e7b4def
--- /dev/null
+++ b/settings.gradle
@@ -0,0 +1 @@
+include ':app'