diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..a4c7838
--- /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..c7d1c5a
--- /dev/null
+++ b/.idea/copyright/profiles_settings.xml
@@ -0,0 +1,3 @@
+
+
+
\ No newline at end of file
diff --git a/.idea/encodings.xml b/.idea/encodings.xml
new file mode 100644
index 0000000..97626ba
--- /dev/null
+++ b/.idea/encodings.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/gradle.xml b/.idea/gradle.xml
new file mode 100644
index 0000000..fe72da5
--- /dev/null
+++ b/.idea/gradle.xml
@@ -0,0 +1,19 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
new file mode 100644
index 0000000..7158618
--- /dev/null
+++ b/.idea/misc.xml
@@ -0,0 +1,62 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 1.8
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/modules.xml b/.idea/modules.xml
new file mode 100644
index 0000000..434c781
--- /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..3543521
--- /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..d527647
--- /dev/null
+++ b/app/build.gradle
@@ -0,0 +1,31 @@
+apply plugin: 'com.android.application'
+
+android {
+ compileSdkVersion 24
+ buildToolsVersion "24.0.2"
+ defaultConfig {
+ applicationId "com.example.home.dvs"
+ minSdkVersion 15
+ targetSdkVersion 24
+ versionCode 1
+ versionName "1.0"
+ testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
+ useLibrary 'org.apache.http.legacy'
+ }
+ 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:24.2.1'
+ compile 'com.android.support:design:24.2.1'
+ testCompile 'junit:junit:4.12'
+}
diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro
new file mode 100644
index 0000000..2489f27
--- /dev/null
+++ b/app/proguard-rules.pro
@@ -0,0 +1,17 @@
+# Add project specific ProGuard rules here.
+# By default, the flags in this file are appended to flags specified
+# in C:\Users\home\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 *;
+#}
diff --git a/app/src/androidTest/java/com/example/home/dvs/ExampleInstrumentedTest.java b/app/src/androidTest/java/com/example/home/dvs/ExampleInstrumentedTest.java
new file mode 100644
index 0000000..e5f88fc
--- /dev/null
+++ b/app/src/androidTest/java/com/example/home/dvs/ExampleInstrumentedTest.java
@@ -0,0 +1,26 @@
+package com.example.home.dvs;
+
+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.home.dvs", appContext.getPackageName());
+ }
+}
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
new file mode 100644
index 0000000..43f5f1d
--- /dev/null
+++ b/app/src/main/AndroidManifest.xml
@@ -0,0 +1,87 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/ic_home-web.png b/app/src/main/ic_home-web.png
new file mode 100644
index 0000000..9dbb7ed
Binary files /dev/null and b/app/src/main/ic_home-web.png differ
diff --git a/app/src/main/ic_iasdfa-web.png b/app/src/main/ic_iasdfa-web.png
new file mode 100644
index 0000000..5e31a01
Binary files /dev/null and b/app/src/main/ic_iasdfa-web.png differ
diff --git a/app/src/main/ic_launcher-web.png b/app/src/main/ic_launcher-web.png
new file mode 100644
index 0000000..61033d7
Binary files /dev/null and b/app/src/main/ic_launcher-web.png differ
diff --git a/app/src/main/ic_logo-web.png b/app/src/main/ic_logo-web.png
new file mode 100644
index 0000000..bae30b6
Binary files /dev/null and b/app/src/main/ic_logo-web.png differ
diff --git a/app/src/main/ic_logog-web.png b/app/src/main/ic_logog-web.png
new file mode 100644
index 0000000..cacc334
Binary files /dev/null and b/app/src/main/ic_logog-web.png differ
diff --git a/app/src/main/java/com/example/home/dvs/Aboutus.java b/app/src/main/java/com/example/home/dvs/Aboutus.java
new file mode 100644
index 0000000..709887e
--- /dev/null
+++ b/app/src/main/java/com/example/home/dvs/Aboutus.java
@@ -0,0 +1,60 @@
+package com.example.home.dvs;
+
+import android.os.Bundle;
+import android.support.v4.app.Fragment;
+import android.support.v7.app.AppCompatActivity;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.Button;
+
+
+public class Aboutus extends Fragment {
+
+ //View variables
+ Button postProblem;
+ Button status;
+
+ public static Aboutus newInstance() {
+ Aboutus fragment = new Aboutus();
+ return fragment;
+ }
+
+ public Aboutus() {
+ }
+
+ @Override
+ public void onStart() {
+ super.onStart();
+
+ AppCompatActivity activity = (AppCompatActivity) getActivity();
+ activity.getSupportActionBar().setTitle("AboutUs");
+
+
+
+
+ }
+
+ /**
+ * Updates the status on the action bar.
+ *
+ */
+ private void setTitle(CharSequence title) {
+ AppCompatActivity activity = (AppCompatActivity) getActivity();
+ if (null == activity) {
+ return;
+ }
+ if (null == activity.getSupportActionBar()) {
+ return;
+ }
+ activity.getSupportActionBar().setTitle(title);
+ }
+
+
+ @Override
+ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
+ View rootView = inflater.inflate(R.layout.abouus, container, false);
+ return rootView;
+ }
+
+}
diff --git a/app/src/main/java/com/example/home/dvs/Activities.java b/app/src/main/java/com/example/home/dvs/Activities.java
new file mode 100644
index 0000000..561bb99
--- /dev/null
+++ b/app/src/main/java/com/example/home/dvs/Activities.java
@@ -0,0 +1,208 @@
+package com.example.home.dvs;
+
+import android.app.ProgressDialog;
+import android.content.Intent;
+import android.os.Bundle;
+import android.os.StrictMode;
+import android.support.v4.app.Fragment;
+import android.support.v7.app.AlertDialog;
+import android.support.v7.app.AppCompatActivity;
+import android.util.Log;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.AdapterView;
+import android.widget.ListView;
+import android.widget.SimpleAdapter;
+import android.widget.Toast;
+
+import org.apache.http.HttpEntity;
+import org.apache.http.HttpResponse;
+import org.apache.http.NameValuePair;
+import org.apache.http.StatusLine;
+import org.apache.http.client.ClientProtocolException;
+import org.apache.http.client.HttpClient;
+import org.apache.http.client.methods.HttpGet;
+import org.apache.http.client.methods.HttpPost;
+import org.apache.http.impl.client.DefaultHttpClient;
+import org.json.JSONArray;
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+
+
+public class Activities extends Fragment {
+
+ ProgressDialog dialog1 = null;
+ String httpurl = "http://192.168.8.1/dvs/get_Activities.php";
+
+ HttpPost httppost;
+ StringBuffer buffer;
+ HttpResponse response;
+ HttpClient httpclient;
+ List nameValuePairs;
+ protected boolean active = true;
+ protected int splashTime = 8000;
+ AlertDialog levelDialog;
+ String uid;
+ public static Activities newInstance() {
+ Activities fragment = new Activities();
+ return fragment;
+ }
+
+ public Activities() {
+ }
+
+ @Override
+ public void onStart() {
+ super.onStart();
+ notices();
+ AppCompatActivity activity = (AppCompatActivity) getActivity();
+ activity.getSupportActionBar().setTitle("Activities");
+
+
+
+ }
+
+ /**
+ * Updates the status on the action bar.
+ *
+
+ private void setTitle(CharSequence title) {
+ AppCompatActivity activity = (AppCompatActivity) getActivity();
+ if (null == activity) {
+ return;
+ }
+ if (null == activity.getSupportActionBar()) {
+ return;
+ }
+ activity.getSupportActionBar().setTitle(title);
+ }
+
+ */
+ @Override
+ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
+ View rootView = inflater.inflate(R.layout.my_activities, container, false);
+ Bundle bundle = this.getArguments();
+ uid = bundle.getString("UID");
+ return rootView;
+ }
+ public void notices()
+ {
+ Toast.makeText(getActivity(),"****"+uid+"***",Toast.LENGTH_SHORT).show();
+ if (android.os.Build.VERSION.SDK_INT > 9) {
+ StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build();
+ StrictMode.setThreadPolicy(policy);
+ }
+
+ final ListView lisView1 = (ListView)getActivity().findViewById(R.id.listView1);
+
+
+ String url = httpurl;
+ try {
+
+ JSONArray data = new JSONArray(getJSONUrl(url));
+
+ final ArrayList> MyArrList = new ArrayList>();
+ HashMap map;
+
+ for (int i = 0; i < data.length(); i++) {
+ JSONObject c = data.getJSONObject(i);
+
+ map = new HashMap();
+
+ map.put("put_eid", c.getString("E_id"));
+ map.put("put_emode", c.getString("mode"));
+ map.put("put_estart", c.getString("E_start"));
+ map.put("put_eend", c.getString("E_end"));
+ map.put("put_edesc", c.getString("E_desc"));
+ map.put("put_efor", c.getString("E_for"));
+ map.put("put_etitle", c.getString("E_title"));
+ map.put("put_evoter",c.getString("E_voters"));
+
+ MyArrList.add(map);
+
+ }
+
+ SimpleAdapter sAdap;
+ sAdap = new SimpleAdapter(getActivity(), MyArrList, R.layout.model_active,
+ new String[]{"put_etitle", "put_emode"}, new int[]{R.id.ac_title, R.id.ac_mode});
+ lisView1.setAdapter(sAdap);
+
+ lisView1.setOnItemClickListener(new AdapterView.OnItemClickListener() {
+ public void onItemClick(AdapterView> myAdapter, View myView,
+ int position, long mylng) {
+
+ String sDate = MyArrList.get(position).get("put_eid").toString();
+
+ String sNotifi_Title = MyArrList.get(position).get("put_etitle").toString();
+
+ String sNotification = MyArrList.get(position).get("put_edesc").toString();
+
+ String sTime = MyArrList.get(position).get("put_estart").toString();
+
+ String sSdby = MyArrList.get(position).get("put_eend").toString();
+
+ String sSendto = MyArrList.get(position).get("put_emode").toString();
+ String eVoter = MyArrList.get(position).get("put_evoter").toString();
+
+ //String sAttachments = MyArrList.get(position).get("put_attachments").toString();
+
+
+ Intent var = new Intent("android.intent.action.ACTIVITY_DETAILS");
+ var.putExtra("act_title",sNotifi_Title);
+ var.putExtra("act_desc",sNotification);
+ var.putExtra("act_end", sSdby);
+ var.putExtra("act_id", sDate);
+ var.putExtra("act_start", sTime);
+ var.putExtra("act_mode", sSendto);
+ var.putExtra("act_mode", sSendto);
+ var.putExtra("UID",uid);
+ var.putExtra("Evoter",eVoter);
+
+ // var.putExtra("files", sAttachments);
+ startActivity(var);
+
+ }
+
+ });
+ }
+ catch (JSONException e) {
+ e.printStackTrace();
+ }
+ }
+ private String getJSONUrl(String url) {
+ StringBuilder str = new StringBuilder();
+ HttpClient client = new DefaultHttpClient();
+ HttpGet httpGet = new HttpGet(url);
+ try {
+ HttpResponse response = client.execute(httpGet);
+ StatusLine statusLine = response.getStatusLine();
+ int statusCode = statusLine.getStatusCode();
+ if (statusCode == 200) {
+ HttpEntity entity = response.getEntity();
+ InputStream content = entity.getContent();
+ BufferedReader reader = new BufferedReader(new InputStreamReader(content));
+ String line;
+ while ((line = reader.readLine()) != null) {
+ str.append(line);
+ }
+ } else {
+ Log.e("Log", "Failed to download result..");
+ }
+ } catch (ClientProtocolException e) {
+ e.printStackTrace();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ return str.toString();
+ }
+
+}
diff --git a/app/src/main/java/com/example/home/dvs/Activity_Details.java b/app/src/main/java/com/example/home/dvs/Activity_Details.java
new file mode 100644
index 0000000..0610ce3
--- /dev/null
+++ b/app/src/main/java/com/example/home/dvs/Activity_Details.java
@@ -0,0 +1,135 @@
+package com.example.home.dvs;
+
+
+import android.app.ProgressDialog;
+import android.content.DialogInterface;
+import android.content.Intent;
+import android.net.Uri;
+import android.os.AsyncTask;
+import android.os.Bundle;
+import android.provider.SyncStateContract;
+import android.support.v7.app.ActionBarActivity;
+import android.util.Log;
+import android.view.View;
+import android.widget.Button;
+import android.widget.TextView;
+import android.widget.Toast;
+
+import org.apache.http.HttpEntity;
+import org.apache.http.HttpResponse;
+import org.apache.http.StatusLine;
+import org.apache.http.client.ClientProtocolException;
+import org.apache.http.client.HttpClient;
+import org.apache.http.client.methods.HttpGet;
+import org.apache.http.impl.client.DefaultHttpClient;
+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 java.util.ArrayList;
+import java.util.HashMap;
+
+import static android.R.attr.id;
+
+public class Activity_Details extends ActionBarActivity {
+
+
+ String title,id,stime,etime,desc,mode,voters;
+
+
+ public static final String LOG_TAG = "File-Path";
+ private ProgressDialog mProgressDialog;
+ public static final int DIALOG_DOWNLOAD_PROGRESS = 0;
+ String s = null;
+ ProgressDialog dialog1 = null;
+String uid;
+ public static final int CONNECTION_TIMEOUT = 10000;
+ public static final int READ_TIMEOUT = 15000;
+
+ public int conform = 0;
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_details);
+
+
+
+ title = getIntent().getStringExtra("act_title");
+ id = getIntent().getStringExtra("act_id");
+ stime = getIntent().getStringExtra("act_start");
+ etime = getIntent().getStringExtra("act_end");
+ desc = getIntent().getStringExtra("act_desc");
+ mode = getIntent().getStringExtra("act_mode");
+ uid = getIntent().getStringExtra("UID");
+ voters = getIntent().getStringExtra("Evoter");
+
+
+ Toast.makeText(Activity_Details.this,"****"+uid+"***",Toast.LENGTH_SHORT).show();
+
+
+ TextView a= (TextView)findViewById(R.id.head);
+ TextView b= (TextView)findViewById(R.id.stime);
+ TextView c= (TextView)findViewById(R.id.ftime);
+ TextView e = (TextView)findViewById(R.id.vdesc);
+ TextView d= (TextView)findViewById(R.id.status);
+ TextView ch= (TextView)findViewById(R.id.checking);
+
+ a.setText(title);
+ b.setText(stime);
+ c.setText(etime);
+ d.setText(mode);
+ e.setText(desc);
+ Button l = (Button)findViewById(R.id.go_vote);
+ if(mode.equals("Present")&&!voters.toString().contains(uid.toString()))
+ {
+ ch.setText("You not participated in this voting");
+ l.setText("Go for Vote");
+ l.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ voting_area();
+ }
+ });
+ }
+ else if (mode.equals("Present")&&voters.toString().contains(uid.toString()))
+ {
+ ch.setText("You already participated in this voting");
+ l.setText("View Results");
+ l.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ view_result(v);
+ }
+ });
+ }
+ else if (mode.equals("Future"))
+ {
+ l.setText("Wait");
+ }
+ }
+
+ public void voting_area(){
+
+ Toast.makeText(Activity_Details.this,"clicked voting"+id,Toast.LENGTH_SHORT).show();
+ Intent p = new Intent("android.intent.action.VOTING_AREA");
+ p.putExtra("act_id",id);
+ p.putExtra("act_title",title);
+ p.putExtra("UID",uid);
+ startActivity(p);
+ }
+ public void view_result(View v){
+ Toast.makeText(Activity_Details.this,"Result will come",Toast.LENGTH_SHORT).show();
+ }
+
+}
diff --git a/app/src/main/java/com/example/home/dvs/Confirm_Vote.java b/app/src/main/java/com/example/home/dvs/Confirm_Vote.java
new file mode 100644
index 0000000..54c9b41
--- /dev/null
+++ b/app/src/main/java/com/example/home/dvs/Confirm_Vote.java
@@ -0,0 +1,327 @@
+package com.example.home.dvs;
+
+
+import android.app.Notification;
+import android.app.NotificationManager;
+import android.app.PendingIntent;
+import android.app.ProgressDialog;
+import android.content.Context;
+import android.content.DialogInterface;
+import android.content.Intent;
+import android.content.SharedPreferences;
+import android.database.Cursor;
+import android.database.sqlite.SQLiteDatabase;
+import android.net.Uri;
+import android.os.AsyncTask;
+import android.os.Bundle;
+import android.support.v7.app.ActionBarActivity;
+import android.support.v7.app.AlertDialog;
+import android.support.v7.app.NotificationCompat;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.widget.Button;
+import android.widget.EditText;
+import android.widget.LinearLayout;
+import android.widget.ProgressBar;
+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;
+
+public class Confirm_Vote extends ActionBarActivity {
+
+
+ String title, id, name, age, symbol, data, nid,uid="",party;
+ String otp;
+
+ SQLiteDatabase mysql;
+ public static final String LOG_TAG = "File-Path";
+ private ProgressDialog mProgressDialog;
+ public static final int DIALOG_DOWNLOAD_PROGRESS = 0;
+ String s = null;
+ int confirm;
+ ProgressDialog dialog1 = null;
+ EditText edit_text_otp;
+ Button submit;
+
+ public static final int CONNECTION_TIMEOUT = 10000;
+ public static final int READ_TIMEOUT = 15000;
+ NotificationManager NM;
+ public int conform = 0;
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.nominee_model);
+
+
+ title = getIntent().getStringExtra("act_title");
+ id = getIntent().getStringExtra("act_id");
+ name = getIntent().getStringExtra("nomi_name");
+ age = getIntent().getStringExtra("nomi_age");
+ symbol = getIntent().getStringExtra("nomi_symbol");
+ data = getIntent().getStringExtra("nomi_data");
+ nid = getIntent().getStringExtra("nomi_id");
+ party = getIntent().getStringExtra("nomi_party");
+ uid = getIntent().getStringExtra("UID");
+
+
+ TextView h = (TextView) findViewById(R.id.heading);
+ h.setText(title);
+ TextView n = (TextView) findViewById(R.id.n_name);
+ n.setText(name);
+ TextView a = (TextView) findViewById(R.id.n_age);
+ a.setText("Age ::"+age);
+ TextView p = (TextView) findViewById(R.id.n_party);
+ p.setText("Party ::"+party);
+ TextView s = (TextView) findViewById(R.id.n_symbol);
+ s.setText("Symbol::"+symbol);
+ //TextView d = (TextView) findViewById(R.id.n_desc);
+ // d.setText(data);
+ LinearLayout linearLayout = (LinearLayout) findViewById(R.id.optlayout);
+ linearLayout.setVisibility(View.INVISIBLE);
+
+
+
+ edit_text_otp = (EditText) findViewById(R.id.otp);
+ submit = (Button) findViewById(R.id.Vote);
+
+
+ submit.setVisibility(View.VISIBLE);
+
+
+
+
+ Toast.makeText(this,uid,Toast.LENGTH_SHORT).show();
+
+ final Button l = (Button) findViewById(R.id.Vote);
+ l.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ AlertDialog.Builder alertDialog = new AlertDialog.Builder(
+ Confirm_Vote.this);
+ alertDialog.setTitle("Cinformation :: ");
+ alertDialog.setMessage("Are you sure you want to this Nominee?");
+
+ alertDialog.setPositiveButton("YES",
+ new DialogInterface.OnClickListener() {
+ public void onClick(DialogInterface dialog, int which) {
+
+ LinearLayout linearLay = (LinearLayout) findViewById(R.id.optlayout);
+ linearLay.setVisibility(View.VISIBLE);
+ submit.setVisibility(View.INVISIBLE);
+
+ sending_otp();
+ if(confirm==111)
+ {
+ Toast.makeText(Confirm_Vote.this,"Enter OTP",Toast.LENGTH_SHORT).show();
+ }
+
+
+ }
+
+ });
+ alertDialog.setNegativeButton("NO",
+ new DialogInterface.OnClickListener() {
+ public void onClick(DialogInterface dialog, int which) {
+ dialog.cancel();
+ }
+ });
+ alertDialog.show();
+ }
+
+ });
+ }
+
+
+
+
+ ////////////
+
+ private class AsyncVote extends AsyncTask {
+ ProgressDialog pdLoading = new ProgressDialog(Confirm_Vote.this);
+ HttpURLConnection conn;
+ URL url = null;
+
+ @Override
+ protected void onPreExecute() {
+ super.onPreExecute();
+
+ //this method will be running on UI thread
+ pdLoading.setMessage("\tLoading...");
+ pdLoading.setCancelable(false);
+ pdLoading.show();
+
+ }
+
+ @Override
+ protected String doInBackground(String... params) {
+ try {
+
+ // Enter URL address where your php file resides
+ url = new URL("http://192.168.8.1/dvs/Add_Vote.php");
+
+ } catch (MalformedURLException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ return "exception";
+ }
+ try {
+ // Setup HttpURLConnection class to send and receive data from php and mysql
+ conn = (HttpURLConnection) url.openConnection();
+ conn.setReadTimeout(READ_TIMEOUT);
+ conn.setConnectTimeout(CONNECTION_TIMEOUT);
+ conn.setRequestMethod("POST");
+
+ // setDoInput and setDoOutput method depict handling of both send and receive
+ conn.setDoInput(true);
+ conn.setDoOutput(true);
+
+ // Append parameters to URL
+ Uri.Builder builder = new Uri.Builder()
+ .appendQueryParameter("eid", params[0])
+ .appendQueryParameter("nid", params[1])
+ .appendQueryParameter("uid", params[2]);
+ String query = builder.build().getEncodedQuery();
+
+ // Open connection for sending data
+ OutputStream os = conn.getOutputStream();
+ BufferedWriter writer = new BufferedWriter(
+ new OutputStreamWriter(os, "UTF-8"));
+ writer.write(query);
+ writer.flush();
+ writer.close();
+ os.close();
+ conn.connect();
+
+ } catch (IOException e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ return "exception";
+ }
+
+ try {
+
+ int response_code = conn.getResponseCode();
+
+ // Check if successful connection made
+ if (response_code == HttpURLConnection.HTTP_OK) {
+
+ // Read data sent from server
+ InputStream input = conn.getInputStream();
+ BufferedReader reader = new BufferedReader(new InputStreamReader(input));
+ StringBuilder result = new StringBuilder();
+ String line;
+
+ while ((line = reader.readLine()) != null) {
+ result.append(line);
+ }
+
+ // Pass data to onPostExecute method
+ return (result.toString());
+
+ } else {
+
+ return ("unsuccessful");
+ }
+
+ } catch (IOException e) {
+ e.printStackTrace();
+ return "exception";
+ } finally {
+ conn.disconnect();
+ }
+
+
+ }
+
+ protected void onPostExecute(String result) {
+
+ //this method will be running on UI thread
+
+ pdLoading.dismiss();
+ if (result.equalsIgnoreCase("exception") || result.equalsIgnoreCase("unsuccessful")) {
+
+ Toast.makeText(Confirm_Vote.this, "OOPs! Something went wrong. Connection Problem.", Toast.LENGTH_LONG).show();
+
+ } else {
+ if (!result.equals("0")) {
+ Toast.makeText(Confirm_Vote.this, result, Toast.LENGTH_LONG).show();
+ } else {
+ Toast.makeText(Confirm_Vote.this, "Unsuccess", Toast.LENGTH_LONG).show();
+ }
+ }
+ }
+
+ }
+ public void Check_otp(View v) {
+
+ String otp2 = edit_text_otp.getText().toString();
+ Toast.makeText(Confirm_Vote.this,otp2, Toast.LENGTH_SHORT).show();
+ if (otp2.equals(otp)) {
+ Toast.makeText(Confirm_Vote.this, "entered correclty", Toast.LENGTH_SHORT).show();
+ confirm = 999;
+ new AsyncVote().execute(id, nid, uid);
+ Toast.makeText(Confirm_Vote.this, "Voting Sucess", Toast.LENGTH_SHORT).show();
+
+ Thread timer = new Thread() {
+ @Override
+ public void run() {
+ try {
+
+ sleep(10000);
+ } catch (Exception e) {
+ e.printStackTrace();
+ } finally {
+ dialog1.dismiss();
+ }
+ }
+ };
+ dialog1 = ProgressDialog.show(Confirm_Vote.this, "", "Voting completed \n Moving to Home ", true);
+ timer.start();
+ //Toast.makeText(Confirm_Vote.this, "Moving to Main Page", Toast.LENGTH_SHORT).show();
+ Intent i = new Intent("android.intent.action.MAINACTIVITY");
+ i.putExtra("UID",uid);
+
+ startActivity(i);
+ finish();
+
+ } else {
+ Toast.makeText(Confirm_Vote.this, "Please enter correclty", Toast.LENGTH_SHORT).show();
+ confirm = 777;
+ }
+
+
+
+
+ //}
+ // */
+ }
+ //////////////
+ private void sending_otp() {
+ int k = (int) (100000+(Math.random()*100000));
+ otp = Integer.toString(k);
+ android.support.v4.app.NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(Confirm_Vote.this)
+ .setSmallIcon(android.R.drawable.ic_dialog_info)
+ .setContentTitle("DVS")
+ .setContentText("OTP is :"+otp);
+
+ // Obtain NotificationManager system service in order to show the notification
+ NotificationManager notificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
+ notificationManager.notify(112, mBuilder.build());
+ Toast.makeText(Confirm_Vote.this,"Otp send",Toast.LENGTH_SHORT).show();
+ confirm=111;
+ }
+}
+
+
+
diff --git a/app/src/main/java/com/example/home/dvs/History.java b/app/src/main/java/com/example/home/dvs/History.java
new file mode 100644
index 0000000..0aebdd5
--- /dev/null
+++ b/app/src/main/java/com/example/home/dvs/History.java
@@ -0,0 +1,174 @@
+package com.example.home.dvs;
+
+import android.app.ProgressDialog;
+import android.content.Intent;
+import android.os.Bundle;
+import android.os.StrictMode;
+import android.support.v4.app.Fragment;
+import android.support.v7.app.AlertDialog;
+import android.support.v7.app.AppCompatActivity;
+import android.util.Log;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.AdapterView;
+import android.widget.Button;
+import android.widget.ListView;
+import android.widget.SimpleAdapter;
+
+import org.apache.http.HttpEntity;
+import org.apache.http.HttpResponse;
+import org.apache.http.NameValuePair;
+import org.apache.http.StatusLine;
+import org.apache.http.client.ClientProtocolException;
+import org.apache.http.client.HttpClient;
+import org.apache.http.client.methods.HttpGet;
+import org.apache.http.client.methods.HttpPost;
+import org.apache.http.impl.client.DefaultHttpClient;
+import org.json.JSONArray;
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+
+
+public class History extends Fragment {
+
+ ProgressDialog dialog1 = null;
+ String httpurl = "http://192.168.8.1/dvs/get_History.php";
+
+ HttpPost httppost;
+ StringBuffer buffer;
+ HttpResponse response;
+ HttpClient httpclient;
+ List nameValuePairs;
+ protected boolean active = true;
+ protected int splashTime = 8000;
+ AlertDialog levelDialog;
+ String uid;
+
+
+ public static History newInstance() {
+ History fragment = new History();
+ return fragment;
+ }
+
+ public History() {
+ }
+
+ @Override
+ public void onStart() {
+ super.onStart();
+
+ history();
+ AppCompatActivity activity = (AppCompatActivity) getActivity();
+ activity.getSupportActionBar().setTitle("History");
+
+
+
+ }
+
+ /**
+ * Updates the status on the action bar.
+ *
+ */
+ private void setTitle(CharSequence title) {
+ AppCompatActivity activity = (AppCompatActivity) getActivity();
+ if (null == activity) {
+ return;
+ }
+ if (null == activity.getSupportActionBar()) {
+ return;
+ }
+ activity.getSupportActionBar().setTitle(title);
+ }
+
+
+ @Override
+ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
+ View rootView = inflater.inflate(R.layout.history, container, false);
+ Bundle bundle = this.getArguments();
+ uid = bundle.getString("UID");
+ return rootView;
+ }
+
+
+ public void history()
+ {
+ if (android.os.Build.VERSION.SDK_INT > 9) {
+ StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build();
+ StrictMode.setThreadPolicy(policy);
+ }
+
+ final ListView lisView1 = (ListView)getActivity().findViewById(R.id.history_list);
+ String url = httpurl;
+
+ try {
+
+ JSONArray data = new JSONArray(getJSONUrl(url));
+
+ final ArrayList> MyArrList = new ArrayList>();
+ HashMap map;
+
+ for(int i = 0; i < data.length(); i++){
+ JSONObject c = data.getJSONObject(i);
+ // if (c.getString("UID").equals(uid)) {
+
+ map = new HashMap();
+
+ map.put("put_htime", c.getString("Time"));
+ map.put("put_hdesc", c.getString("Hdesc"));
+
+ MyArrList.add(map);
+ // }
+
+ }
+
+ SimpleAdapter sAdap;
+ sAdap = new SimpleAdapter(getActivity(), MyArrList, R.layout.history_model,
+ new String[] {"put_htime","put_hdesc"}, new int[] { R.id.h_time,R.id.h_desc});
+ lisView1.setAdapter(sAdap);
+
+ final AlertDialog.Builder viewDetail = new AlertDialog.Builder(getActivity());
+ // OnClick Item
+
+ } catch (JSONException e) {
+ e.printStackTrace();
+ }
+ }
+
+
+ //////////////////////////////////////////////////////////////////////////
+ private String getJSONUrl(String url) {
+ StringBuilder str = new StringBuilder();
+ HttpClient client = new DefaultHttpClient();
+ HttpGet httpGet = new HttpGet(url);
+ try {
+ HttpResponse response = client.execute(httpGet);
+ StatusLine statusLine = response.getStatusLine();
+ int statusCode = statusLine.getStatusCode();
+ if (statusCode == 200) {
+ HttpEntity entity = response.getEntity();
+ InputStream content = entity.getContent();
+ BufferedReader reader = new BufferedReader(new InputStreamReader(content));
+ String line;
+ while ((line = reader.readLine()) != null) {
+ str.append(line);
+ }
+ } else {
+ Log.e("Log", "Failed to download result..");
+ }
+ } catch (ClientProtocolException e) {
+ e.printStackTrace();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ return str.toString();
+ }
+ }
diff --git a/app/src/main/java/com/example/home/dvs/Home.java b/app/src/main/java/com/example/home/dvs/Home.java
new file mode 100644
index 0000000..1f113f4
--- /dev/null
+++ b/app/src/main/java/com/example/home/dvs/Home.java
@@ -0,0 +1,60 @@
+package com.example.home.dvs;
+
+import android.os.Bundle;
+import android.support.v4.app.Fragment;
+import android.support.v4.app.FragmentActivity;
+import android.support.v4.app.FragmentManager;
+import android.support.v7.app.AppCompatActivity;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.Button;
+
+
+public class Home extends Fragment {
+
+ //View variables
+ Button postProblem;
+ Button status;
+
+ public static Home newInstance() {
+ Home fragment = new Home();
+ return fragment;
+ }
+
+ public Home() {
+ }
+
+ @Override
+ public void onStart() {
+ super.onStart();
+
+ AppCompatActivity activity = (AppCompatActivity) getActivity();
+ activity.getSupportActionBar().setTitle("Home");
+
+
+ }
+
+ /**
+ * Updates the status on the action bar.
+ *
+ */
+ private void setTitle(CharSequence title) {
+ AppCompatActivity activity = (AppCompatActivity) getActivity();
+ if (null == activity) {
+ return;
+ }
+ if (null == activity.getSupportActionBar()) {
+ return;
+ }
+ activity.getSupportActionBar().setTitle(title);
+ }
+
+
+ @Override
+ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
+ View rootView = inflater.inflate(R.layout.home, container, false);
+ return rootView;
+ }
+
+}
diff --git a/app/src/main/java/com/example/home/dvs/Login.java b/app/src/main/java/com/example/home/dvs/Login.java
new file mode 100644
index 0000000..fd7041f
--- /dev/null
+++ b/app/src/main/java/com/example/home/dvs/Login.java
@@ -0,0 +1,220 @@
+package com.example.home.dvs;
+
+import android.app.ProgressDialog;
+import android.content.ContentValues;
+import android.content.Context;
+import android.content.Intent;
+import android.content.SharedPreferences;
+import android.database.sqlite.SQLiteDatabase;
+import android.net.Uri;
+import android.os.AsyncTask;
+import android.os.Bundle;
+import android.support.v7.app.AppCompatActivity;
+import android.view.View;
+import android.widget.Button;
+import android.widget.EditText;
+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;
+
+/**
+ * Created by home on 2/28/2017.
+ */
+
+public class Login extends AppCompatActivity {
+ EditText getid, getpass;
+ Button login;
+ SQLiteDatabase mysql;
+ String userName = "";
+ boolean secure = false;
+ ProgressDialog dialog1 = null;
+ String uid = "";
+ String passw = "";
+
+ SharedPreferences sharedpreferences;
+
+ public static final int CONNECTION_TIMEOUT = 10000;
+ public static final int READ_TIMEOUT = 15000;
+
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.login);
+ mysql = openOrCreateDatabase("Login", Context.MODE_PRIVATE, null);
+ getid = (EditText) findViewById(R.id.userId);
+ getpass = (EditText) findViewById(R.id.phno);
+ login = (Button) findViewById(R.id.login);
+
+
+ login.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+
+ dialog1 = ProgressDialog.show(Login.this, "", "Sending request\n please wait....", true);
+
+ uid = getid.getText().toString();
+ passw = getpass.getText().toString();
+ if (uid.length() ==12 && !passw.equals("") && passw.length()>9) {
+ new AsyncLogin().execute(uid, passw);
+
+
+ } else {
+ Toast.makeText(Login.this, "Fill the Fields", Toast.LENGTH_SHORT).show();
+ }
+ dialog1.dismiss();
+ }
+ });
+
+ }
+
+ public void secureLogin() {
+
+
+ Toast.makeText(Login.this, "Login Success", Toast.LENGTH_SHORT).show();
+
+ ContentValues cv = new ContentValues();
+ cv.put("SNO", 10);
+ cv.put("UNAME", uid);
+ cv.put("PASSWD", passw);
+ cv.put("PNAME", userName);
+ mysql.insert("profile", null, cv);
+ //Toast.makeText(getActivity(),"Stored",Toast.LENGTH_SHORT).show();
+ Toast.makeText(Login.this,"****"+uid+"***",Toast.LENGTH_SHORT).show();
+ Intent k = new Intent("android.intent.action.MAINACTIVITY");
+ k.putExtra("UID",uid);
+ startActivity(k);
+ finish();
+ }
+
+
+
+
+
+ private class AsyncLogin extends AsyncTask {
+ ProgressDialog pdLoading = new ProgressDialog(Login.this);
+ HttpURLConnection conn;
+ URL url = null;
+
+ @Override
+ protected void onPreExecute() {
+ super.onPreExecute();
+
+ //this method will be running on UI thread
+ pdLoading.setMessage("\tLoading...");
+ pdLoading.setCancelable(false);
+ pdLoading.show();
+
+ }
+
+ @Override
+ protected String doInBackground(String... params) {
+ try {
+
+ // Enter URL address where your php file resides
+ url = new URL("http://192.168.8.1/dvs/user_login.php");
+
+ } catch (MalformedURLException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ return "exception";
+ }
+ try {
+ // Setup HttpURLConnection class to send and receive data from php and mysql
+ conn = (HttpURLConnection) url.openConnection();
+ conn.setReadTimeout(READ_TIMEOUT);
+ conn.setConnectTimeout(CONNECTION_TIMEOUT);
+ conn.setRequestMethod("POST");
+
+ // setDoInput and setDoOutput method depict handling of both send and receive
+ conn.setDoInput(true);
+ conn.setDoOutput(true);
+
+ // Append parameters to URL
+ Uri.Builder builder = new Uri.Builder()
+ .appendQueryParameter("userid", params[0])
+ .appendQueryParameter("phno", params[1]);
+ String query = builder.build().getEncodedQuery();
+
+ // Open connection for sending data
+ OutputStream os = conn.getOutputStream();
+ BufferedWriter writer = new BufferedWriter(
+ new OutputStreamWriter(os, "UTF-8"));
+ writer.write(query);
+ writer.flush();
+ writer.close();
+ os.close();
+ conn.connect();
+
+ } catch (IOException e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ return "exception";
+ }
+
+ try {
+
+ int response_code = conn.getResponseCode();
+
+ // Check if successful connection made
+ if (response_code == HttpURLConnection.HTTP_OK) {
+
+ // Read data sent from server
+ InputStream input = conn.getInputStream();
+ BufferedReader reader = new BufferedReader(new InputStreamReader(input));
+ StringBuilder result = new StringBuilder();
+ String line;
+
+ while ((line = reader.readLine()) != null) {
+ result.append(line);
+ }
+
+ // Pass data to onPostExecute method
+ return (result.toString());
+
+ } else {
+
+ return ("unsuccessful");
+ }
+
+ } catch (IOException e) {
+ e.printStackTrace();
+ return "exception";
+ } finally {
+ conn.disconnect();
+ }
+
+
+ }
+
+ protected void onPostExecute(String result) {
+
+ //this method will be running on UI thread
+
+ pdLoading.dismiss();
+ if (result.equalsIgnoreCase("exception") || result.equalsIgnoreCase("unsuccessful")) {
+
+ Toast.makeText(Login.this, "OOPs! Something went wrong. Connection Problem.", Toast.LENGTH_LONG).show();
+
+ } else {
+ if (!result.equals("0")) {
+ Toast.makeText(Login.this, result, Toast.LENGTH_LONG).show();
+ userName = result;
+ secureLogin();
+ } else {
+ Toast.makeText(Login.this, "Invalid adhaar or phno", Toast.LENGTH_LONG).show();
+ }
+ }
+ }
+
+ }
+
+}
+
diff --git a/app/src/main/java/com/example/home/dvs/MainActivity.java b/app/src/main/java/com/example/home/dvs/MainActivity.java
new file mode 100644
index 0000000..bca97fe
--- /dev/null
+++ b/app/src/main/java/com/example/home/dvs/MainActivity.java
@@ -0,0 +1,176 @@
+package com.example.home.dvs;
+
+
+
+
+ import android.content.Context;
+ import android.content.DialogInterface;
+ import android.content.Intent;
+ import android.database.Cursor;
+ import android.database.sqlite.SQLiteDatabase;
+ import android.os.Bundle;
+ import android.support.design.widget.NavigationView;
+ import android.support.v4.app.Fragment;
+ import android.support.v4.app.FragmentManager;
+ import android.support.v4.app.NotificationCompatExtras;
+ import android.support.v4.view.GravityCompat;
+ import android.support.v4.widget.DrawerLayout;
+ import android.support.v7.app.ActionBarDrawerToggle;
+ import android.support.v7.app.AlertDialog;
+ import android.support.v7.app.AppCompatActivity;
+ import android.support.v7.widget.Toolbar;
+ import android.view.Menu;
+ import android.view.MenuItem;
+ import android.view.View;
+ import android.widget.Toast;
+
+
+public class MainActivity extends AppCompatActivity
+ implements NavigationView.OnNavigationItemSelectedListener {
+
+ Fragment fragment = null;
+ private CharSequence mTitle;
+ SQLiteDatabase mysql;
+ String login = "";
+ String uid;
+ Bundle bundle;
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_main);
+ Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
+ setSupportActionBar(toolbar);
+ uid = getIntent().getStringExtra("UID");
+ DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
+ ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(
+ this, drawer, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close);
+ drawer.setDrawerListener(toggle);
+ toggle.syncState();
+
+ NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view);
+ navigationView.setNavigationItemSelectedListener(this);
+
+
+ //To display the Login Activity
+ fragment = new Home();
+ FragmentManager fragmentManager = getSupportFragmentManager();
+ fragmentManager.beginTransaction().replace(R.id.container, fragment).commit();
+ getSupportActionBar().setTitle("Home");
+ Toast.makeText(MainActivity.this,"****"+uid+"***",Toast.LENGTH_SHORT).show();
+ bundle=new Bundle();
+
+ bundle.putString("UID",uid);
+ }
+
+ @Override
+ public void onBackPressed() {
+ DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
+ if (drawer.isDrawerOpen(GravityCompat.START)) {
+ drawer.closeDrawer(GravityCompat.START);
+ } else {
+ backButtonHandler();
+ }
+ }
+
+ @Override
+ public boolean onCreateOptionsMenu(Menu menu) {
+ // Inflate the menu; this adds items to the action bar if it is present.
+ getMenuInflater().inflate(R.menu.main, menu);
+ return true;
+ }
+
+ @Override
+ public boolean onOptionsItemSelected(MenuItem item) {
+ // Handle action bar item clicks here. The action bar will
+ // automatically handle clicks on the Home/Up button, so long
+ // as you specify a parent activity in AndroidManifest.xml.
+ int id = item.getItemId();
+
+ //noinspection SimplifiableIfStatement
+ if (id == R.id.action_logout) {
+ finish();
+ return true;
+ }
+
+ return super.onOptionsItemSelected(item);
+ }
+
+ @SuppressWarnings("StatementWithEmptyBody")
+ @Override
+ public boolean onNavigationItemSelected(MenuItem item) {
+ // Handle navigation view item clicks here.
+ int id = item.getItemId();
+ if (id == R.id.nav_home) {
+ mTitle = "Home";
+ fragment = new Home();
+
+ } else if (id == R.id.nav_activities) {
+
+ mTitle = "Activities";
+
+ //set Fragmentclass u
+
+ fragment = new Activities();
+ fragment.setArguments(bundle);
+
+ } else if (id == R.id.nav_query) {
+ mTitle = "Queries";
+ fragment = new Queries();
+ fragment.setArguments(bundle);
+
+
+ } else if (id == R.id.nav_history) {
+ mTitle = "History";
+ fragment = new History();
+ fragment.setArguments(bundle);
+
+
+ } else if (id == R.id.nav_profile) {
+ mTitle = "My Profile";
+ fragment = new Profile();
+ fragment.setArguments(bundle);
+
+
+ } else if (id == R.id.nav_notices) {
+
+ mTitle = "Notices";
+ fragment = new Notices();
+ fragment.setArguments(bundle);
+ }
+
+ if (fragment != null) {
+
+ FragmentManager fragmentManager = getSupportFragmentManager();
+ fragmentManager.beginTransaction().replace(R.id.container, fragment).commit();
+ getSupportActionBar().setTitle(mTitle);
+ }
+
+ DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
+ drawer.closeDrawer(GravityCompat.START);
+ return true;
+ }
+
+
+ public void backButtonHandler() {
+ AlertDialog.Builder alertDialog = new AlertDialog.Builder(
+ MainActivity.this);
+ alertDialog.setTitle("Leave application?");
+ alertDialog.setMessage("Are you sure you want to leave the application?");
+
+ alertDialog.setPositiveButton("YES",
+ new DialogInterface.OnClickListener() {
+ public void onClick(DialogInterface dialog, int which) {
+ finish();
+
+ }
+ });
+ alertDialog.setNegativeButton("NO",
+ new DialogInterface.OnClickListener() {
+ public void onClick(DialogInterface dialog, int which) {
+ dialog.cancel();
+ }
+ });
+ alertDialog.show();
+ }
+
+}
diff --git a/app/src/main/java/com/example/home/dvs/Notices.java b/app/src/main/java/com/example/home/dvs/Notices.java
new file mode 100644
index 0000000..da4f4ee
--- /dev/null
+++ b/app/src/main/java/com/example/home/dvs/Notices.java
@@ -0,0 +1,177 @@
+package com.example.home.dvs;
+
+import android.app.ProgressDialog;
+import android.content.Context;
+import android.content.Intent;
+import android.os.AsyncTask;
+import android.os.Bundle;
+import android.os.StrictMode;
+import android.support.v4.app.Fragment;
+import android.support.v7.app.AlertDialog;
+import android.support.v7.app.AppCompatActivity;
+import android.util.Log;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.AdapterView;
+import android.widget.Button;
+import android.widget.ListView;
+import android.widget.SimpleAdapter;
+import android.widget.Toast;
+
+import org.apache.http.HttpEntity;
+import org.apache.http.HttpResponse;
+import org.apache.http.NameValuePair;
+import org.apache.http.StatusLine;
+import org.apache.http.client.ClientProtocolException;
+import org.apache.http.client.HttpClient;
+import org.apache.http.client.methods.HttpGet;
+import org.apache.http.client.methods.HttpPost;
+import org.apache.http.impl.client.DefaultHttpClient;
+import org.json.JSONArray;
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.net.HttpURLConnection;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+
+
+public class Notices extends Fragment {
+ ProgressDialog dialog1 = null;
+ String httpurl = "http://192.168.8.1/dvs/get_notices.php";
+
+ HttpPost httppost;
+ StringBuffer buffer;
+ HttpResponse response;
+ HttpClient httpclient;
+ List nameValuePairs;
+ protected boolean active = true;
+ protected int splashTime = 8000;
+ AlertDialog levelDialog;
+ String uid;
+ @Override
+ public void onStart() {
+ super.onStart();
+ notices();
+
+ }
+ public static Notices newInstance() {
+ Notices fragment = new Notices();
+ return fragment;
+ }
+
+ public Notices() {
+ }
+ //////////////////////////////////////////////////////////////////////////
+ @Override
+ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
+ View rootView = inflater.inflate(R.layout.fragment_notifications, container, false);
+ Bundle bundle = this.getArguments();
+ uid = bundle.getString("UID");
+ return rootView;
+ }
+
+ //////////////////////////////////////////////////////////////////////////
+ private void notices() {
+
+ if (android.os.Build.VERSION.SDK_INT > 9) {
+ StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build();
+ StrictMode.setThreadPolicy(policy);
+ }
+
+ final ListView lisView1 = (ListView)getActivity().findViewById(R.id.listView1);
+ String url = httpurl;
+
+ try {
+
+ JSONArray data = new JSONArray(getJSONUrl(url));
+
+ final ArrayList> MyArrList = new ArrayList>();
+ HashMap map;
+
+ for(int i = 0; i < data.length(); i++) {
+ JSONObject c = data.getJSONObject(i);
+
+ map = new HashMap();
+ if (c.getString("To_id").equals(uid)) {
+ //new notifications in All Notifications
+
+ map.put("put_ntitle",c.getString("Title") );
+ map.put("put_ntime", c.getString("Time"));
+ map.put("put_nbody", c.getString("Body"));
+ MyArrList.add(map);
+
+ }
+ }
+
+ SimpleAdapter sAdap;
+ sAdap = new SimpleAdapter(getActivity(), MyArrList, R.layout.activity_column,
+ new String[] {"put_ntitle","put_ntime"}, new int[] { R.id.ColTitle,R.id.ColTime});
+ lisView1.setAdapter(sAdap);
+
+ final AlertDialog.Builder viewDetail = new AlertDialog.Builder(getActivity());
+ // OnClick Item
+ lisView1.setOnItemClickListener(new AdapterView.OnItemClickListener() {
+ public void onItemClick(AdapterView> myAdapter, View myView,
+ int position, long mylng) {
+
+ String sTime = MyArrList.get(position).get("put_ntime").toString();
+
+ String sNotifi_Title = MyArrList.get(position).get("put_ntitle").toString();
+
+ String sNotification = MyArrList.get(position).get("put_nbody").toString();
+
+
+ //String sAttachments = MyArrList.get(position).get("put_attachments").toString();
+
+
+ Intent var = new Intent("com.example.rgukt.infra.NOTIFICATION_DETAILS");
+ var.putExtra("not_title",sNotifi_Title);
+ var.putExtra("not_body",sNotification);
+ var.putExtra("not_time", sTime);
+ startActivity(var);
+ }
+
+ });
+ } catch (JSONException e) {
+ e.printStackTrace();
+ }
+ }
+
+
+//////////////////////////////////////////////////////////////////////////
+ private String getJSONUrl(String url) {
+ StringBuilder str = new StringBuilder();
+ HttpClient client = new DefaultHttpClient();
+ HttpGet httpGet = new HttpGet(url);
+ try {
+ HttpResponse response = client.execute(httpGet);
+ StatusLine statusLine = response.getStatusLine();
+ int statusCode = statusLine.getStatusCode();
+ if (statusCode == 200) {
+ HttpEntity entity = response.getEntity();
+ InputStream content = entity.getContent();
+ BufferedReader reader = new BufferedReader(new InputStreamReader(content));
+ String line;
+ while ((line = reader.readLine()) != null) {
+ str.append(line);
+ }
+ } else {
+ Log.e("Log", "Failed to download result..");
+ }
+ } catch (ClientProtocolException e) {
+ e.printStackTrace();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ return str.toString();
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/example/home/dvs/Notification_Details.java b/app/src/main/java/com/example/home/dvs/Notification_Details.java
new file mode 100644
index 0000000..f71b932
--- /dev/null
+++ b/app/src/main/java/com/example/home/dvs/Notification_Details.java
@@ -0,0 +1,85 @@
+package com.example.home.dvs;
+
+import android.os.AsyncTask;
+import android.os.Bundle;
+import android.os.Environment;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.InputStream;
+import java.net.HttpURLConnection;
+import java.net.URL;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import android.app.Activity;
+import android.app.Dialog;
+import android.app.ProgressDialog;
+import android.content.DialogInterface;
+import android.content.Intent;
+import android.text.Html;
+import android.text.method.LinkMovementMethod;
+import android.util.Log;
+import android.view.Menu;
+import android.view.View;
+import android.view.View.OnClickListener;
+import android.webkit.WebView;
+import android.widget.Button;
+import android.widget.TextView;
+import android.widget.Toast;
+
+import org.w3c.dom.Text;
+
+public class Notification_Details extends Activity {
+
+
+ String title,time,body;
+ TextView tv_title,tv_time,tv_body;
+ Button downloads;
+
+ String status;
+ int st;
+ public static final String LOG_TAG = "File-Path";
+ private ProgressDialog mProgressDialog;
+ public static final int DIALOG_DOWNLOAD_PROGRESS = 0;
+
+ //initialize root directory
+ File rootDir = Environment.getExternalStorageDirectory();
+
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState)
+ {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.notification_details);
+
+
+ //downloads = (Button) findViewById(R.id.attach);
+ title = getIntent().getStringExtra("not_title");
+
+ time = getIntent().getStringExtra("not_time");
+ body = getIntent().getStringExtra("not_body");
+
+ tv_title = (TextView)findViewById(R.id.title);
+
+ tv_time = (TextView)findViewById(R.id.time );
+
+ tv_body = (TextView)findViewById(R.id.body);
+
+ tv_title.setText(title);
+ tv_time.setText(time);
+ tv_body.setText(body);
+
+ }
+
+
+ @Override
+ public void onBackPressed()
+ {
+ finish();
+ return;
+ }
+
+
+
+}
diff --git a/app/src/main/java/com/example/home/dvs/Profile.java b/app/src/main/java/com/example/home/dvs/Profile.java
new file mode 100644
index 0000000..b440836
--- /dev/null
+++ b/app/src/main/java/com/example/home/dvs/Profile.java
@@ -0,0 +1,288 @@
+package com.example.home.dvs;
+
+import android.app.ProgressDialog;
+import android.content.Context;
+import android.database.Cursor;
+import android.database.sqlite.SQLiteDatabase;
+import android.os.AsyncTask;
+import android.os.Bundle;
+import android.os.StrictMode;
+import android.support.v4.app.Fragment;
+import android.support.v7.app.AppCompatActivity;
+import android.util.Log;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.Button;
+import android.widget.TextView;
+import android.widget.Toast;
+
+import org.apache.http.HttpEntity;
+import org.apache.http.HttpResponse;
+import org.apache.http.StatusLine;
+import org.apache.http.client.ClientProtocolException;
+import org.apache.http.client.HttpClient;
+import org.apache.http.client.methods.HttpGet;
+import org.apache.http.impl.client.DefaultHttpClient;
+import org.json.JSONArray;
+import org.json.JSONObject;
+import org.w3c.dom.Text;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.net.HttpURLConnection;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.HashMap;
+
+
+public class Profile extends Fragment {
+
+ String httpurl = "192.168.8.1/dvs/user_details.php";
+ public static final int CONNECTION_TIMEOUT = 10000;
+ public static final int READ_TIMEOUT = 15000;
+ public static int Array_size = 0;
+ private View mainView;
+
+ String userID;
+ SQLiteDatabase mysql;
+ TextView t1,t2,t3,t4,t5;
+ public static Profile newInstance() {
+ Profile fragment = new Profile();
+ return fragment;
+ }
+
+ public Profile() {
+ }
+
+ @Override
+ public void onStart() {
+ super.onStart();
+ mysql = getActivity().openOrCreateDatabase("Login", Context.MODE_PRIVATE, null);
+ //userID = getuserID();
+
+ AppCompatActivity activity = (AppCompatActivity) getActivity();
+ activity.getSupportActionBar().setTitle("Profile");
+ profile();
+
+ //new AsyncRetrieve().execute();
+ }
+
+ /**
+
+ */
+
+ @Override
+ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
+ View rootView = inflater.inflate(R.layout.profile, container, false);
+ Bundle bundle = this.getArguments();
+ userID = bundle.getString("UID");
+ t1 = (TextView)getActivity().findViewById(R.id.name);
+ t2 = (TextView)getActivity().findViewById(R.id.adhaar);
+ t3 = (TextView)getActivity().findViewById(R.id.mail);
+ t4 = (TextView)getActivity().findViewById(R.id.phno);
+ t5 = (TextView)getActivity().findViewById(R.id.adds);
+
+ return rootView;
+ }
+
+ public String getuserID() {
+
+ String rowid = "UNAME";
+ String sno = "SNO";
+ String name = "PNAME";
+ String pass = "PASSWD";
+ String[] columns = new String[]{sno, rowid, name, pass};
+ Cursor cursor = mysql.query("profile", columns, null, null, null, null, null);
+
+ String id = "";
+ String uname = "";
+
+ int irow = cursor.getColumnIndex(rowid);
+
+ for (cursor.moveToFirst(); !cursor.isAfterLast(); cursor.moveToNext()) {
+ id = id + cursor.getString(irow);
+ uname = uname + cursor.getString(irow);
+ }
+ //String uname = mysql.execSQL("SELECT UNAME FROM profile WHERE SNO=10;");
+
+ return id;
+ }
+
+ private class AsyncRetrieve extends AsyncTask {
+ ProgressDialog pdLoading = new ProgressDialog(getActivity());
+ HttpURLConnection conn;
+ URL url = null;
+
+ //this method will interact with UI, here display loading message
+ @Override
+ protected void onPreExecute() {
+ super.onPreExecute();
+
+ pdLoading.setMessage("\tLoading...");
+ pdLoading.setCancelable(false);
+ pdLoading.show();
+
+ }
+
+ // This method does not interact with UI, You need to pass result to onPostExecute to display
+ @Override
+ protected String doInBackground(String... params) {
+ try {
+ // Enter URL address where your php file resides
+ url = new URL("http://192.168.8.1/dvs/CheckConnection.php");
+
+ } catch (MalformedURLException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ return e.toString();
+ }
+ try {
+
+ // Setup HttpURLConnection class to send and receive data from php and mysql
+ conn = (HttpURLConnection) url.openConnection();
+ conn.setReadTimeout(READ_TIMEOUT);
+ conn.setConnectTimeout(CONNECTION_TIMEOUT);
+ conn.setRequestMethod("GET");
+
+ // setDoOutput to true as we recieve data from json file
+ conn.setDoOutput(true);
+
+ } catch (IOException e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ return e1.toString();
+ }
+
+ try {
+
+ int response_code = conn.getResponseCode();
+
+ // Check if successful connection made
+ if (response_code == HttpURLConnection.HTTP_OK) {
+
+ // Read data sent from server
+ InputStream input = conn.getInputStream();
+ BufferedReader reader = new BufferedReader(new InputStreamReader(input));
+ StringBuilder result = new StringBuilder();
+ String line;
+
+ while ((line = reader.readLine()) != null) {
+ result.append(line);
+ }
+
+ // Pass data to onPostExecute method
+ return (result.toString());
+
+ } else {
+
+ return ("unsuccessful");
+ }
+
+ } catch (IOException e) {
+ e.printStackTrace();
+ return e.toString();
+ } finally {
+ conn.disconnect();
+ }
+
+
+ }
+
+
+ // this method will interact with UI, display result sent from doInBackground method
+ @Override
+ protected void onPostExecute(String result) {
+
+ pdLoading.dismiss();
+ if (result.equals("connection success")) {
+ //notices();
+ } else {
+ // you to understand error returned from doInBackground method
+ Toast.makeText(getActivity(), "CHECK YOUR NETWORK", Toast.LENGTH_LONG).show();
+
+ }
+
+ }
+
+ }
+
+ public void profile() {
+ if (android.os.Build.VERSION.SDK_INT > 9) {
+ StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build();
+ StrictMode.setThreadPolicy(policy);
+ }
+
+
+ String url = httpurl;
+
+ try {
+
+ JSONArray data = new JSONArray(getJSONUrl(url));
+
+ final ArrayList> MyArrList = new ArrayList>();
+ HashMap map;
+
+ for (int i = 0; i < data.length(); i++) {
+ JSONObject c = data.getJSONObject(i);
+
+ map = new HashMap();
+
+ if (c.getString("UID").equals(userID)) {
+ map.put("put_name", c.getString("U_name"));
+ map.put("put_adhaar", c.getString("U_ahaar"));
+ map.put("put_phno", c.getString("U_phno"));
+ map.put("put_email", c.getString("U_email"));
+ map.put("put_age", c.getString("U_age"));
+ map.put("put_dob", c.getString("U_dob"));
+ map.put("put_add", c.getString("Adress"));
+ MyArrList.add(map);
+
+ Toast.makeText(getActivity(),"***Details came**",Toast.LENGTH_SHORT);
+ }
+
+ }
+
+ t1.setText(MyArrList.get(0).get("put_name").toString());
+ t2.setText(MyArrList.get(0).get("put_adhaar").toString());
+ t3.setText(MyArrList.get(0).get("put_email").toString());
+ t4.setText(MyArrList.get(0).get("put_phno").toString());
+ t5.setText(MyArrList.get(0).get("put_add").toString());
+
+ }
+ catch (Exception e)
+ {
+
+ };
+ }
+
+ private String getJSONUrl(String url) {
+ StringBuilder str = new StringBuilder();
+ HttpClient client = new DefaultHttpClient();
+ HttpGet httpGet = new HttpGet(url);
+ try {
+ HttpResponse response = client.execute(httpGet);
+ StatusLine statusLine = response.getStatusLine();
+ int statusCode = statusLine.getStatusCode();
+ if (statusCode == 200) {
+ HttpEntity entity = response.getEntity();
+ InputStream content = entity.getContent();
+ BufferedReader reader = new BufferedReader(new InputStreamReader(content));
+ String line;
+ while ((line = reader.readLine()) != null) {
+ str.append(line);
+ }
+ } else {
+ Log.e("Log", "Failed to download result..");
+ }
+ } catch (ClientProtocolException e) {
+ e.printStackTrace();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ return str.toString();
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/example/home/dvs/Queries.java b/app/src/main/java/com/example/home/dvs/Queries.java
new file mode 100644
index 0000000..d90c3a0
--- /dev/null
+++ b/app/src/main/java/com/example/home/dvs/Queries.java
@@ -0,0 +1,60 @@
+package com.example.home.dvs;
+
+import android.os.Bundle;
+import android.support.v4.app.Fragment;
+import android.support.v7.app.AppCompatActivity;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.Button;
+
+
+public class Queries extends Fragment {
+
+ //View variables
+ Button postProblem;
+ Button status;
+
+ public static Queries newInstance() {
+ Queries fragment = new Queries();
+ return fragment;
+ }
+
+ public Queries() {
+ }
+
+ @Override
+ public void onStart() {
+ super.onStart();
+
+ AppCompatActivity activity = (AppCompatActivity) getActivity();
+ activity.getSupportActionBar().setTitle("Queries");
+
+
+
+
+ }
+
+ /**
+ * Updates the status on the action bar.
+ *
+ */
+ private void setTitle(CharSequence title) {
+ AppCompatActivity activity = (AppCompatActivity) getActivity();
+ if (null == activity) {
+ return;
+ }
+ if (null == activity.getSupportActionBar()) {
+ return;
+ }
+ activity.getSupportActionBar().setTitle(title);
+ }
+
+
+ @Override
+ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
+ View rootView = inflater.inflate(R.layout.quries, container, false);
+ return rootView;
+ }
+
+}
diff --git a/app/src/main/java/com/example/home/dvs/Splash.java b/app/src/main/java/com/example/home/dvs/Splash.java
new file mode 100644
index 0000000..3b1ce0e
--- /dev/null
+++ b/app/src/main/java/com/example/home/dvs/Splash.java
@@ -0,0 +1,83 @@
+package com.example.home.dvs;
+
+import android.content.Intent;
+
+
+ import android.app.Activity;
+ import android.content.Context;
+ import android.content.Intent;
+ import android.database.Cursor;
+ import android.database.sqlite.SQLiteDatabase;
+ import android.os.Bundle;
+
+/**
+ * Created by Looser on j1-02-2017.
+ */
+
+public class Splash extends Activity {
+
+ SQLiteDatabase mysql;
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.splash);
+ mysql = openOrCreateDatabase("Login", Context.MODE_PRIVATE, null);
+ mysql.execSQL("CREATE TABLE IF NOT EXISTS profile(SNO int,UNAME varchar(30),PNAME varchar(30),PASSWD varchar(30));");
+ Thread timer = new Thread() {
+ @Override
+ public void run() {
+ try {
+ sleep(4000);
+ } catch (Exception e) {
+ e.printStackTrace();
+ } finally {
+
+ //if(checkLogin()){
+
+ Intent m = new Intent(Splash.this,Login.class);
+ startActivity(m);
+ // }
+ /* else
+ {
+ Intent m = new Intent(Splash.this,MainActivity.class);
+ startActivity(m);
+ }*/
+ finish();
+ }
+ }
+ };
+
+ timer.start();
+
+
+ }
+
+ public boolean checkLogin() {
+
+ String rowid = "UNAME";
+ String sno = "SNO";
+ String name = "PNAME";
+ String pass = "PASSWD";
+ String[] columns = new String[]{sno, rowid, name, pass};
+ Cursor cursor = mysql.query("profile", columns, null, null, null, null, null);
+
+ String result = "";
+
+ int irow = cursor.getColumnIndex(rowid);
+
+ for (cursor.moveToFirst(); !cursor.isAfterLast(); cursor.moveToNext()) {
+ result = result + cursor.getString(irow);
+ }
+
+ if (result.equals("")) {
+ return true;
+ } else {
+ return false;
+ }
+ //String uname = mysql.execSQL("SELECT UNAME FROM profile WHERE SNO=10;");
+
+
+ }
+
+}
diff --git a/app/src/main/java/com/example/home/dvs/Voting.java b/app/src/main/java/com/example/home/dvs/Voting.java
new file mode 100644
index 0000000..50b5c42
--- /dev/null
+++ b/app/src/main/java/com/example/home/dvs/Voting.java
@@ -0,0 +1,167 @@
+package com.example.home.dvs;
+
+import android.content.Context;
+import android.content.Intent;
+import android.os.Bundle;
+import android.os.StrictMode;
+import android.support.annotation.Nullable;
+import android.support.v7.app.ActionBar;
+import android.support.v7.app.AppCompatActivity;
+import android.util.Log;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.widget.AdapterView;
+import android.widget.GridView;
+import android.widget.LinearLayout;
+import android.widget.ListView;
+import android.widget.RelativeLayout;
+import android.widget.SimpleAdapter;
+import android.widget.TextView;
+import android.widget.Toast;
+import android.widget.ViewFlipper;
+
+import org.apache.http.HttpEntity;
+import org.apache.http.HttpResponse;
+import org.apache.http.StatusLine;
+import org.apache.http.client.ClientProtocolException;
+import org.apache.http.client.HttpClient;
+import org.apache.http.client.methods.HttpGet;
+import org.apache.http.impl.client.DefaultHttpClient;
+import org.json.JSONArray;
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.util.ArrayList;
+import java.util.HashMap;
+
+/**
+ * Created by home on 3/25/2017.
+ */
+
+public class Voting extends AppCompatActivity {
+ ViewFlipper vf;
+ final ArrayList> MyArrList = new ArrayList>();
+ HashMap map;
+ String id, title,uid;
+ ListView l1;
+
+ @Override
+ protected void onCreate(@Nullable Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.voting_area);
+ id = getIntent().getStringExtra("act_id");
+ title = getIntent().getStringExtra("act_title");
+ uid = getIntent().getStringExtra("UID");
+
+ TextView t = (TextView) findViewById(R.id.Vtitle);
+ t.setText(title+"\n"+"select your Nominee ");
+ get_data();
+ }
+public void get_data() {
+ if (android.os.Build.VERSION.SDK_INT > 9) {
+ StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build();
+ StrictMode.setThreadPolicy(policy);
+ }
+
+ final ListView lisView1 = (ListView) findViewById(R.id.nomi_list);
+
+
+ String url = "http://192.168.8.1/dvs/get_Nominee_details.php";
+ try {
+
+ JSONArray data = new JSONArray(getJSONUrl(url));
+
+ final ArrayList> MyArrList = new ArrayList>();
+ HashMap map;
+
+ for (int i = 0; i < data.length(); i++) {
+ JSONObject c = data.getJSONObject(i);
+
+ map = new HashMap();
+ if (c.getString("E_id").equals(id)) {
+
+ map.put("put_nid", c.getString("N_id"));
+ map.put("put_nname", c.getString("N_name"));
+ map.put("put_nage", c.getString("N_age"));
+ map.put("put_ndata", c.getString("N_data"));
+ map.put("put_nprty", c.getString("N_prty"));
+ map.put("put_nsymbol", c.getString("N_symbol"));
+ MyArrList.add(map);
+
+ }
+ }
+
+ SimpleAdapter sAdap;
+ sAdap = new SimpleAdapter(this, MyArrList, R.layout.nominee_list,
+ new String[]{"put_nname", "put_nprty"}, new int[]{R.id.ac_title, R.id.ac_mode});
+ lisView1.setAdapter(sAdap);
+ lisView1.setOnItemClickListener(new AdapterView.OnItemClickListener() {
+ public void onItemClick(AdapterView> myAdapter, View myView,
+ int position, long mylng) {
+
+ String name = MyArrList.get(position).get("put_nname").toString();
+
+ String age = MyArrList.get(position).get("put_nage").toString();
+
+ String nid = MyArrList.get(position).get("put_nid").toString();
+
+ String ndata = MyArrList.get(position).get("put_ndata").toString();
+
+ String party = MyArrList.get(position).get("put_nprty").toString();
+
+ String symbol = MyArrList.get(position).get("put_nsymbol").toString();
+
+ //String sAttachments = MyArrList.get(position).get("put_attachments").toString();
+
+
+ Intent var = new Intent("android.intent.action.CONFIRM_VOTE");
+ var.putExtra("nomi_name",name);
+ var.putExtra("nomi_age",age);
+ var.putExtra("nomi_id",nid);
+ var.putExtra("nomi_ndata",ndata);
+ var.putExtra("nomi_party",party);
+ var.putExtra("nomi_symbol",symbol);
+ var.putExtra("act_id",id);
+ var.putExtra("act_title",title);
+ var.putExtra("UID",uid);
+ // var.putExtra("files", sAttachments);
+ startActivity(var);
+
+ }
+
+ });
+ } catch (JSONException j) {
+ j.printStackTrace();
+ }
+}
+ private String getJSONUrl(String url) {
+ StringBuilder str = new StringBuilder();
+ HttpClient client = new DefaultHttpClient();
+ HttpGet httpGet = new HttpGet(url);
+ try {
+ HttpResponse response = client.execute(httpGet);
+ StatusLine statusLine = response.getStatusLine();
+ int statusCode = statusLine.getStatusCode();
+ if (statusCode == 200) {
+ HttpEntity entity = response.getEntity();
+ InputStream content = entity.getContent();
+ BufferedReader reader = new BufferedReader(new InputStreamReader(content));
+ String line;
+ while ((line = reader.readLine()) != null) {
+ str.append(line);
+ }
+ } else {
+ Log.e("Log", "Failed to download result..");
+ }
+ } catch (ClientProtocolException e) {
+ e.printStackTrace();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ return str.toString();
+}
+}
\ No newline at end of file
diff --git a/app/src/main/res/drawable-hdpi/ic_action_com.png b/app/src/main/res/drawable-hdpi/ic_action_com.png
new file mode 100644
index 0000000..aa1f684
Binary files /dev/null and b/app/src/main/res/drawable-hdpi/ic_action_com.png differ
diff --git a/app/src/main/res/drawable-hdpi/ic_action_histo.png b/app/src/main/res/drawable-hdpi/ic_action_histo.png
new file mode 100644
index 0000000..cedf09f
Binary files /dev/null and b/app/src/main/res/drawable-hdpi/ic_action_histo.png differ
diff --git a/app/src/main/res/drawable-hdpi/ic_action_home.png b/app/src/main/res/drawable-hdpi/ic_action_home.png
new file mode 100644
index 0000000..4e97c0c
Binary files /dev/null and b/app/src/main/res/drawable-hdpi/ic_action_home.png differ
diff --git a/app/src/main/res/drawable-hdpi/ic_action_name.png b/app/src/main/res/drawable-hdpi/ic_action_name.png
new file mode 100644
index 0000000..1c616b2
Binary files /dev/null and b/app/src/main/res/drawable-hdpi/ic_action_name.png differ
diff --git a/app/src/main/res/drawable-mdpi/ic_action_com.png b/app/src/main/res/drawable-mdpi/ic_action_com.png
new file mode 100644
index 0000000..70dabf5
Binary files /dev/null and b/app/src/main/res/drawable-mdpi/ic_action_com.png differ
diff --git a/app/src/main/res/drawable-mdpi/ic_action_histo.png b/app/src/main/res/drawable-mdpi/ic_action_histo.png
new file mode 100644
index 0000000..6b9a7e5
Binary files /dev/null and b/app/src/main/res/drawable-mdpi/ic_action_histo.png differ
diff --git a/app/src/main/res/drawable-mdpi/ic_action_home.png b/app/src/main/res/drawable-mdpi/ic_action_home.png
new file mode 100644
index 0000000..dab4b70
Binary files /dev/null and b/app/src/main/res/drawable-mdpi/ic_action_home.png differ
diff --git a/app/src/main/res/drawable-mdpi/ic_action_name.png b/app/src/main/res/drawable-mdpi/ic_action_name.png
new file mode 100644
index 0000000..26c2c97
Binary files /dev/null and b/app/src/main/res/drawable-mdpi/ic_action_name.png differ
diff --git a/app/src/main/res/drawable-xhdpi/ic_action_com.png b/app/src/main/res/drawable-xhdpi/ic_action_com.png
new file mode 100644
index 0000000..5174c6f
Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_action_com.png differ
diff --git a/app/src/main/res/drawable-xhdpi/ic_action_histo.png b/app/src/main/res/drawable-xhdpi/ic_action_histo.png
new file mode 100644
index 0000000..7e76692
Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_action_histo.png differ
diff --git a/app/src/main/res/drawable-xhdpi/ic_action_home.png b/app/src/main/res/drawable-xhdpi/ic_action_home.png
new file mode 100644
index 0000000..b46aea6
Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_action_home.png differ
diff --git a/app/src/main/res/drawable-xhdpi/ic_action_name.png b/app/src/main/res/drawable-xhdpi/ic_action_name.png
new file mode 100644
index 0000000..7498587
Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_action_name.png differ
diff --git a/app/src/main/res/drawable-xxhdpi/ic_action_com.png b/app/src/main/res/drawable-xxhdpi/ic_action_com.png
new file mode 100644
index 0000000..17b7026
Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_action_com.png differ
diff --git a/app/src/main/res/drawable-xxhdpi/ic_action_histo.png b/app/src/main/res/drawable-xxhdpi/ic_action_histo.png
new file mode 100644
index 0000000..a0f0538
Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_action_histo.png differ
diff --git a/app/src/main/res/drawable-xxhdpi/ic_action_home.png b/app/src/main/res/drawable-xxhdpi/ic_action_home.png
new file mode 100644
index 0000000..28a4277
Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_action_home.png differ
diff --git a/app/src/main/res/drawable-xxhdpi/ic_action_name.png b/app/src/main/res/drawable-xxhdpi/ic_action_name.png
new file mode 100644
index 0000000..23ea5c5
Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_action_name.png differ
diff --git a/app/src/main/res/drawable/bell.png b/app/src/main/res/drawable/bell.png
new file mode 100644
index 0000000..616415e
Binary files /dev/null and b/app/src/main/res/drawable/bell.png differ
diff --git a/app/src/main/res/drawable/butt_four.xml b/app/src/main/res/drawable/butt_four.xml
new file mode 100644
index 0000000..8fb5f09
--- /dev/null
+++ b/app/src/main/res/drawable/butt_four.xml
@@ -0,0 +1,7 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/drawable/butt_one.xml b/app/src/main/res/drawable/butt_one.xml
new file mode 100644
index 0000000..7174027
--- /dev/null
+++ b/app/src/main/res/drawable/butt_one.xml
@@ -0,0 +1,7 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/drawable/butt_three.xml b/app/src/main/res/drawable/butt_three.xml
new file mode 100644
index 0000000..8fb5f09
--- /dev/null
+++ b/app/src/main/res/drawable/butt_three.xml
@@ -0,0 +1,7 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/drawable/butt_two.xml b/app/src/main/res/drawable/butt_two.xml
new file mode 100644
index 0000000..a15f5f0
--- /dev/null
+++ b/app/src/main/res/drawable/butt_two.xml
@@ -0,0 +1,7 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/drawable/dgi.png b/app/src/main/res/drawable/dgi.png
new file mode 100644
index 0000000..b78017d
Binary files /dev/null and b/app/src/main/res/drawable/dgi.png differ
diff --git a/app/src/main/res/drawable/dvs.jpg b/app/src/main/res/drawable/dvs.jpg
new file mode 100644
index 0000000..4256d5d
Binary files /dev/null and b/app/src/main/res/drawable/dvs.jpg differ
diff --git a/app/src/main/res/drawable/edit_text.xml b/app/src/main/res/drawable/edit_text.xml
new file mode 100644
index 0000000..354d6ff
--- /dev/null
+++ b/app/src/main/res/drawable/edit_text.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
diff --git a/app/src/main/res/drawable/edit_text2.xml b/app/src/main/res/drawable/edit_text2.xml
new file mode 100644
index 0000000..573e2fd
--- /dev/null
+++ b/app/src/main/res/drawable/edit_text2.xml
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
diff --git a/app/src/main/res/drawable/iccc.png b/app/src/main/res/drawable/iccc.png
new file mode 100644
index 0000000..02e6ee9
Binary files /dev/null and b/app/src/main/res/drawable/iccc.png differ
diff --git a/app/src/main/res/drawable/j1.jpg b/app/src/main/res/drawable/j1.jpg
new file mode 100644
index 0000000..650afa2
Binary files /dev/null and b/app/src/main/res/drawable/j1.jpg differ
diff --git a/app/src/main/res/drawable/j2.jpg b/app/src/main/res/drawable/j2.jpg
new file mode 100644
index 0000000..8357343
Binary files /dev/null and b/app/src/main/res/drawable/j2.jpg differ
diff --git a/app/src/main/res/drawable/j3.jpg b/app/src/main/res/drawable/j3.jpg
new file mode 100644
index 0000000..1b37551
Binary files /dev/null and b/app/src/main/res/drawable/j3.jpg differ
diff --git a/app/src/main/res/drawable/j4.jpg b/app/src/main/res/drawable/j4.jpg
new file mode 100644
index 0000000..bd46b79
Binary files /dev/null and b/app/src/main/res/drawable/j4.jpg differ
diff --git a/app/src/main/res/drawable/pic.png b/app/src/main/res/drawable/pic.png
new file mode 100644
index 0000000..f67b6ca
Binary files /dev/null and b/app/src/main/res/drawable/pic.png differ
diff --git a/app/src/main/res/drawable/sbutton.xml b/app/src/main/res/drawable/sbutton.xml
new file mode 100644
index 0000000..2708089
--- /dev/null
+++ b/app/src/main/res/drawable/sbutton.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
diff --git a/app/src/main/res/drawable/side_nav_bar.xml b/app/src/main/res/drawable/side_nav_bar.xml
new file mode 100644
index 0000000..32a864b
--- /dev/null
+++ b/app/src/main/res/drawable/side_nav_bar.xml
@@ -0,0 +1,9 @@
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/abouus.xml b/app/src/main/res/layout/abouus.xml
new file mode 100644
index 0000000..a8f7795
--- /dev/null
+++ b/app/src/main/res/layout/abouus.xml
@@ -0,0 +1,39 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/layout/activity_column.xml b/app/src/main/res/layout/activity_column.xml
new file mode 100644
index 0000000..ec277d7
--- /dev/null
+++ b/app/src/main/res/layout/activity_column.xml
@@ -0,0 +1,50 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/layout/activity_details.xml b/app/src/main/res/layout/activity_details.xml
new file mode 100644
index 0000000..96f72b6
--- /dev/null
+++ b/app/src/main/res/layout/activity_details.xml
@@ -0,0 +1,119 @@
+
+
+
+
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml
new file mode 100644
index 0000000..f7acf49
--- /dev/null
+++ b/app/src/main/res/layout/activity_main.xml
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/layout/app_bar_main.xml b/app/src/main/res/layout/app_bar_main.xml
new file mode 100644
index 0000000..fa3c2b3
--- /dev/null
+++ b/app/src/main/res/layout/app_bar_main.xml
@@ -0,0 +1,27 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/layout/fragment_notifications.xml b/app/src/main/res/layout/fragment_notifications.xml
new file mode 100644
index 0000000..402cb76
--- /dev/null
+++ b/app/src/main/res/layout/fragment_notifications.xml
@@ -0,0 +1,34 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/layout/history.xml b/app/src/main/res/layout/history.xml
new file mode 100644
index 0000000..87b5375
--- /dev/null
+++ b/app/src/main/res/layout/history.xml
@@ -0,0 +1,33 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/history_model.xml b/app/src/main/res/layout/history_model.xml
new file mode 100644
index 0000000..f476709
--- /dev/null
+++ b/app/src/main/res/layout/history_model.xml
@@ -0,0 +1,33 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/home.xml b/app/src/main/res/layout/home.xml
new file mode 100644
index 0000000..1ff77ca
--- /dev/null
+++ b/app/src/main/res/layout/home.xml
@@ -0,0 +1,45 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/layout/login.xml b/app/src/main/res/layout/login.xml
new file mode 100644
index 0000000..ecf5e73
--- /dev/null
+++ b/app/src/main/res/layout/login.xml
@@ -0,0 +1,67 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/layout/model_active.xml b/app/src/main/res/layout/model_active.xml
new file mode 100644
index 0000000..4e84a26
--- /dev/null
+++ b/app/src/main/res/layout/model_active.xml
@@ -0,0 +1,41 @@
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/layout/my_activities.xml b/app/src/main/res/layout/my_activities.xml
new file mode 100644
index 0000000..3fc40d7
--- /dev/null
+++ b/app/src/main/res/layout/my_activities.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/layout/nav_header_main.xml b/app/src/main/res/layout/nav_header_main.xml
new file mode 100644
index 0000000..862f455
--- /dev/null
+++ b/app/src/main/res/layout/nav_header_main.xml
@@ -0,0 +1,35 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/layout/no_notices.xml b/app/src/main/res/layout/no_notices.xml
new file mode 100644
index 0000000..f083e92
--- /dev/null
+++ b/app/src/main/res/layout/no_notices.xml
@@ -0,0 +1,12 @@
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/nominee_list.xml b/app/src/main/res/layout/nominee_list.xml
new file mode 100644
index 0000000..d3e7f06
--- /dev/null
+++ b/app/src/main/res/layout/nominee_list.xml
@@ -0,0 +1,40 @@
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/layout/nominee_model.xml b/app/src/main/res/layout/nominee_model.xml
new file mode 100644
index 0000000..e66d9ff
--- /dev/null
+++ b/app/src/main/res/layout/nominee_model.xml
@@ -0,0 +1,103 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/note_details.xml b/app/src/main/res/layout/note_details.xml
new file mode 100644
index 0000000..7fceb77
--- /dev/null
+++ b/app/src/main/res/layout/note_details.xml
@@ -0,0 +1,125 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/notification_details.xml b/app/src/main/res/layout/notification_details.xml
new file mode 100644
index 0000000..64e02a0
--- /dev/null
+++ b/app/src/main/res/layout/notification_details.xml
@@ -0,0 +1,115 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/profile.xml b/app/src/main/res/layout/profile.xml
new file mode 100644
index 0000000..654cbd1
--- /dev/null
+++ b/app/src/main/res/layout/profile.xml
@@ -0,0 +1,125 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/quries.xml b/app/src/main/res/layout/quries.xml
new file mode 100644
index 0000000..0bf670f
--- /dev/null
+++ b/app/src/main/res/layout/quries.xml
@@ -0,0 +1,40 @@
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/layout/splash.xml b/app/src/main/res/layout/splash.xml
new file mode 100644
index 0000000..a1db554
--- /dev/null
+++ b/app/src/main/res/layout/splash.xml
@@ -0,0 +1,33 @@
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/layout/voting_area.xml b/app/src/main/res/layout/voting_area.xml
new file mode 100644
index 0000000..67810ac
--- /dev/null
+++ b/app/src/main/res/layout/voting_area.xml
@@ -0,0 +1,34 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/menu/activity_main_drawer.xml b/app/src/main/res/menu/activity_main_drawer.xml
new file mode 100644
index 0000000..6e64117
--- /dev/null
+++ b/app/src/main/res/menu/activity_main_drawer.xml
@@ -0,0 +1,37 @@
+
+
diff --git a/app/src/main/res/menu/main.xml b/app/src/main/res/menu/main.xml
new file mode 100644
index 0000000..aafd0ab
--- /dev/null
+++ b/app/src/main/res/menu/main.xml
@@ -0,0 +1,9 @@
+
+
+
+
diff --git a/app/src/main/res/mipmap-hdpi/ic_home.png b/app/src/main/res/mipmap-hdpi/ic_home.png
new file mode 100644
index 0000000..e925018
Binary files /dev/null and b/app/src/main/res/mipmap-hdpi/ic_home.png differ
diff --git a/app/src/main/res/mipmap-hdpi/ic_iasdfa.png b/app/src/main/res/mipmap-hdpi/ic_iasdfa.png
new file mode 100644
index 0000000..e9f22d9
Binary files /dev/null and b/app/src/main/res/mipmap-hdpi/ic_iasdfa.png differ
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..fb9989b
Binary files /dev/null and b/app/src/main/res/mipmap-hdpi/ic_launcher.png differ
diff --git a/app/src/main/res/mipmap-hdpi/ic_logo.png b/app/src/main/res/mipmap-hdpi/ic_logo.png
new file mode 100644
index 0000000..dc3e04a
Binary files /dev/null and b/app/src/main/res/mipmap-hdpi/ic_logo.png differ
diff --git a/app/src/main/res/mipmap-hdpi/ic_logog.png b/app/src/main/res/mipmap-hdpi/ic_logog.png
new file mode 100644
index 0000000..f74afa7
Binary files /dev/null and b/app/src/main/res/mipmap-hdpi/ic_logog.png differ
diff --git a/app/src/main/res/mipmap-mdpi/ic_home.png b/app/src/main/res/mipmap-mdpi/ic_home.png
new file mode 100644
index 0000000..aef5669
Binary files /dev/null and b/app/src/main/res/mipmap-mdpi/ic_home.png differ
diff --git a/app/src/main/res/mipmap-mdpi/ic_iasdfa.png b/app/src/main/res/mipmap-mdpi/ic_iasdfa.png
new file mode 100644
index 0000000..5620235
Binary files /dev/null and b/app/src/main/res/mipmap-mdpi/ic_iasdfa.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..f721d0a
Binary files /dev/null and b/app/src/main/res/mipmap-mdpi/ic_launcher.png differ
diff --git a/app/src/main/res/mipmap-mdpi/ic_logo.png b/app/src/main/res/mipmap-mdpi/ic_logo.png
new file mode 100644
index 0000000..10b2e08
Binary files /dev/null and b/app/src/main/res/mipmap-mdpi/ic_logo.png differ
diff --git a/app/src/main/res/mipmap-mdpi/ic_logog.png b/app/src/main/res/mipmap-mdpi/ic_logog.png
new file mode 100644
index 0000000..e52d03b
Binary files /dev/null and b/app/src/main/res/mipmap-mdpi/ic_logog.png differ
diff --git a/app/src/main/res/mipmap-xhdpi/ic_home.png b/app/src/main/res/mipmap-xhdpi/ic_home.png
new file mode 100644
index 0000000..839030b
Binary files /dev/null and b/app/src/main/res/mipmap-xhdpi/ic_home.png differ
diff --git a/app/src/main/res/mipmap-xhdpi/ic_iasdfa.png b/app/src/main/res/mipmap-xhdpi/ic_iasdfa.png
new file mode 100644
index 0000000..3139a91
Binary files /dev/null and b/app/src/main/res/mipmap-xhdpi/ic_iasdfa.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..27eaa8c
Binary files /dev/null and b/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ
diff --git a/app/src/main/res/mipmap-xhdpi/ic_logo.png b/app/src/main/res/mipmap-xhdpi/ic_logo.png
new file mode 100644
index 0000000..5371b7e
Binary files /dev/null and b/app/src/main/res/mipmap-xhdpi/ic_logo.png differ
diff --git a/app/src/main/res/mipmap-xhdpi/ic_logog.png b/app/src/main/res/mipmap-xhdpi/ic_logog.png
new file mode 100644
index 0000000..364d789
Binary files /dev/null and b/app/src/main/res/mipmap-xhdpi/ic_logog.png differ
diff --git a/app/src/main/res/mipmap-xxhdpi/ic_home.png b/app/src/main/res/mipmap-xxhdpi/ic_home.png
new file mode 100644
index 0000000..1db1a1a
Binary files /dev/null and b/app/src/main/res/mipmap-xxhdpi/ic_home.png differ
diff --git a/app/src/main/res/mipmap-xxhdpi/ic_iasdfa.png b/app/src/main/res/mipmap-xxhdpi/ic_iasdfa.png
new file mode 100644
index 0000000..4895102
Binary files /dev/null and b/app/src/main/res/mipmap-xxhdpi/ic_iasdfa.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..8b83fe9
Binary files /dev/null and b/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ
diff --git a/app/src/main/res/mipmap-xxhdpi/ic_logo.png b/app/src/main/res/mipmap-xxhdpi/ic_logo.png
new file mode 100644
index 0000000..38b93fa
Binary files /dev/null and b/app/src/main/res/mipmap-xxhdpi/ic_logo.png differ
diff --git a/app/src/main/res/mipmap-xxhdpi/ic_logog.png b/app/src/main/res/mipmap-xxhdpi/ic_logog.png
new file mode 100644
index 0000000..d825e8e
Binary files /dev/null and b/app/src/main/res/mipmap-xxhdpi/ic_logog.png differ
diff --git a/app/src/main/res/mipmap-xxxhdpi/ic_home.png b/app/src/main/res/mipmap-xxxhdpi/ic_home.png
new file mode 100644
index 0000000..d214c60
Binary files /dev/null and b/app/src/main/res/mipmap-xxxhdpi/ic_home.png differ
diff --git a/app/src/main/res/mipmap-xxxhdpi/ic_iasdfa.png b/app/src/main/res/mipmap-xxxhdpi/ic_iasdfa.png
new file mode 100644
index 0000000..6d2f831
Binary files /dev/null and b/app/src/main/res/mipmap-xxxhdpi/ic_iasdfa.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..4801f24
Binary files /dev/null and b/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ
diff --git a/app/src/main/res/mipmap-xxxhdpi/ic_logo.png b/app/src/main/res/mipmap-xxxhdpi/ic_logo.png
new file mode 100644
index 0000000..a611abe
Binary files /dev/null and b/app/src/main/res/mipmap-xxxhdpi/ic_logo.png differ
diff --git a/app/src/main/res/mipmap-xxxhdpi/ic_logog.png b/app/src/main/res/mipmap-xxxhdpi/ic_logog.png
new file mode 100644
index 0000000..4ca59d1
Binary files /dev/null and b/app/src/main/res/mipmap-xxxhdpi/ic_logog.png differ
diff --git a/app/src/main/res/values-v21/styles.xml b/app/src/main/res/values-v21/styles.xml
new file mode 100644
index 0000000..cc28b75
--- /dev/null
+++ b/app/src/main/res/values-v21/styles.xml
@@ -0,0 +1,9 @@
+
+
+
+
diff --git a/app/src/main/res/values-w820dp/dimens.xml b/app/src/main/res/values-w820dp/dimens.xml
new file mode 100644
index 0000000..62df187
--- /dev/null
+++ b/app/src/main/res/values-w820dp/dimens.xml
@@ -0,0 +1,6 @@
+
+
+ 64dp
+
diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml
new file mode 100644
index 0000000..458a164
--- /dev/null
+++ b/app/src/main/res/values/colors.xml
@@ -0,0 +1,15 @@
+
+
+ #3F51B5
+ #303F9F
+ #FF4081
+ #FFF4AF00
+ #FFE1D9DB
+ #FFBAB7B4
+ #FFD6CED0
+ #FFE6882B
+ #FFEAE7E4
+ #c9dcdf
+ #FF020412
+ #FFE42910
+
diff --git a/app/src/main/res/values/dimens.xml b/app/src/main/res/values/dimens.xml
new file mode 100644
index 0000000..b144281
--- /dev/null
+++ b/app/src/main/res/values/dimens.xml
@@ -0,0 +1,9 @@
+
+
+ 16dp
+ 160dp
+
+ 16dp
+ 16dp
+ 16dp
+
diff --git a/app/src/main/res/values/drawables.xml b/app/src/main/res/values/drawables.xml
new file mode 100644
index 0000000..6cc55d6
--- /dev/null
+++ b/app/src/main/res/values/drawables.xml
@@ -0,0 +1,8 @@
+
+ - @android:drawable/ic_menu_camera
+ - @android:drawable/ic_menu_gallery
+ - @android:drawable/ic_menu_slideshow
+ - @android:drawable/ic_menu_manage
+ - @android:drawable/ic_menu_share
+ - @android:drawable/ic_menu_send
+
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
new file mode 100644
index 0000000..21d2184
--- /dev/null
+++ b/app/src/main/res/values/strings.xml
@@ -0,0 +1,17 @@
+
+ DVS
+
+ Open navigation drawer
+ Close navigation drawer
+
+ Settings
+
+\tIn a democracy, a government is chosen by voting in an election:
+ a way for an electorate to elect, i.e. choose, among several candidates for rule.
+ In a representative democracy voting is the method by which the electorate appoints its representatives in its government.\n\n
+ \t\t\tWhen polling time so many people unable to come to their native places for vote.While coming for voting their money and time is being wasted.So from this system we can overcome this problem.
+ We can get voting without rigging.No one can wait at polling booths.No one cannot see how the people vote for someone.(Votes will be encrypted).We can conduct voting with in small period of time.\n\n
+ \t\t\t\tBy using digital voting system we can easily vote for the nomiees.We can increase the voting percentage also.It consumes less time for vote.
+
+
+
diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml
new file mode 100644
index 0000000..80f09db
--- /dev/null
+++ b/app/src/main/res/values/styles.xml
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/test/java/com/example/home/dvs/ExampleUnitTest.java b/app/src/test/java/com/example/home/dvs/ExampleUnitTest.java
new file mode 100644
index 0000000..9bf05f5
--- /dev/null
+++ b/app/src/test/java/com/example/home/dvs/ExampleUnitTest.java
@@ -0,0 +1,17 @@
+package com.example.home.dvs;
+
+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..d01a705
--- /dev/null
+++ b/build.gradle
@@ -0,0 +1,24 @@
+// 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:2.2.3'
+
+ // 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..3530b01
--- /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..04e285f
--- /dev/null
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,6 @@
+#Mon Dec 28 10:00:20 PST 2015
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.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..aec9973
--- /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..d3db109
--- /dev/null
+++ b/settings.gradle
@@ -0,0 +1 @@
+include ':app'