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 @@ + + + + + + + + + + + + + - + + + + + + + + + + +