├── .gitignore
├── .idea
├── .name
├── compiler.xml
├── copyright
│ └── profiles_settings.xml
├── encodings.xml
├── gradle.xml
├── misc.xml
├── modules.xml
└── runConfigurations.xml
├── README.md
├── app
├── .gitignore
├── MFE Vehicle Tracker.apk
├── app-release.apk
├── build.gradle
├── libs
│ ├── apache-httpcomponents-httpclient.jar
│ └── apache-httpcomponents-httpcore.jar
├── proguard-rules.pro
└── src
│ ├── androidTest
│ └── java
│ │ └── com
│ │ └── example
│ │ └── madeel
│ │ └── devicetracker
│ │ └── ApplicationTest.java
│ ├── main
│ ├── AndroidManifest.xml
│ ├── ic_launcher-web.png
│ ├── java
│ │ └── com
│ │ │ └── mfe
│ │ │ └── madeel
│ │ │ └── devicetracker
│ │ │ ├── Approve.java
│ │ │ ├── GPSTracker.java
│ │ │ ├── MainActivity.java
│ │ │ ├── MyService.java
│ │ │ ├── SplashScreen.java
│ │ │ ├── login.java
│ │ │ └── register.java
│ └── res
│ │ ├── drawable
│ │ ├── logo.jpg
│ │ ├── logo1.jpg
│ │ ├── logochange.jpg
│ │ ├── logoqurvex.jpg
│ │ └── spl.jpg
│ │ ├── layout
│ │ ├── activity_approve.xml
│ │ ├── activity_login.xml
│ │ ├── activity_main.xml
│ │ ├── activity_register.xml
│ │ └── activity_splash_screen.xml
│ │ ├── mipmap-hdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-mdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-xhdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-xxhdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-xxxhdpi
│ │ └── ic_launcher.png
│ │ ├── values-w820dp
│ │ └── dimens.xml
│ │ └── values
│ │ ├── LoginActivity.xml
│ │ ├── colors.xml
│ │ ├── dimens.xml
│ │ ├── strings.xml
│ │ └── styles.xml
│ └── test
│ └── java
│ └── com
│ └── example
│ └── madeel
│ └── devicetracker
│ └── ExampleUnitTest.java
├── build.gradle
├── css
├── bootstrap.css
├── bootstrap.min.css
└── stylesheet.css
├── devicetracker.sql
├── fonts
├── glyphicons-halflings-regular.eot
├── glyphicons-halflings-regular.svg
├── glyphicons-halflings-regular.ttf
├── glyphicons-halflings-regular.woff
└── glyphicons-halflings-regular.woff2
├── gradle.properties
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
├── js
├── bootstrap.js
├── bootstrap.min.js
└── npm.js
├── mfekey.jks
└── settings.gradle
/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 | .gradle
3 | /local.properties
4 | /.idea/workspace.xml
5 | /.idea/libraries
6 | .DS_Store
7 | /build
8 | /captures
9 |
--------------------------------------------------------------------------------
/.idea/.name:
--------------------------------------------------------------------------------
1 | MF Enterprises
--------------------------------------------------------------------------------
/.idea/compiler.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/.idea/copyright/profiles_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/.idea/encodings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.idea/gradle.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
23 |
24 |
--------------------------------------------------------------------------------
/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
--------------------------------------------------------------------------------
/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/.idea/runConfigurations.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Vehicle-Tracking-System-WebApp-PHP
2 | This is a complete Vehicle Tracking System. It tracks a device real time and show its location on Map on Web App. It maintains the history of every device and user can view them history by date and time. The user will first register from android app then wait for approval from admin . Now admin from web app submitted requests and can view all the details, admin can approve the request or can delete it. After approval from admin the user will automatically will be redirected to login page and the tracking will begin.
3 |
--------------------------------------------------------------------------------
/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/app/MFE Vehicle Tracker.apk:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/madeel20/Vehicle-Tracking-System-AndroidApp-PHP/9590f38af481e09d614b3b1f67daa950aeb342cb/app/MFE Vehicle Tracker.apk
--------------------------------------------------------------------------------
/app/app-release.apk:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/madeel20/Vehicle-Tracking-System-AndroidApp-PHP/9590f38af481e09d614b3b1f67daa950aeb342cb/app/app-release.apk
--------------------------------------------------------------------------------
/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | android {
4 | signingConfigs {
5 | config {
6 | keyAlias 'key1'
7 | keyPassword 'safety123'
8 | storePassword 'safety123'
9 | storeFile file('C:/Users/M.Adeel/Desktop/MF Enterprises (2)/MF Enterprises/mfekey.jks')
10 | }
11 | }
12 | compileSdkVersion 26
13 | buildToolsVersion '26.0.0'
14 | defaultConfig {
15 | applicationId "com.mfe.qurvex.devicetracker"
16 | minSdkVersion 21
17 | targetSdkVersion 26
18 | versionCode 1
19 | versionName "1.0"
20 | }
21 | buildTypes {
22 | release {
23 | minifyEnabled false
24 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
25 | }
26 | }
27 | productFlavors {
28 | }
29 | }
30 |
31 | dependencies {
32 | compile fileTree(include: ['*.jar'], dir: 'libs')
33 | testCompile 'junit:junit:4.12'
34 | compile 'com.android.support:appcompat-v7:26.0.1'
35 | //compile 'com.android.support:appcompat-v7:27.0.1'
36 | compile files('libs/apache-httpcomponents-httpclient.jar')
37 | }
38 |
--------------------------------------------------------------------------------
/app/libs/apache-httpcomponents-httpclient.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/madeel20/Vehicle-Tracking-System-AndroidApp-PHP/9590f38af481e09d614b3b1f67daa950aeb342cb/app/libs/apache-httpcomponents-httpclient.jar
--------------------------------------------------------------------------------
/app/libs/apache-httpcomponents-httpcore.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/madeel20/Vehicle-Tracking-System-AndroidApp-PHP/9590f38af481e09d614b3b1f67daa950aeb342cb/app/libs/apache-httpcomponents-httpcore.jar
--------------------------------------------------------------------------------
/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in C:\Users\M.Adeel\AppData\Local\Android\Sdk/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
--------------------------------------------------------------------------------
/app/src/androidTest/java/com/example/madeel/devicetracker/ApplicationTest.java:
--------------------------------------------------------------------------------
1 | package com.mfe.madeel.devicetracker;
2 |
3 | import android.app.Application;
4 | import android.test.ApplicationTestCase;
5 |
6 | /**
7 | * Testing Fundamentals
8 | */
9 | public class ApplicationTest extends ApplicationTestCase {
10 | public ApplicationTest() {
11 | super(Application.class);
12 | }
13 | }
--------------------------------------------------------------------------------
/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
9 |
17 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/app/src/main/ic_launcher-web.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/madeel20/Vehicle-Tracking-System-AndroidApp-PHP/9590f38af481e09d614b3b1f67daa950aeb342cb/app/src/main/ic_launcher-web.png
--------------------------------------------------------------------------------
/app/src/main/java/com/mfe/madeel/devicetracker/Approve.java:
--------------------------------------------------------------------------------
1 | package com.mfe.madeel.devicetracker;
2 |
3 | import android.content.Context;
4 | import android.content.Intent;
5 | import android.content.SharedPreferences;
6 | import android.net.Uri;
7 | import android.os.AsyncTask;
8 | import android.os.Handler;
9 | import android.support.v7.app.AppCompatActivity;
10 | import android.os.Bundle;
11 | import android.view.View;
12 | import android.widget.TextView;
13 | import android.widget.Toast;
14 |
15 | import java.io.BufferedReader;
16 | import java.io.InputStream;
17 | import java.io.InputStreamReader;
18 | import java.net.HttpURLConnection;
19 | import java.net.MalformedURLException;
20 | import java.net.URL;
21 | import java.util.Timer;
22 | import java.util.TimerTask;
23 |
24 | public class Approve extends AppCompatActivity {
25 | TextView t ;
26 | private boolean approved=false;
27 | SharedPreferences sharedpreferences;
28 | @Override
29 | protected void onCreate(Bundle savedInstanceState) {
30 |
31 | super.onCreate(savedInstanceState);
32 | setContentView(R.layout.activity_approve);
33 | t = (TextView)findViewById(R.id.textView6);
34 | sharedpreferences = getSharedPreferences(MainActivity.mypreference, Context.MODE_PRIVATE);
35 | t.setText(""+sharedpreferences.getString("username",""));
36 | repeatcheck();
37 |
38 | }
39 |
40 | public void checkApproval(){
41 | sharedpreferences = getSharedPreferences(MainActivity.mypreference, Context.MODE_PRIVATE);
42 | ///checkapp.php?key=1345&AUId=61
43 | Uri.Builder builder = new Uri.Builder();
44 | builder.scheme("https")
45 | .authority("mfenter.com")
46 |
47 | .appendPath("tracker")
48 | .appendPath("checkapp.php")
49 | .appendQueryParameter("key", "1345")
50 | .appendQueryParameter("AUId", sharedpreferences.getString("AUId",""));
51 |
52 |
53 | String myUrl = builder.build().toString();
54 |
55 | AsyncRetrieve as = new AsyncRetrieve();
56 | as.u = myUrl;
57 | as.execute();
58 |
59 |
60 |
61 |
62 |
63 |
64 | }
65 | Handler handler;
66 | public void repeatcheck(){
67 | handler = new Handler();
68 | final Timer timer = new Timer();
69 | final TimerTask doAsynchronousTask = new TimerTask() {
70 | @Override
71 | public void run() {
72 | handler.post(new Runnable() {
73 | public void run() {
74 | try {
75 | checkApproval();
76 | if(approved==true){
77 | timer.cancel();
78 | sharedpreferences.edit().putString("Approval","1").commit();
79 | Toast.makeText(Approve.this, "Approved!", Toast.LENGTH_LONG).show();
80 | Intent activityChangeIntent = new Intent(Approve.this, login.class);
81 | // currentContext.startActivity(activityChangeIntent);
82 |
83 | Approve.this.startActivity(activityChangeIntent);
84 | finishAffinity();
85 | finish();
86 | }
87 |
88 | } catch (Exception e) {
89 | // Toast.makeText(Approve.this, e.toString(), Toast.LENGTH_LONG).show();
90 | }
91 | }
92 | });
93 | }
94 | };
95 | timer.schedule(doAsynchronousTask, 0, 100 ); //execute in every 50000 ms
96 | }
97 |
98 | public void logout1(View view){
99 | Intent stopServiceIntent = new Intent(this, MyService.class);
100 | stopService(stopServiceIntent);
101 | SharedPreferences sharedpreferences = getSharedPreferences(MainActivity.mypreference, Context.MODE_PRIVATE);
102 | SharedPreferences.Editor editor = sharedpreferences.edit();
103 | editor.clear();
104 | editor.commit();
105 | Intent activityChangeIntent = new Intent(Approve.this,MainActivity.class);
106 |
107 | // currentContext.startActivity(activityChangeIntent);
108 | finishAffinity();
109 | startActivity(activityChangeIntent);
110 | }
111 |
112 |
113 | public class AsyncRetrieve extends AsyncTask {
114 | HttpURLConnection conn;
115 | URL url = null;
116 | String u;
117 | String res;
118 |
119 | //this method will interact with UI, here display loading message
120 | @Override
121 | protected void onPreExecute() {
122 | super.onPreExecute();
123 |
124 |
125 | }
126 |
127 | // This method does not interact with UI, You need to pass result to onPostExecute to display
128 | @Override
129 | protected String doInBackground(String... params) {
130 | try {
131 | // Enter URL address where your php file resides
132 | url = new URL(u);
133 |
134 | } catch (MalformedURLException e) {
135 | // TODO Auto-generated catch block
136 | e.printStackTrace();
137 | return e.toString();
138 | }
139 | try {
140 |
141 | // Setup HttpURLConnection class to send and receive data from php
142 | conn = (HttpURLConnection) url.openConnection();
143 |
144 | conn.setRequestMethod("GET");
145 |
146 | // setDoOutput to true as we recieve data from json file
147 | conn.setDoOutput(true);
148 |
149 | } catch (Exception e1) {
150 | // TODO Auto-generated catch block
151 | e1.printStackTrace();
152 | cancel(true);
153 | //Toast.makeText(Approve.this, e1.toString(), Toast.LENGTH_LONG).show();
154 | return e1.toString();
155 |
156 | }
157 |
158 | try {
159 |
160 | int response_code = conn.getResponseCode();
161 |
162 | // Check if successful connection made
163 | if (response_code == HttpURLConnection.HTTP_OK) {
164 |
165 | // Read data sent from server
166 | InputStream input = conn.getInputStream();
167 | BufferedReader reader = new BufferedReader(new InputStreamReader(input));
168 | StringBuilder result = new StringBuilder();
169 | String line;
170 |
171 | while ((line = reader.readLine()) != null) {
172 | result.append(line);
173 | }
174 |
175 | // Pass data to onPostExecute method
176 | return (result.toString());
177 |
178 | } else {
179 |
180 | return ("unsuccessful");
181 | }
182 |
183 | } catch (Exception e) {
184 | cancel(true);
185 | // Toast.makeText(register.this, e.toString(), Toast.LENGTH_LONG).show();
186 | e.printStackTrace();
187 | return e.toString();
188 | } finally {
189 | conn.disconnect();
190 | }
191 |
192 |
193 | }
194 |
195 | // this method will interact with UI, display result sent from doInBackground method
196 | @Override
197 | protected void onPostExecute(String result) {
198 | //Toast.makeText(Approve.this, result.trim(), Toast.LENGTH_LONG).show();
199 | result.trim();
200 | if(result.equals("1")){
201 |
202 | approved =true;
203 |
204 | }
205 |
206 |
207 |
208 |
209 | }
210 |
211 | /*t2.setText(result.toString());
212 | SharedPreferences.Editor editor = sharedpreferences.edit();
213 | editor.putString("id" , result.toString());
214 | sendgps();
215 | /* res = result.toString();
216 | result.trim();
217 | if(res.equalsIgnoreCase("Succeed") ){
218 |
219 | Toast.makeText(login.this, "Log In Succesfull!", Toast.LENGTH_LONG).show();
220 | }
221 | else {
222 | Toast.makeText(login.this, "Username or password is incorrect!", Toast.LENGTH_LONG).show();
223 | }*/
224 |
225 | }
226 | }
227 |
--------------------------------------------------------------------------------
/app/src/main/java/com/mfe/madeel/devicetracker/GPSTracker.java:
--------------------------------------------------------------------------------
1 | package com.mfe.madeel.devicetracker;
2 |
3 |
4 | import android.Manifest;
5 | import android.app.Activity;
6 | import android.app.Service;
7 | import android.content.Context;
8 | import android.content.DialogInterface;
9 | import android.content.Intent;
10 | import android.content.pm.PackageManager;
11 | import android.location.Location;
12 | import android.location.LocationListener;
13 | import android.location.LocationManager;
14 | import android.os.Bundle;
15 | import android.os.IBinder;
16 | import android.provider.Settings;
17 | import android.support.v4.app.ActivityCompat;
18 | import android.support.v7.app.AlertDialog;
19 | import android.util.Log;
20 |
21 | class GPSTracker extends Service implements LocationListener {
22 | private final Context mContext;
23 | // flag for GPS status
24 | boolean isGPSEnabled = false;
25 | // flag for network status
26 | boolean isNetworkEnabled = false;
27 | // flag for GPS status
28 | boolean canGetLocation = false;
29 | Location location; // location
30 | double latitude; // latitude
31 | double longitude; // longitude
32 | // The minimum distance to change Updates in meters
33 | private static final long MIN_DISTANCE_CHANGE_FOR_UPDATES = 10; // 10 meters
34 | // The minimum time between updates in milliseconds
35 | private static final long MIN_TIME_BW_UPDATES = 1000 * 60 * 1; // 1 minute
36 | // Declaring a Location Manager
37 | protected LocationManager locationManager;
38 |
39 | public GPSTracker(Context context) {
40 | this.mContext = context;
41 | getLocation();
42 | }
43 |
44 | public Location getLocation() {
45 | try {
46 | locationManager = (LocationManager) mContext.getSystemService(LOCATION_SERVICE);
47 | // getting GPS status
48 | isGPSEnabled = locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER);
49 | // getting network status
50 | isNetworkEnabled = locationManager
51 | .isProviderEnabled(LocationManager.NETWORK_PROVIDER);
52 | if (!isGPSEnabled && !isNetworkEnabled) {
53 | // no network provider is enabled
54 | } else {
55 | this.canGetLocation = true;
56 | // First get location from Network Provider
57 | if (isNetworkEnabled) {
58 | //check the network permission
59 | if (ActivityCompat.checkSelfPermission(mContext, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(mContext, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
60 | ActivityCompat.requestPermissions((Activity) mContext, new String[]{android.Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION}, 101);
61 | }
62 | locationManager.requestLocationUpdates(
63 | LocationManager.NETWORK_PROVIDER,
64 | MIN_TIME_BW_UPDATES,
65 | MIN_DISTANCE_CHANGE_FOR_UPDATES, this);
66 | Log.d("Network", "Network");
67 | if (locationManager != null) {
68 | location = locationManager
69 | .getLastKnownLocation(LocationManager.NETWORK_PROVIDER);
70 | if (location != null) {
71 | latitude = location.getLatitude();
72 | longitude = location.getLongitude();
73 | }
74 | }
75 | }
76 | // if GPS Enabled get lat/long using GPS Services
77 | if (isGPSEnabled) {
78 | if (location == null) {
79 | //check the network permission
80 | if (ActivityCompat.checkSelfPermission(mContext, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(mContext, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
81 | ActivityCompat.requestPermissions((Activity) mContext, new String[]{android.Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION}, 101);
82 | }
83 | locationManager.requestLocationUpdates(
84 | LocationManager.GPS_PROVIDER,
85 | MIN_TIME_BW_UPDATES,
86 | MIN_DISTANCE_CHANGE_FOR_UPDATES, this);
87 | Log.d("GPS Enabled", "GPS Enabled");
88 | if (locationManager != null) {
89 | location = locationManager
90 | .getLastKnownLocation(LocationManager.GPS_PROVIDER);
91 | if (location != null) {
92 | latitude = location.getLatitude();
93 | longitude = location.getLongitude();
94 | }
95 | }
96 | }
97 | }
98 | }
99 | } catch (Exception e) {
100 | e.printStackTrace();
101 | }
102 | return 0;
103 | }
104 |
105 | /**
106 | * Stop using GPS listener
107 | * Calling this function will stop using GPS in your app
108 | * */
109 | public void stopUsingGPS() {
110 | if (locationManager != null) {
111 |
112 | if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
113 | // TODO: Consider calling
114 | // ActivityCompat#requestPermissions
115 | // here to request the missing permissions, and then overriding
116 | // public void onRequestPermissionsResult(int requestCode, String[] permissions,
117 | // int[] grantResults)
118 | // to handle the case where the user grants the permission. See the documentation
119 | // for ActivityCompat#requestPermissions for more details.
120 | return;
121 | }
122 | locationManager.removeUpdates(GPSTracker.this);
123 | }
124 | }
125 | /**
126 | * Function to get latitude
127 | * */
128 | public double getLatitude(){
129 | if(location != null){
130 | latitude = 0;
131 | }
132 | // return latitude
133 | return 0;
134 | }
135 | /**
136 | * Function to get longitude
137 | * */
138 | public double getLongitude(){
139 | if(location != null){
140 | longitude = 0;
141 | }
142 | // return longitude
143 | return 0;
144 | }
145 | /**
146 | * Function to check GPS/wifi enabled
147 | * @return boolean
148 | * */
149 | public boolean canGetLocation() {
150 | return this.canGetLocation;
151 | }
152 | /**
153 | * Function to show settings alert dialog
154 | * On pressing Settings button will lauch Settings Options
155 | * */
156 | public void showSettingsAlert(){
157 | AlertDialog.Builder alertDialog = new AlertDialog.Builder(mContext);
158 | // Setting Dialog Title
159 | alertDialog.setTitle("GPS is settings");
160 | // Setting Dialog Message
161 | alertDialog.setMessage("GPS is not enabled. Do you want to go to settings menu?");
162 | // On pressing Settings button
163 | alertDialog.setPositiveButton("Settings", new DialogInterface.OnClickListener() {
164 | public void onClick(DialogInterface dialog,int which) {
165 | Intent intent = new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS);
166 | mContext.startActivity(intent);
167 | }
168 | });
169 | // on pressing cancel button
170 | alertDialog.setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
171 | public void onClick(DialogInterface dialog, int which) {
172 | dialog.cancel();
173 | }
174 | });
175 | alertDialog.show();
176 | }
177 | @Override
178 | public void onLocationChanged(Location location) {
179 | }
180 | @Override
181 | public void onProviderDisabled(String provider) {
182 | }
183 | @Override
184 | public void onProviderEnabled(String provider) {
185 | }
186 | @Override
187 | public void onStatusChanged(String provider, int status, Bundle extras) {
188 | }
189 | @Override
190 | public IBinder onBind(Intent arg0) {
191 | return null;
192 | }
193 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/mfe/madeel/devicetracker/MainActivity.java:
--------------------------------------------------------------------------------
1 | package com.mfe.madeel.devicetracker;
2 |
3 | import android.app.ProgressDialog;
4 | import android.content.Context;
5 | import android.content.Intent;
6 | import android.content.SharedPreferences;
7 | import android.net.Uri;
8 | import android.os.AsyncTask;
9 | import android.support.v7.app.AppCompatActivity;
10 | import android.os.Bundle;
11 | import android.view.View;
12 | import android.widget.EditText;
13 | import android.widget.TextView;
14 | import android.widget.Toast;
15 | import java.io.BufferedReader;
16 | import java.io.IOException;
17 | import java.io.InputStream;
18 | import java.io.InputStreamReader;
19 | import java.net.HttpURLConnection;
20 | import java.net.MalformedURLException;
21 | import java.net.URL;
22 |
23 | public class MainActivity extends AppCompatActivity {
24 |
25 | EditText username , password;
26 | // CONNECTION_TIMEOUT and READ_TIMEOUT are in milliseconds
27 | public static final int CONNECTION_TIMEOUT = 10000;
28 | public static final int READ_TIMEOUT = 100;
29 | TextView textPHP;
30 | SharedPreferences sharedpreferences;
31 | public static final String mypreference = "mypref";
32 | @Override
33 | protected void onCreate(Bundle savedInstanceState) {
34 | super.onCreate(savedInstanceState);
35 | sharedpreferences = getSharedPreferences(mypreference,
36 | Context.MODE_PRIVATE);
37 |
38 | setContentView(R.layout.activity_main);
39 | username = (EditText) findViewById(R.id.editText);
40 | password = (EditText) findViewById(R.id.editText2);
41 |
42 |
43 |
44 |
45 | }
46 |
47 | public void onregclick(View v){
48 | Intent activityChangeIntent = new Intent(MainActivity.this,register.class);
49 | // currentContext.startActivity(activityChangeIntent);
50 | MainActivity.this.startActivity(activityChangeIntent);
51 | }
52 | //Make call to AsyncRetrieve
53 | public void onclickbtn(View v) {
54 | String user = username.getText().toString();
55 | String pass = password.getText().toString();
56 | if(user.isEmpty() || pass.isEmpty()){
57 |
58 | Toast.makeText(MainActivity.this,
59 | "Fill all the fields!", Toast.LENGTH_LONG).show();
60 | }
61 | else {
62 |
63 | //http://adeel20.000webhostapp.com/register.php?key=1234&username=kashif&password=1234&cdate=2018-9-3
64 | Uri.Builder builder = new Uri.Builder();
65 | builder.scheme("https")
66 | .authority("mfenter.com")
67 |
68 | .appendPath("tracker")
69 |
70 | .appendPath("checklogin.php")
71 | .appendQueryParameter("key", "1345")
72 | .appendQueryParameter("username",user)
73 | .appendQueryParameter("password",pass);
74 |
75 | String myUrl = builder.build().toString();
76 | AsyncRetrieve as = new AsyncRetrieve();
77 | as.execute();
78 |
79 |
80 | as.u = myUrl;
81 |
82 |
83 |
84 | }
85 |
86 | }
87 |
88 |
89 | private class AsyncRetrieve extends AsyncTask {
90 | ProgressDialog pdLoading = new ProgressDialog(MainActivity.this);
91 | HttpURLConnection conn;
92 | URL url = null;
93 | String u;
94 | String res;
95 | //this method will interact with UI, here display loading message
96 | @Override
97 | protected void onPreExecute() {
98 | super.onPreExecute();
99 |
100 | pdLoading.setMessage("\tLogging In...");
101 | pdLoading.setCancelable(false);
102 | pdLoading.show();
103 |
104 | }
105 |
106 | // This method does not interact with UI, You need to pass result to onPostExecute to display
107 | @Override
108 | protected String doInBackground(String... params) {
109 | try {
110 | // Enter URL address where your php file resides
111 | url = new URL(u);
112 |
113 | } catch (MalformedURLException e) {
114 | // TODO Auto-generated catch block
115 | e.printStackTrace();
116 | return e.toString();
117 | }
118 | try {
119 |
120 | // Setup HttpURLConnection class to send and receive data from php
121 | conn = (HttpURLConnection) url.openConnection();
122 |
123 | conn.setRequestMethod("GET");
124 |
125 | // setDoOutput to true as we recieve data from json file
126 | conn.setDoOutput(true);
127 |
128 | } catch (IOException e1) {
129 | // TODO Auto-generated catch block
130 | e1.printStackTrace();
131 | return e1.toString();
132 | }
133 |
134 | try {
135 |
136 | int response_code = conn.getResponseCode();
137 |
138 | // Check if successful connection made
139 | if (response_code == HttpURLConnection.HTTP_OK) {
140 |
141 | // Read data sent from server
142 | InputStream input = conn.getInputStream();
143 | BufferedReader reader = new BufferedReader(new InputStreamReader(input));
144 | StringBuilder result = new StringBuilder();
145 | String line;
146 |
147 | while ((line = reader.readLine()) != null) {
148 | result.append(line);
149 | }
150 |
151 | // Pass data to onPostExecute method
152 | return (result.toString());
153 |
154 | } else {
155 |
156 | return ("unsuccessful");
157 | }
158 |
159 | } catch (IOException e) {
160 | e.printStackTrace();
161 | return e.toString();
162 | } finally {
163 | conn.disconnect();
164 | }
165 |
166 |
167 | }
168 |
169 | // this method will interact with UI, display result sent from doInBackground method
170 | @Override
171 | protected void onPostExecute(String result) {
172 |
173 |
174 |
175 | // you to understand error returned from doInBackground method
176 | result.trim();
177 |
178 | res = result.toString();
179 | String user = username.getText().toString();
180 |
181 |
182 | if(res.equalsIgnoreCase("Succeed") ){
183 |
184 |
185 |
186 | AsyncRetrieve1 as =new AsyncRetrieve1();
187 | Uri.Builder builder = new Uri.Builder();
188 | builder.scheme("https")
189 | .authority("mfenter.com")
190 |
191 | .appendPath("tracker")
192 |
193 | .appendPath("getauid.php")
194 | .appendQueryParameter("key", "1345")
195 | .appendQueryParameter("username",user);
196 |
197 |
198 | String myUrl = builder.build().toString();
199 |
200 | as.execute();
201 |
202 |
203 | as.u = myUrl;
204 |
205 | }
206 | else if(res.equalsIgnoreCase("na") ){
207 | Toast.makeText(MainActivity.this, "User is no longer Active!", Toast.LENGTH_LONG).show();
208 | }
209 | else {
210 | //Toast.makeText(MainActivity.this, result.toString(), Toast.LENGTH_LONG).show();
211 | Toast.makeText(MainActivity.this, "Username or password is incorrect!", Toast.LENGTH_LONG).show();
212 |
213 | }
214 | pdLoading.dismiss();
215 |
216 | }
217 |
218 | }
219 |
220 |
221 |
222 |
223 |
224 |
225 | private class AsyncRetrieve1 extends AsyncTask {
226 | ProgressDialog pdLoading = new ProgressDialog(MainActivity.this);
227 | HttpURLConnection conn;
228 | URL url = null;
229 | String u;
230 | String res;
231 | //this method will interact with UI, here display loading message
232 | @Override
233 | protected void onPreExecute() {
234 | super.onPreExecute();
235 |
236 | pdLoading.setMessage("\tLogging In...");
237 | pdLoading.setCancelable(false);
238 | pdLoading.show();
239 |
240 | }
241 |
242 | // This method does not interact with UI, You need to pass result to onPostExecute to display
243 | @Override
244 | protected String doInBackground(String... params) {
245 | try {
246 | // Enter URL address where your php file resides
247 | url = new URL(u);
248 |
249 | } catch (MalformedURLException e) {
250 | // TODO Auto-generated catch block
251 | e.printStackTrace();
252 | return e.toString();
253 | }
254 | try {
255 |
256 | // Setup HttpURLConnection class to send and receive data from php
257 | conn = (HttpURLConnection) url.openConnection();
258 | conn.setRequestMethod("GET");
259 |
260 | // setDoOutput to true as we recieve data from json file
261 | conn.setDoOutput(true);
262 |
263 | } catch (IOException e1) {
264 | // TODO Auto-generated catch block
265 | e1.printStackTrace();
266 | return e1.toString();
267 | }
268 |
269 | try {
270 |
271 | int response_code = conn.getResponseCode();
272 |
273 | // Check if successful connection made
274 | if (response_code == HttpURLConnection.HTTP_OK) {
275 |
276 | // Read data sent from server
277 | InputStream input = conn.getInputStream();
278 | BufferedReader reader = new BufferedReader(new InputStreamReader(input));
279 | StringBuilder result = new StringBuilder();
280 | String line;
281 |
282 | while ((line = reader.readLine()) != null) {
283 | result.append(line);
284 | }
285 |
286 | // Pass data to onPostExecute method
287 | return (result.toString());
288 |
289 | } else {
290 |
291 | return ("unsuccessful");
292 | }
293 |
294 | } catch (IOException e) {
295 | e.printStackTrace();
296 | return e.toString();
297 | } finally {
298 | conn.disconnect();
299 | }
300 |
301 |
302 | }
303 |
304 | // this method will interact with UI, display result sent from doInBackground method
305 | @Override
306 | protected void onPostExecute(String result) {
307 | pdLoading.dismiss();
308 |
309 |
310 | // you to understand error returned from doInBackground method
311 | result.trim();
312 |
313 | res = result.toString();
314 | SharedPreferences.Editor editor = sharedpreferences.edit();
315 | editor.putString("AUId" , res);
316 | editor.commit();
317 | Uri.Builder builder = new Uri.Builder();
318 | builder.scheme("https")
319 | .authority("mfenter.com")
320 |
321 | .appendPath("tracker")
322 | .appendPath("checkapp.php")
323 | .appendQueryParameter("key", "1345")
324 | .appendQueryParameter("AUId", sharedpreferences.getString("AUId",""));
325 |
326 |
327 | String myUrl = builder.build().toString();
328 |
329 | AsyncRetrieve2 as = new AsyncRetrieve2();
330 | as.u = myUrl;
331 | as.execute();
332 |
333 |
334 |
335 | }
336 |
337 |
338 | }
339 |
340 |
341 |
342 |
343 | private class AsyncRetrieve2 extends AsyncTask {
344 | ProgressDialog pdLoading = new ProgressDialog(MainActivity.this);
345 | HttpURLConnection conn;
346 | URL url = null;
347 | String u;
348 | String res;
349 | //this method will interact with UI, here display loading message
350 | @Override
351 | protected void onPreExecute() {
352 | super.onPreExecute();
353 |
354 | pdLoading.setMessage("\tLogging In...");
355 | pdLoading.setCancelable(false);
356 | pdLoading.show();
357 |
358 | }
359 |
360 | // This method does not interact with UI, You need to pass result to onPostExecute to display
361 | @Override
362 | protected String doInBackground(String... params) {
363 | try {
364 | // Enter URL address where your php file resides
365 | url = new URL(u);
366 |
367 | } catch (MalformedURLException e) {
368 | // TODO Auto-generated catch block
369 | e.printStackTrace();
370 | return e.toString();
371 | }
372 | try {
373 |
374 | // Setup HttpURLConnection class to send and receive data from php
375 | conn = (HttpURLConnection) url.openConnection();
376 | conn.setRequestMethod("GET");
377 |
378 | // setDoOutput to true as we recieve data from json file
379 | conn.setDoOutput(true);
380 |
381 | } catch (IOException e1) {
382 | // TODO Auto-generated catch block
383 | e1.printStackTrace();
384 | return e1.toString();
385 | }
386 |
387 | try {
388 |
389 | int response_code = conn.getResponseCode();
390 |
391 | // Check if successful connection made
392 | if (response_code == HttpURLConnection.HTTP_OK) {
393 |
394 | // Read data sent from server
395 | InputStream input = conn.getInputStream();
396 | BufferedReader reader = new BufferedReader(new InputStreamReader(input));
397 | StringBuilder result = new StringBuilder();
398 | String line;
399 |
400 | while ((line = reader.readLine()) != null) {
401 | result.append(line);
402 | }
403 |
404 | // Pass data to onPostExecute method
405 | return (result.toString());
406 |
407 | } else {
408 |
409 | return ("unsuccessful");
410 | }
411 |
412 | } catch (IOException e) {
413 | e.printStackTrace();
414 | return e.toString();
415 | } finally {
416 | conn.disconnect();
417 | }
418 |
419 |
420 | }
421 |
422 | // this method will interact with UI, display result sent from doInBackground method
423 | @Override
424 | protected void onPostExecute(String result) {
425 | pdLoading.dismiss();
426 | result.trim();
427 | String user = username.getText().toString();
428 | String pass = password.getText().toString();
429 | if(result.equals("1")){
430 | sharedpreferences.edit().putString("Approval","1").commit();
431 | SharedPreferences.Editor editor = sharedpreferences.edit();
432 | editor.putString("username" , user);
433 | editor.putString("password", pass);
434 | editor.commit();
435 | Intent activityChangeIntent = new Intent(MainActivity.this, login.class);
436 | // currentContext.startActivity(activityChangeIntent);
437 | finishAffinity();
438 |
439 | startActivity(activityChangeIntent);
440 |
441 | }
442 | else{
443 | sharedpreferences.edit().putString("Approval","0").commit();
444 | SharedPreferences.Editor editor = sharedpreferences.edit();
445 | editor.putString("username" , user);
446 | editor.putString("password", pass);
447 | editor.commit();
448 | Intent activityChangeIntent = new Intent(MainActivity.this, Approve.class);
449 | // currentContext.startActivity(activityChangeIntent);
450 | finishAffinity();
451 |
452 | startActivity(activityChangeIntent);
453 | }
454 |
455 |
456 |
457 |
458 | }
459 |
460 | }}
461 |
462 |
--------------------------------------------------------------------------------
/app/src/main/java/com/mfe/madeel/devicetracker/MyService.java:
--------------------------------------------------------------------------------
1 | package com.mfe.madeel.devicetracker;
2 |
3 | import android.app.AlertDialog;
4 | import android.app.Notification;
5 | import android.app.NotificationManager;
6 | import android.app.PendingIntent;
7 | import android.app.Service;
8 | import android.content.Context;
9 | import android.content.DialogInterface;
10 | import android.content.Intent;
11 | import android.content.pm.PackageManager;
12 | import android.graphics.Color;
13 | import android.location.LocationManager;
14 | import android.net.Uri;
15 | import android.os.AsyncTask;
16 | import android.os.Handler;
17 | import android.os.IBinder;
18 | import android.provider.Settings;
19 | import android.support.v4.app.ActivityCompat;
20 | import android.support.v4.app.NotificationCompat;
21 | import android.support.v4.content.ContextCompat;
22 | import android.widget.Toast;
23 |
24 | import java.io.BufferedReader;
25 | import java.io.IOException;
26 | import java.io.InputStream;
27 | import java.io.InputStreamReader;
28 | import java.net.HttpURLConnection;
29 | import java.net.MalformedURLException;
30 | import java.net.URL;
31 | import java.text.SimpleDateFormat;
32 | import java.util.Calendar;
33 | import java.util.Date;
34 | import java.util.Random;
35 | import java.util.Timer;
36 | import java.util.TimerTask;
37 |
38 | /**
39 | * Created by Belal on 12/30/2016.
40 | */
41 |
42 | public class MyService extends Service {
43 | //SharedPreferences sharedpreferences ;
44 | String s;
45 | Timer timer1;
46 | public MyService() {
47 |
48 | // sharedpreferences = getSharedPreferences(MainActivity.mypreference, Context.MODE_PRIVATE);
49 | }
50 | void getid(String s){
51 | this.s=s;
52 |
53 | }
54 |
55 |
56 | private void showNotification( ) {
57 | Intent notificationIntent = new Intent(this, MainActivity.class);
58 | notificationIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
59 | PendingIntent pendingIntent = PendingIntent.getActivity(this, 0,
60 | notificationIntent, 0);
61 | int iconId = R.drawable.logo;
62 | int uniqueCode = new Random().nextInt(Integer.MAX_VALUE);
63 | Notification notification = new NotificationCompat.Builder(this)
64 | .setSmallIcon(iconId)
65 | .setContentTitle("MFE Vehicle Tracker")
66 | .setContentText("Tracking Location of your device...")
67 | .setContentIntent(pendingIntent).build();
68 | startForeground(uniqueCode, notification);
69 |
70 |
71 |
72 | }
73 | public void callAsynchronousTask() {
74 | final Handler handler = new Handler();
75 | Timer timer = new Timer();
76 | TimerTask doAsynchronousTask = new TimerTask() {
77 | @Override
78 | public void run() {
79 | handler.post(new Runnable() {
80 | public void run() {
81 | try {
82 | sendgps();
83 | // Toast.makeText(null,"sdfsdf", Toast.LENGTH_LONG).show();
84 | } catch (Exception e) {
85 |
86 | }
87 | }
88 | });
89 | }
90 | };
91 | timer.schedule(doAsynchronousTask, 0, 15000);
92 |
93 | }
94 | public void sendgps() {
95 |
96 | Date c = Calendar.getInstance().getTime();
97 | //System.out.println("Current time => " + c);
98 | SimpleDateFormat fmt = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
99 | String formattedDate = fmt.format(c);
100 |
101 |
102 | //Toast.makeText(login.this, formattedDate, Toast.LENGTH_LONG).show();
103 | //String s =
104 | AsyncRetrieve2 sa = new AsyncRetrieve2();
105 | Uri.Builder builder1 = new Uri.Builder();
106 | GPSTracker gps = new GPSTracker(this);
107 | double latitude = gps.getLatitude();
108 | double longitude = gps.getLongitude();
109 | //getgps.php/?key=1345&lat=45&lon=55&AUId=2&lup=2018-09-04%2002:04:20
110 | if(latitude > 22 || longitude>22) {
111 | builder1.scheme("https")
112 | .authority("mfenter.com")
113 |
114 | .appendPath("tracker")
115 |
116 | .appendPath("getgps.php")
117 | .appendQueryParameter("key", "1345")
118 | .appendQueryParameter("AUId", login.sharedpreferences.getString("AUId", ""))
119 | .appendQueryParameter("lat", String.valueOf(latitude))
120 | .appendQueryParameter("lon", String.valueOf(longitude))
121 | .appendQueryParameter("lup", formattedDate);
122 | String myUrl1 = builder1.build().toString();
123 | sa.u = myUrl1;
124 | sa.execute();
125 | }
126 |
127 | // Toast.makeText(login.this, String.valueOf(latitude), Toast.LENGTH_LONG).show();
128 |
129 | }
130 | public void callAsynchronousTask1() {
131 | final Handler handler = new Handler();
132 | timer1 = new Timer();
133 | TimerTask doAsynchronousTask = new TimerTask() {
134 | @Override
135 | public void run() {
136 | handler.post(new Runnable() {
137 | public void run() {
138 | try {
139 | checkGPSStatus();
140 | } catch (Exception e) {
141 | // Toast.makeText(login.this, e.toString(), Toast.LENGTH_LONG).show();
142 | }
143 | }
144 | });
145 | }
146 | };
147 | timer1.schedule(doAsynchronousTask, 0, 5000); //execute in every 50000 ms
148 | }
149 | static int ncheck=0;
150 | private void checkGPSStatus() {
151 | LocationManager lm = (LocationManager)this.getSystemService(Context.LOCATION_SERVICE);
152 | boolean gps_enabled = false;
153 | boolean network_enabled = false;
154 |
155 | try {
156 | gps_enabled = lm.isProviderEnabled(LocationManager.GPS_PROVIDER);
157 | } catch(Exception ex) {}
158 |
159 | try {
160 | network_enabled = lm.isProviderEnabled(LocationManager.NETWORK_PROVIDER);
161 | } catch(Exception ex) {}
162 | Intent notificationIntent = new Intent( Settings.ACTION_LOCATION_SOURCE_SETTINGS);
163 |
164 | PendingIntent pendingIntent = PendingIntent.getActivity(this, 0,
165 | notificationIntent, 0);
166 | int iconId = R.drawable.logo;
167 | int uniqueCode = new Random().nextInt(Integer.MAX_VALUE);
168 | Notification notification = new NotificationCompat.Builder(this)
169 |
170 | .setSmallIcon(iconId)
171 | .setContentTitle("MFE Vehicle Tracker")
172 | .setContentText("Location is not Enabled.. Click to go to Settings!")
173 | .setOngoing(true)
174 | .setVibrate(new long[]{1000,1000,1000,1000,1000})
175 | .setLights(Color.RED,3000,3000)
176 | .setContentIntent(pendingIntent).build();
177 |
178 | NotificationManager nm = (NotificationManager)getSystemService(NOTIFICATION_SERVICE);
179 |
180 | if(!gps_enabled && !network_enabled) {
181 | // notify user
182 |
183 | if(ncheck==0) {
184 | nm.notify(1, notification);
185 | ncheck = 1;
186 | }
187 |
188 |
189 |
190 |
191 | // testdialog.show();
192 |
193 | }
194 | else{
195 | nm.cancel(1);
196 | ncheck=0;
197 | //testdialog.dismiss();
198 | }
199 | }
200 | public void sendgpstohistory() {
201 |
202 | Date c = Calendar.getInstance().getTime();
203 | //System.out.println("Current time => " + c);
204 | SimpleDateFormat fmt = new SimpleDateFormat("yyyy-MM-dd");
205 | String formattedDate = fmt.format(c);
206 |
207 | fmt = new SimpleDateFormat("HH:mm:ss");
208 | String formattedtm = fmt.format(c);
209 |
210 |
211 | //Toast.makeText(login.this, formattedDate, Toast.LENGTH_LONG).show();
212 | //String s =
213 | AsyncRetrieve2 sa = new AsyncRetrieve2();
214 | Uri.Builder builder1 = new Uri.Builder();
215 | GPSTracker gps = new GPSTracker(this);
216 | double latitude = gps.getLatitude();
217 | double longitude = gps.getLongitude();
218 | if(latitude >22 || longitude>22) {
219 | //inserthistory.php/?key=1345&lat=45&lon=55&username=ayesha222&dt=2018-09-04&tm=02:04:20
220 | builder1.scheme("https")
221 | .authority("mfenter.com")
222 |
223 | .appendPath("tracker")
224 | .appendPath("inserthistory.php")
225 | .appendQueryParameter("key", "1345")
226 | .appendQueryParameter("username", login.sharedpreferences.getString("username", ""))
227 | .appendQueryParameter("lat", String.valueOf(latitude))
228 | .appendQueryParameter("lon", String.valueOf(longitude))
229 | .appendQueryParameter("dt", formattedDate)
230 | .appendQueryParameter("tm", formattedtm);
231 | String myUrl1 = builder1.build().toString();
232 | sa.u = myUrl1;
233 | sa.execute();
234 | }
235 | else {
236 |
237 | // Toast.makeText(MyService.this, "Please Enable the Location Service!", Toast.LENGTH_LONG).show();
238 | }
239 | // Toast.makeText(login.this, String.valueOf(latitude), Toast.LENGTH_LONG).show();
240 |
241 | }
242 |
243 | @Override
244 | public IBinder onBind(Intent intent) {
245 | // TODO: Return the communication channel to the service.
246 | //Log.w("MyService", "onBind callback called");
247 | throw new UnsupportedOperationException("Not yet implemented");
248 | }
249 |
250 | @Override
251 | public int onStartCommand(Intent intent, int flags, int startId) {
252 | // Log.w("MyService", "onStartCommand callback called");
253 | callAsynchronousTask1();
254 | callAsynchronousTask();
255 | showNotification();
256 | return super.onStartCommand(intent, flags, startId);
257 |
258 |
259 | }
260 |
261 | @Override
262 | public void onCreate() {
263 | super.onCreate();
264 | // Log.w("MyService", "onCreate callback called");
265 | }
266 |
267 | @Override
268 | public void onDestroy() {
269 | ncheck=0;
270 | timer1.cancel();
271 |
272 | super.onDestroy();
273 | // Log.w("MyService", "onDestroy callback called");
274 | }
275 |
276 | public class AsyncRetrieve2 extends AsyncTask {
277 |
278 | HttpURLConnection conn;
279 | URL url = null;
280 | String u;
281 | String res;
282 |
283 | //this method will interact with UI, here display loading message
284 | @Override
285 | protected void onPreExecute() {
286 | super.onPreExecute();
287 |
288 | /* pdLoading.setMessage("\tLoading...");
289 | pdLoading.setCancelable(false);
290 | pdLoading.show();*/
291 |
292 | }
293 |
294 | // This method does not interact with UI, You need to pass result to onPostExecute to display
295 | @Override
296 | protected String doInBackground(String... params) {
297 | try {
298 | // Enter URL address where your php file resides
299 | url = new URL(u);
300 |
301 | } catch (MalformedURLException e) {
302 | // TODO Auto-generated catch block
303 | e.printStackTrace();
304 | return e.toString();
305 | }
306 | try {
307 |
308 | // Setup HttpURLConnection class to send and receive data from php
309 | conn = (HttpURLConnection) url.openConnection();
310 | conn.setRequestMethod("GET");
311 |
312 | // setDoOutput to true as we recieve data from json file
313 | conn.setDoOutput(true);
314 |
315 | } catch (IOException e1) {
316 | // TODO Auto-generated catch block
317 | e1.printStackTrace();
318 | return e1.toString();
319 | }
320 |
321 | try {
322 |
323 | int response_code = conn.getResponseCode();
324 |
325 | // Check if successful connection made
326 | if (response_code == HttpURLConnection.HTTP_OK) {
327 |
328 | // Read data sent from server
329 | InputStream input = conn.getInputStream();
330 | BufferedReader reader = new BufferedReader(new InputStreamReader(input));
331 | StringBuilder result = new StringBuilder();
332 | String line;
333 |
334 | while ((line = reader.readLine()) != null) {
335 | result.append(line);
336 | }
337 |
338 | // Pass data to onPostExecute method
339 | return (result.toString());
340 |
341 | } else {
342 |
343 | return ("unsuccessful");
344 | }
345 |
346 | } catch (IOException e) {
347 | e.printStackTrace();
348 | return e.toString();
349 | } finally {
350 | conn.disconnect();
351 | }
352 |
353 |
354 | }
355 |
356 | // this method will interact with UI, display result sent from doInBackground method
357 | @Override
358 | protected void onPostExecute(String result) {
359 |
360 | //pdLoading.dismiss();
361 |
362 | // you to understand error returned from doInBackground method
363 | /* res = result.toString();
364 | result.trim();
365 | if(res.equalsIgnoreCase("Succeed") ){
366 |
367 | Toast.makeText(login.this, "Log In Succesfull!", Toast.LENGTH_LONG).show();
368 | }
369 | else {
370 | Toast.makeText(login.this, "Username or password is incorrect!", Toast.LENGTH_LONG).show();
371 | }*/
372 |
373 | }
374 |
375 | }
376 | }
377 |
378 |
--------------------------------------------------------------------------------
/app/src/main/java/com/mfe/madeel/devicetracker/SplashScreen.java:
--------------------------------------------------------------------------------
1 | package com.mfe.madeel.devicetracker;
2 |
3 | import android.content.Intent;
4 | import android.os.Handler;
5 | import android.support.v7.app.AppCompatActivity;
6 | import android.os.Bundle;
7 |
8 | public class SplashScreen extends AppCompatActivity {
9 |
10 |
11 | private static int SPLASH_TIME_OUT = 2000;
12 |
13 | @Override
14 | protected void onCreate(Bundle savedInstanceState) {
15 | super.onCreate(savedInstanceState);
16 | //this.requestWindowFeature(Window.FEATURE_NO_TITLE);
17 | //this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN);
18 | setContentView(R.layout.activity_splash_screen);
19 |
20 | new Handler().postDelayed(new Runnable() {
21 |
22 | /*
23 | * Showing splash screen with a timer. This will be useful when you
24 | * want to show case your app logo / company
25 | */
26 |
27 | @Override
28 | public void run() {
29 | // This method will be executed once the timer is over
30 | // Start your app main activity
31 | Intent i = new Intent(SplashScreen.this, MainActivity.class);
32 | startActivity(i);
33 |
34 | // close this activity
35 | finish();
36 | }
37 | }, SPLASH_TIME_OUT);
38 | }}
--------------------------------------------------------------------------------
/app/src/main/java/com/mfe/madeel/devicetracker/login.java:
--------------------------------------------------------------------------------
1 | package com.mfe.madeel.devicetracker;
2 |
3 | import android.app.ActivityManager;
4 | import android.app.AlertDialog;
5 | import android.app.NotificationManager;
6 | import android.app.ProgressDialog;
7 | import android.content.Context;
8 | import android.content.DialogInterface;
9 | import android.content.Intent;
10 | import android.content.SharedPreferences;
11 | import android.content.pm.PackageManager;
12 | import android.location.LocationManager;
13 | import android.net.Uri;
14 | import android.os.AsyncTask;
15 | import android.os.Handler;
16 | import android.provider.Settings;
17 | import android.support.v4.app.ActivityCompat;
18 | import android.support.v4.content.ContextCompat;
19 | import android.support.v7.app.AppCompatActivity;
20 | import android.os.Bundle;
21 | import android.view.View;
22 | import android.widget.TextView;
23 | import android.widget.Toast;
24 |
25 | import org.json.JSONException;
26 | import org.json.JSONObject;
27 |
28 | import java.io.BufferedReader;
29 | import java.io.IOException;
30 | import java.io.InputStream;
31 | import java.io.InputStreamReader;
32 | import java.net.HttpURLConnection;
33 | import java.net.MalformedURLException;
34 | import java.net.URL;
35 | import java.text.SimpleDateFormat;
36 | import java.util.Calendar;
37 | import java.util.Date;
38 | import java.util.Timer;
39 | import java.util.TimerTask;
40 |
41 | public class login extends AppCompatActivity {
42 | public static int approval=1;
43 | private GPSTracker gpsTracker;
44 | TextView t,fname,lname,address,cellno,vehicleno,brokerno,cnic,partyname;
45 | static SharedPreferences sharedpreferences ;
46 | @Override
47 | protected void onCreate(Bundle savedInstanceState) {
48 | super.onCreate(savedInstanceState);
49 | setContentView(R.layout.activity_login);
50 | fname = (TextView)findViewById(R.id.txtfname);
51 | lname = (TextView)findViewById(R.id.txtlname);
52 | address = (TextView)findViewById(R.id.txtAddress);
53 | cellno = (TextView)findViewById(R.id.txtCEllno);
54 | vehicleno = (TextView)findViewById(R.id.txtVehicleno);
55 | brokerno = (TextView)findViewById(R.id.txtBrokername);
56 | cnic = (TextView)findViewById(R.id.txtcnic);
57 | partyname = (TextView)findViewById(R.id.txtpartyname);
58 | sharedpreferences = getSharedPreferences(MainActivity.mypreference, Context.MODE_PRIVATE);
59 | //Toast.makeText(login.this, sharedpreferences.getString("Approval",""), Toast.LENGTH_LONG).show();
60 |
61 |
62 | if(sharedpreferences.getString("Approval","").equals("0")){
63 | Intent activityChangeIntent = new Intent(login.this, Approve.class);
64 |
65 | // currentContext.startActivity(activityChangeIntent);
66 | finishAffinity();
67 |
68 | login.this.startActivity(activityChangeIntent);
69 |
70 |
71 | }
72 | else {
73 | try {
74 |
75 | if (ContextCompat.checkSelfPermission(getApplicationContext(), android.Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
76 | ActivityCompat.requestPermissions(this, new String[]{android.Manifest.permission.ACCESS_FINE_LOCATION}, 101);
77 | }
78 | else {
79 | if (!isMyServiceRunning(MyService.class)) {
80 | Intent myServiceIntent = new Intent(this, MyService.class);
81 | startService(myServiceIntent);
82 | }
83 | }
84 |
85 |
86 | } catch (Exception e) {
87 | e.printStackTrace();
88 | }
89 |
90 | sharedpreferences = getSharedPreferences(MainActivity.mypreference, Context.MODE_PRIVATE);
91 | t = (TextView) findViewById(R.id.username);
92 | t.setText( " Username: "+ sharedpreferences.getString("username", ""));
93 |
94 |
95 | final Handler handler = new Handler();
96 | final Timer timer = new Timer();
97 | final TimerTask doAsynchronousTask = new TimerTask() {
98 | @Override
99 | public void run() {
100 | handler.post(new Runnable() {
101 | public void run() {
102 | try {
103 | AsyncRetrieve3 as = new AsyncRetrieve3();
104 | //"loaddetails.php?key=1234&AUId=52";
105 | String Auiid = sharedpreferences.getString("AUId", "");
106 |
107 | Uri.Builder builder1 = new Uri.Builder();
108 |
109 | builder1.scheme("https")
110 | .authority("mfenter.com")
111 |
112 | .appendPath("tracker")
113 |
114 | .appendPath("loaddetails.php")
115 | .appendQueryParameter("key","1234")
116 | .appendQueryParameter("AUId", Auiid);
117 |
118 | String myUrl1 = builder1.build().toString();
119 | as.u = myUrl1;
120 |
121 | as.execute();
122 | } catch (Exception e) {
123 | // Toast.makeText(Approve.this, e.toString(), Toast.LENGTH_LONG).show();
124 | }
125 | }
126 | });
127 | }
128 | };
129 | timer.schedule(doAsynchronousTask, 0, 30000 );
130 | //loaddetails.php?key=1234&AUId=52
131 |
132 |
133 |
134 | //GPSTracker g = new GPSTracker(this);
135 | //Toast.makeText(login.this, sharedpreferences.getString("Approval","").equals("0"), Toast.LENGTH_LONG).show();
136 |
137 |
138 | }
139 |
140 | //callAsynchronousTask();
141 | }
142 | @Override
143 | public void onRequestPermissionsResult(int requestCode,
144 | String permissions[], int[] grantResults) {
145 | switch (requestCode) {
146 | case 101: {
147 |
148 | // If request is cancelled, the result arrays are empty.
149 | if (grantResults.length > 0
150 | && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
151 | if (!isMyServiceRunning(MyService.class)) {
152 | Intent myServiceIntent = new Intent(this, MyService.class);
153 | startService(myServiceIntent);
154 | }
155 |
156 | // permission was granted, yay! Do the
157 | // contacts-related task you need to do.
158 | } else {
159 | // Toast.makeText(login.this, "Permission denied!", Toast.LENGTH_SHORT).show();
160 | //finish();
161 | if (ContextCompat.checkSelfPermission(getApplicationContext(), android.Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
162 | ActivityCompat.requestPermissions(this, new String[]{android.Manifest.permission.ACCESS_FINE_LOCATION}, 101);
163 | }
164 | // permission denied, boo! Disable the
165 | // functionality that depends on this permission.
166 |
167 | }
168 | return;
169 | }
170 |
171 | // other 'case' lines to check for other
172 | // permissions this app might request
173 | }
174 | }
175 | private boolean isMyServiceRunning(Class> serviceClass) {
176 | ActivityManager manager = (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE);
177 | for (ActivityManager.RunningServiceInfo service : manager.getRunningServices(Integer.MAX_VALUE)) {
178 | if (serviceClass.getName().equals(service.service.getClassName())) {
179 | return true;
180 | }
181 | }
182 | return false;
183 | }
184 | private void checkGPSStatus() {
185 | LocationManager lm = (LocationManager)this.getSystemService(Context.LOCATION_SERVICE);
186 | boolean gps_enabled = false;
187 | boolean network_enabled = false;
188 |
189 | try {
190 | gps_enabled = lm.isProviderEnabled(LocationManager.GPS_PROVIDER);
191 | } catch(Exception ex) {}
192 |
193 | try {
194 | network_enabled = lm.isProviderEnabled(LocationManager.NETWORK_PROVIDER);
195 | } catch(Exception ex) {}
196 | AlertDialog.Builder dialog = new AlertDialog.Builder(this);
197 | dialog.setMessage("Location Service is not enabled! Please Enable it.");
198 | dialog.setPositiveButton("Go To Settings", new DialogInterface.OnClickListener() {
199 | @Override
200 | public void onClick(DialogInterface paramDialogInterface, int paramInt) {
201 | // TODO Auto-generated method stub
202 | Intent myIntent = new Intent( Settings.ACTION_LOCATION_SOURCE_SETTINGS);
203 | startActivity(myIntent);
204 | //get gps
205 | }
206 | });
207 | dialog.setCancelable(true);
208 | AlertDialog testdialog = dialog.create();
209 | if(!gps_enabled && !network_enabled) {
210 | // notify user
211 |
212 |
213 |
214 | testdialog.show();
215 |
216 | }
217 | else{
218 | testdialog.dismiss();
219 | }
220 | }
221 | public void callAsynchronousTask() {
222 | final Handler handler = new Handler();
223 | Timer timer = new Timer();
224 | TimerTask doAsynchronousTask = new TimerTask() {
225 | @Override
226 | public void run() {
227 | handler.post(new Runnable() {
228 | public void run() {
229 | try {
230 | checkGPSStatus();
231 | } catch (Exception e) {
232 | // Toast.makeText(login.this, e.toString(), Toast.LENGTH_LONG).show();
233 | }
234 | }
235 | });
236 | }
237 | };
238 | timer.schedule(doAsynchronousTask, 0, 6000); //execute in every 50000 ms
239 | }
240 | public void sendgps() {
241 |
242 | Date c = Calendar.getInstance().getTime();
243 | //System.out.println("Current time => " + c);
244 | SimpleDateFormat fmt = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
245 | String formattedDate = fmt.format(c);
246 |
247 |
248 | //Toast.makeText(login.this, formattedDate, Toast.LENGTH_LONG).show();
249 | String s = sharedpreferences.getString("AUId", "");
250 | AsyncRetrieve2 sa = new AsyncRetrieve2();
251 | Uri.Builder builder1 = new Uri.Builder();
252 | GPSTracker gps = new GPSTracker(this);
253 | double latitude = gps.getLatitude();
254 | double longitude = gps.getLongitude();
255 | //getgps.php/?key=1345&lat=45&lon=55&AUId=2&lup=2018-09-04%2002:04:20
256 | builder1.scheme("https")
257 | .authority("mfenter.com")
258 |
259 | .appendPath("tracker")
260 |
261 | .appendPath("getgps.php")
262 | .appendQueryParameter("key","1345")
263 | .appendQueryParameter("AUId", s)
264 | .appendQueryParameter("lat", String.valueOf(latitude))
265 | .appendQueryParameter("lon",String.valueOf(longitude))
266 | .appendQueryParameter("lup", formattedDate );
267 | String myUrl1 = builder1.build().toString();
268 | sa.u = myUrl1;
269 | sa.execute();
270 | // Toast.makeText(login.this, String.valueOf(latitude), Toast.LENGTH_LONG).show();
271 |
272 | }
273 | public void logout(View view){
274 | Intent stopServiceIntent = new Intent(this, MyService.class);
275 | stopService(stopServiceIntent);
276 | SharedPreferences sharedpreferences = getSharedPreferences(MainActivity.mypreference, Context.MODE_PRIVATE);
277 | SharedPreferences.Editor editor = sharedpreferences.edit();
278 | editor.clear();
279 | editor.commit();
280 | Intent activityChangeIntent = new Intent(login.this,MainActivity.class);
281 |
282 | // currentContext.startActivity(activityChangeIntent);
283 | finishAffinity();
284 | NotificationManager nm = (NotificationManager)getSystemService(NOTIFICATION_SERVICE);
285 | nm.cancel(1);
286 | login.this.startActivity(activityChangeIntent);
287 | }
288 | public class AsyncRetrieve2 extends AsyncTask {
289 | ProgressDialog pdLoading = new ProgressDialog(login.this);
290 | HttpURLConnection conn;
291 | URL url = null;
292 | String u;
293 | String res;
294 |
295 | //this method will interact with UI, here display loading message
296 | @Override
297 | protected void onPreExecute() {
298 | super.onPreExecute();
299 |
300 | /* pdLoading.setMessage("\tLoading...");
301 | pdLoading.setCancelable(false);
302 | pdLoading.show();*/
303 |
304 | }
305 |
306 | // This method does not interact with UI, You need to pass result to onPostExecute to display
307 | @Override
308 | protected String doInBackground(String... params) {
309 | try {
310 | // Enter URL address where your php file resides
311 | url = new URL(u);
312 |
313 | } catch (MalformedURLException e) {
314 | // TODO Auto-generated catch block
315 | e.printStackTrace();
316 | return e.toString();
317 | }
318 | try {
319 |
320 | // Setup HttpURLConnection class to send and receive data from php
321 | conn = (HttpURLConnection) url.openConnection();
322 | conn.setRequestMethod("GET");
323 |
324 | // setDoOutput to true as we recieve data from json file
325 | conn.setDoOutput(true);
326 |
327 | } catch (IOException e1) {
328 | // TODO Auto-generated catch block
329 | e1.printStackTrace();
330 | return e1.toString();
331 | }
332 |
333 | try {
334 |
335 | int response_code = conn.getResponseCode();
336 |
337 | // Check if successful connection made
338 | if (response_code == HttpURLConnection.HTTP_OK) {
339 |
340 | // Read data sent from server
341 | InputStream input = conn.getInputStream();
342 | BufferedReader reader = new BufferedReader(new InputStreamReader(input));
343 | StringBuilder result = new StringBuilder();
344 | String line;
345 |
346 | while ((line = reader.readLine()) != null) {
347 | result.append(line);
348 | }
349 |
350 | // Pass data to onPostExecute method
351 | return (result.toString());
352 |
353 | } else {
354 |
355 | return ("unsuccessful");
356 | }
357 |
358 | } catch (IOException e) {
359 | e.printStackTrace();
360 | return e.toString();
361 | } finally {
362 | conn.disconnect();
363 | }
364 |
365 |
366 | }
367 |
368 | // this method will interact with UI, display result sent from doInBackground method
369 | @Override
370 | protected void onPostExecute(String result) {
371 |
372 | //pdLoading.dismiss();
373 |
374 | // you to understand error returned from doInBackground method
375 | /* res = result.toString();
376 | result.trim();
377 | if(res.equalsIgnoreCase("Succeed") ){
378 |
379 | Toast.makeText(login.this, "Log In Succesfull!", Toast.LENGTH_LONG).show();
380 | }
381 | else {
382 | Toast.makeText(login.this, "Username or password is incorrect!", Toast.LENGTH_LONG).show();
383 | }*/
384 |
385 | }
386 |
387 | }
388 | public class AsyncRetrieve3 extends AsyncTask {
389 |
390 | HttpURLConnection conn;
391 | URL url = null;
392 | String u;
393 | String res;
394 |
395 | //this method will interact with UI, here display loading message
396 | @Override
397 | protected void onPreExecute() {
398 | super.onPreExecute();
399 |
400 | /* pdLoading.setMessage("\tLoading...");
401 | pdLoading.setCancelable(false);
402 | pdLoading.show();*/
403 |
404 | }
405 |
406 | // This method does not interact with UI, You need to pass result to onPostExecute to display
407 | @Override
408 | protected String doInBackground(String... params) {
409 | try {
410 | // Enter URL address where your php file resides
411 | url = new URL(u);
412 |
413 | } catch (MalformedURLException e) {
414 | // TODO Auto-generated catch block
415 | e.printStackTrace();
416 | return e.toString();
417 | }
418 | try {
419 |
420 | // Setup HttpURLConnection class to send and receive data from php
421 | conn = (HttpURLConnection) url.openConnection();
422 | conn.setRequestMethod("GET");
423 |
424 | // setDoOutput to true as we recieve data from json file
425 | conn.setDoOutput(true);
426 |
427 | } catch (IOException e1) {
428 | // TODO Auto-generated catch block
429 | e1.printStackTrace();
430 | return e1.toString();
431 | }
432 |
433 | try {
434 |
435 | int response_code = conn.getResponseCode();
436 |
437 | // Check if successful connection made
438 | if (response_code == HttpURLConnection.HTTP_OK) {
439 |
440 | // Read data sent from server
441 | InputStream input = conn.getInputStream();
442 | BufferedReader reader = new BufferedReader(new InputStreamReader(input));
443 | StringBuilder result = new StringBuilder();
444 | String line;
445 |
446 | while ((line = reader.readLine()) != null) {
447 | result.append(line);
448 | }
449 |
450 | // Pass data to onPostExecute method
451 | return (result.toString());
452 |
453 | } else {
454 |
455 | return ("unsuccessful");
456 | }
457 |
458 | } catch (IOException e) {
459 | e.printStackTrace();
460 | return e.toString();
461 | } finally {
462 | conn.disconnect();
463 | }
464 |
465 |
466 | }
467 |
468 | // this method will interact with UI, display result sent from doInBackground method
469 | @Override
470 | protected void onPostExecute(String result) {
471 |
472 | //pdLoading.dismiss();
473 |
474 | // you to understand error returned from doInBackground method
475 | /* res = result.toString();
476 | result.trim();
477 | if(res.equalsIgnoreCase("Succeed") ){
478 |
479 | Toast.makeText(login.this, "Log In Succesfull!", Toast.LENGTH_LONG).show();
480 | }
481 | else {
482 | Toast.makeText(login.this, "Username or password is incorrect!", Toast.LENGTH_LONG).show();
483 | }*/
484 | try {
485 | JSONObject obj = new JSONObject(result);
486 | fname.setText("First Name: "+obj.get("firstname").toString());
487 | lname.setText("Last Name: "+obj.get("lastname").toString());
488 | address.setText("Address: "+obj.get("address").toString());
489 | cellno.setText("Cell No: "+obj.get("cellno").toString());
490 | vehicleno.setText("Vehicle No: "+obj.get("vehicleno").toString());
491 | brokerno.setText("Broker No: "+ obj.get("brokerno").toString());
492 | cnic.setText("CNIC No: "+ obj.get("cnic").toString());
493 | partyname.setText("Party Name: "+ obj.get("partyname").toString());
494 |
495 | if(obj.get("status").toString().trim().equals("0")){
496 | Toast.makeText(login.this, "User no longer active!", Toast.LENGTH_LONG).show();
497 | Intent stopServiceIntent = new Intent(login.this, MyService.class);
498 | stopService(stopServiceIntent);
499 | SharedPreferences sharedpreferences = getSharedPreferences(MainActivity.mypreference, Context.MODE_PRIVATE);
500 | SharedPreferences.Editor editor = sharedpreferences.edit();
501 | editor.clear();
502 | editor.commit();
503 | Intent activityChangeIntent = new Intent(login.this,MainActivity.class);
504 |
505 | // currentContext.startActivity(activityChangeIntent);
506 | finishAffinity();
507 | NotificationManager nm = (NotificationManager)getSystemService(NOTIFICATION_SERVICE);
508 | nm.cancel(1);
509 | login.this.startActivity(activityChangeIntent);
510 | }
511 | } catch (JSONException e) {
512 | e.printStackTrace();
513 | }
514 |
515 | }
516 |
517 | }
518 | @Override
519 | public void onBackPressed() {
520 | moveTaskToBack(true);
521 | }}
522 |
523 |
--------------------------------------------------------------------------------
/app/src/main/java/com/mfe/madeel/devicetracker/register.java:
--------------------------------------------------------------------------------
1 | package com.mfe.madeel.devicetracker;
2 | import android.app.ProgressDialog;
3 | import android.content.Context;
4 | import android.content.Intent;
5 | import android.content.SharedPreferences;
6 |
7 | import android.net.Uri;
8 | import android.os.AsyncTask;
9 |
10 | import android.support.v7.app.AppCompatActivity;
11 | import android.os.Bundle;
12 | import android.view.View;
13 | import android.widget.Button;
14 | import android.widget.EditText;
15 | import android.widget.Toast;
16 |
17 | import java.io.BufferedReader;
18 | import java.io.IOException;
19 | import java.io.InputStream;
20 | import java.io.InputStreamReader;
21 | import java.net.HttpURLConnection;
22 | import java.net.MalformedURLException;
23 | import java.net.URL;
24 | import java.text.SimpleDateFormat;
25 | import java.util.Calendar;
26 | import java.util.Date;
27 |
28 | public class register extends AppCompatActivity {
29 | EditText username,password,rpassword,firstname,lastname,address,cellno,brokerno,cnic,vehicleno,partyname;
30 | Button uploadbtn;
31 | public static final int CONNECTION_TIMEOUT = 50000;
32 | public static final int READ_TIMEOUT = 15000;
33 | @Override
34 | protected void onCreate(Bundle savedInstanceState) {
35 | super.onCreate(savedInstanceState);
36 |
37 | setContentView(R.layout.activity_register);
38 | username =(EditText)findViewById(R.id.txtuserame);
39 | password =(EditText)findViewById(R.id.txtpass);
40 | rpassword =(EditText)findViewById(R.id.txtrpass);
41 |
42 | firstname =(EditText)findViewById(R.id.txtfname);
43 | lastname =(EditText)findViewById(R.id.txtlname);
44 | address =(EditText)findViewById(R.id.txtAddress);
45 | cellno =(EditText)findViewById(R.id.txtCEllno);
46 | brokerno =(EditText)findViewById(R.id.txtBrokername);
47 | cnic =(EditText)findViewById(R.id.txtcnic);
48 | vehicleno =(EditText)findViewById(R.id.txtVehicleno);
49 | partyname =(EditText)findViewById(R.id.txtpartyname);
50 |
51 |
52 |
53 |
54 | }
55 |
56 |
57 |
58 | public void regtbn(View v){
59 | if(password.getText().toString().isEmpty() || rpassword.getText().toString().isEmpty())
60 | {
61 | Toast.makeText(register.this, "password is required!", Toast.LENGTH_LONG).show();
62 | }
63 | else if(password.getText().toString().length()<4 || rpassword.getText().toString().length()<4){
64 | Toast.makeText(register.this, "Password should contain atleast 4 characters!", Toast.LENGTH_LONG).show();
65 | }
66 | else {
67 |
68 | //register.php?key=1234&username=ayesha&password=1234&cdate=2018-9-3
69 |
70 | if(password.getText().toString().equals(rpassword.getText().toString())){
71 | Date c = Calendar.getInstance().getTime();
72 | //System.out.println("Current time => " + c);
73 |
74 | SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
75 | String formattedDate = df.format(c);
76 | //Toast.makeText(register.this, formattedDate, Toast.LENGTH_LONG).show();
77 | Uri.Builder builder = new Uri.Builder();
78 | builder.scheme("https")
79 | .authority("mfenter.com")
80 |
81 | .appendPath("tracker")
82 | .appendPath("register.php")
83 | .appendQueryParameter("key","1234")
84 | .appendQueryParameter("username", username.getText().toString())
85 | .appendQueryParameter("password", password.getText().toString())
86 | .appendQueryParameter("cdate",formattedDate);
87 |
88 |
89 | String myUrl = builder.build().toString();
90 | AsyncRetrieve as = new AsyncRetrieve();
91 | as.execute();
92 | as.u = myUrl;
93 |
94 |
95 |
96 |
97 |
98 | }
99 | else {
100 | Toast.makeText(register.this, "Passwords does not matched!", Toast.LENGTH_LONG).show();
101 | }
102 |
103 | }
104 |
105 | }
106 |
107 |
108 | private class AsyncRetrieve extends AsyncTask {
109 | ProgressDialog pdLoading = new ProgressDialog(register.this);
110 | HttpURLConnection conn;
111 | URL url = null;
112 | String u;
113 | String res;
114 |
115 | //this method will interact with UI, here display loading message
116 | @Override
117 | protected void onPreExecute() {
118 | super.onPreExecute();
119 |
120 | pdLoading.setMessage("\tCreating Account...");
121 | pdLoading.setCancelable(true);
122 | pdLoading.show();
123 |
124 | }
125 |
126 | // This method does not interact with UI, You need to pass result to onPostExecute to display
127 | @Override
128 | protected String doInBackground(String... params) {
129 | try {
130 | // Enter URL address where your php file resides
131 | url = new URL(u);
132 |
133 | } catch (MalformedURLException e) {
134 | // TODO Auto-generated catch block
135 | e.printStackTrace();
136 | return e.toString();
137 | }
138 | try {
139 |
140 | // Setup HttpURLConnection class to send and receive data from php
141 | conn = (HttpURLConnection) url.openConnection();
142 | conn.setReadTimeout(READ_TIMEOUT);
143 | conn.setConnectTimeout(CONNECTION_TIMEOUT);
144 | conn.setRequestMethod("GET");
145 |
146 | // setDoOutput to true as we recieve data from json file
147 | conn.setDoOutput(true);
148 |
149 | } catch (Exception e1) {
150 | // TODO Auto-generated catch block
151 | e1.printStackTrace();
152 | Toast.makeText(register.this, e1.toString(), Toast.LENGTH_LONG).show();
153 | return e1.toString();
154 |
155 | }
156 |
157 | try {
158 |
159 | int response_code = conn.getResponseCode();
160 |
161 | // Check if successful connection made
162 | if (response_code == HttpURLConnection.HTTP_OK) {
163 |
164 | // Read data sent from server
165 | InputStream input = conn.getInputStream();
166 | BufferedReader reader = new BufferedReader(new InputStreamReader(input));
167 | StringBuilder result = new StringBuilder();
168 | String line;
169 |
170 | while ((line = reader.readLine()) != null) {
171 | result.append(line);
172 | }
173 |
174 | // Pass data to onPostExecute method
175 | return (result.toString());
176 |
177 | } else {
178 |
179 | return ("unsuccessful");
180 | }
181 |
182 | } catch (Exception e) {
183 |
184 | // Toast.makeText(register.this, e.toString(), Toast.LENGTH_LONG).show();
185 | e.printStackTrace();
186 | return e.toString();
187 | } finally {
188 | conn.disconnect();
189 | }
190 |
191 |
192 | }
193 |
194 | // this method will interact with UI, display result sent from doInBackground method
195 | @Override
196 | protected void onPostExecute(String result) {
197 | pdLoading.dismiss();
198 |
199 | SharedPreferences sharedpreferences = getSharedPreferences(MainActivity.mypreference, Context.MODE_PRIVATE);
200 |
201 | if (result.toString().equalsIgnoreCase("1")) {
202 | // you to understand error returned from doInBackground method
203 | sharedpreferences = getSharedPreferences(MainActivity.mypreference,
204 | Context.MODE_PRIVATE);
205 | // Toast.makeText(register.this, "Registration Succesfull!", Toast.LENGTH_LONG).show();
206 | SharedPreferences.Editor editor = sharedpreferences.edit();
207 | editor.putString("username", username.getText().toString());
208 | editor.putString("password", password.getText().toString());
209 | editor.commit();
210 | AsyncRetrieve1 as = new AsyncRetrieve1();
211 | Uri.Builder builder = new Uri.Builder();
212 | builder.scheme("https")
213 | .authority("mfenter.com")
214 |
215 | .appendPath("tracker")
216 |
217 | .appendPath("getauid.php")
218 | .appendQueryParameter("key", "1345")
219 | .appendQueryParameter("username", username.getText().toString());
220 |
221 |
222 | String myUrl = builder.build().toString();
223 |
224 | as.execute();
225 |
226 |
227 | as.u = myUrl;
228 |
229 | } else {
230 | Toast.makeText(register.this, result.toString(), Toast.LENGTH_LONG).show();
231 |
232 | }
233 |
234 |
235 |
236 |
237 | }
238 |
239 | /*t2.setText(result.toString());
240 | SharedPreferences.Editor editor = sharedpreferences.edit();
241 | editor.putString("id" , result.toString());
242 | sendgps();
243 | /* res = result.toString();
244 | result.trim();
245 | if(res.equalsIgnoreCase("Succeed") ){
246 |
247 | Toast.makeText(login.this, "Log In Succesfull!", Toast.LENGTH_LONG).show();
248 | }
249 | else {
250 | Toast.makeText(login.this, "Username or password is incorrect!", Toast.LENGTH_LONG).show();
251 | }*/
252 |
253 | }
254 |
255 |
256 |
257 |
258 | private class AsyncRetrieve1 extends AsyncTask {
259 | ProgressDialog pdLoading = new ProgressDialog(register.this);
260 | HttpURLConnection conn;
261 | URL url = null;
262 | String u;
263 | String res;
264 |
265 | public AsyncRetrieve1() {
266 |
267 | }
268 |
269 | //this method will interact with UI, here display loading message
270 | @Override
271 | protected void onPreExecute() {
272 | super.onPreExecute();
273 |
274 | pdLoading.setMessage("\tUploading details..");
275 | pdLoading.setCancelable(true);
276 | pdLoading.show();
277 |
278 | }
279 |
280 | // This method does not interact with UI, You need to pass result to onPostExecute to display
281 | @Override
282 | protected String doInBackground(String... params) {
283 | try {
284 | // Enter URL address where your php file resides
285 | url = new URL(u);
286 |
287 | } catch (MalformedURLException e) {
288 | // TODO Auto-generated catch block
289 | e.printStackTrace();
290 | return e.toString();
291 | }
292 | try {
293 |
294 | // Setup HttpURLConnection class to send and receive data from php
295 | conn = (HttpURLConnection) url.openConnection();
296 | conn.setRequestMethod("GET");
297 |
298 | // setDoOutput to true as we recieve data from json file
299 | conn.setDoOutput(true);
300 |
301 | } catch (IOException e1) {
302 |
303 | // TODO Auto-generated catch block
304 | e1.printStackTrace();
305 | return e1.toString();
306 | }
307 |
308 | try {
309 |
310 | int response_code = conn.getResponseCode();
311 |
312 | // Check if successful connection made
313 | if (response_code == HttpURLConnection.HTTP_OK) {
314 |
315 | // Read data sent from server
316 | InputStream input = conn.getInputStream();
317 | BufferedReader reader = new BufferedReader(new InputStreamReader(input));
318 | StringBuilder result = new StringBuilder();
319 | String line;
320 |
321 | while ((line = reader.readLine()) != null) {
322 | result.append(line);
323 | }
324 |
325 | // Pass data to onPostExecute method
326 | return (result.toString());
327 |
328 | } else {
329 |
330 | return ("unsuccessful");
331 | }
332 |
333 | } catch (IOException e) {
334 |
335 |
336 | e.printStackTrace();
337 | return e.toString();
338 | } finally {
339 | conn.disconnect();
340 | }
341 |
342 |
343 | }
344 |
345 |
346 |
347 | // this method will interact with UI, display result sent from doInBackground method
348 | @Override
349 | protected void onPostExecute(String result) {
350 | pdLoading.dismiss();
351 | SharedPreferences sharedpreferences = getSharedPreferences(MainActivity.mypreference, Context.MODE_PRIVATE);
352 |
353 | // you to understand error returned from doInBackground method
354 | result.trim();
355 |
356 | res = result.toString();
357 | SharedPreferences.Editor editor = sharedpreferences.edit();
358 | editor.putString("AUId", res);
359 | editor.putString("Approval","0");
360 | editor.putString("username",username.getText().toString());
361 | editor.commit();
362 | login.approval=0;
363 | //Toast.makeText(register.this, res, Toast.LENGTH_LONG).show();
364 | //insertdetails.php?key=1234&auid=108&fname=adeel&lname=khan&address=5-e%20NOrth%20karachi&cellno=94504890&vehicleno=859049&brokerno=8880&cnic=49508940329&pname=asjdkfl&pic=409jkalnocfsd
365 | Uri.Builder builder = new Uri.Builder();
366 | builder.scheme("https")
367 | .authority("mfenter.com")
368 |
369 | .appendPath("tracker")
370 | .appendPath("insertdetails.php")
371 | .appendQueryParameter("key", "1234")
372 | .appendQueryParameter("auid", res)
373 | .appendQueryParameter("fname", firstname.getText().toString())
374 | .appendQueryParameter("lname", lastname.getText().toString())
375 | .appendQueryParameter("address", address.getText().toString())
376 | .appendQueryParameter("cellno", cellno.getText().toString())
377 | .appendQueryParameter("vehicleno", vehicleno.getText().toString())
378 | .appendQueryParameter("brokerno", brokerno.getText().toString())
379 | .appendQueryParameter("cnic", cnic.getText().toString())
380 | .appendQueryParameter("pname", partyname.getText().toString());
381 | String myUrl = builder.build().toString();
382 | AsyncRetrieve2 as = new AsyncRetrieve2();
383 | as.u = myUrl;
384 | as.execute();
385 |
386 |
387 |
388 | }
389 |
390 | }
391 | private class AsyncRetrieve2 extends AsyncTask {
392 | ProgressDialog pdLoading = new ProgressDialog(register.this);
393 | HttpURLConnection conn;
394 | URL url = null;
395 | String u;
396 | String res;
397 |
398 | public AsyncRetrieve2() {
399 |
400 | }
401 |
402 | //this method will interact with UI, here display loading message
403 | @Override
404 | protected void onPreExecute() {
405 | super.onPreExecute();
406 |
407 | pdLoading.setMessage("\tUploading details..");
408 | pdLoading.setCancelable(true);
409 | pdLoading.show();
410 |
411 | }
412 |
413 | // This method does not interact with UI, You need to pass result to onPostExecute to display
414 | @Override
415 | protected String doInBackground(String... params) {
416 | try {
417 | // Enter URL address where your php file resides
418 | url = new URL(u);
419 |
420 | } catch (MalformedURLException e) {
421 | // TODO Auto-generated catch block
422 | e.printStackTrace();
423 | return e.toString();
424 | }
425 | try {
426 |
427 | // Setup HttpURLConnection class to send and receive data from php
428 | conn = (HttpURLConnection) url.openConnection();
429 | conn.setRequestMethod("GET");
430 |
431 | // setDoOutput to true as we recieve data from json file
432 | conn.setDoOutput(true);
433 |
434 | } catch (IOException e1) {
435 | cancel(true);
436 | // TODO Auto-generated catch block
437 | e1.printStackTrace();
438 | return e1.toString();
439 | }
440 |
441 | try {
442 |
443 | int response_code = conn.getResponseCode();
444 |
445 | // Check if successful connection made
446 | if (response_code == HttpURLConnection.HTTP_OK) {
447 |
448 | // Read data sent from server
449 | InputStream input = conn.getInputStream();
450 | BufferedReader reader = new BufferedReader(new InputStreamReader(input));
451 | StringBuilder result = new StringBuilder();
452 | String line;
453 |
454 | while ((line = reader.readLine()) != null) {
455 | result.append(line);
456 | }
457 |
458 | // Pass data to onPostExecute method
459 | return (result.toString());
460 |
461 | } else {
462 |
463 | return ("unsuccessful");
464 | }
465 |
466 | } catch (IOException e) {
467 |
468 | cancel(true);
469 | e.printStackTrace();
470 | return e.toString();
471 | } finally {
472 | conn.disconnect();
473 | }
474 |
475 |
476 | }
477 |
478 | SharedPreferences sharedpreferences = getSharedPreferences(MainActivity.mypreference, Context.MODE_PRIVATE);
479 |
480 | // this method will interact with UI, display result sent from doInBackground method
481 | @Override
482 | protected void onPostExecute(String result) {
483 | pdLoading.dismiss();
484 |
485 |
486 |
487 | Toast.makeText(register.this, "Account Created!!", Toast.LENGTH_LONG).show();
488 | Intent activityChangeIntent = new Intent(register.this, Approve.class);
489 |
490 | // currentContext.startActivity(activityChangeIntent);
491 | finishAffinity();
492 | finish();
493 |
494 | register.this.startActivity(activityChangeIntent);
495 |
496 |
497 |
498 | }
499 |
500 | }}
501 |
502 |
503 |
504 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/logo.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/madeel20/Vehicle-Tracking-System-AndroidApp-PHP/9590f38af481e09d614b3b1f67daa950aeb342cb/app/src/main/res/drawable/logo.jpg
--------------------------------------------------------------------------------
/app/src/main/res/drawable/logo1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/madeel20/Vehicle-Tracking-System-AndroidApp-PHP/9590f38af481e09d614b3b1f67daa950aeb342cb/app/src/main/res/drawable/logo1.jpg
--------------------------------------------------------------------------------
/app/src/main/res/drawable/logochange.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/madeel20/Vehicle-Tracking-System-AndroidApp-PHP/9590f38af481e09d614b3b1f67daa950aeb342cb/app/src/main/res/drawable/logochange.jpg
--------------------------------------------------------------------------------
/app/src/main/res/drawable/logoqurvex.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/madeel20/Vehicle-Tracking-System-AndroidApp-PHP/9590f38af481e09d614b3b1f67daa950aeb342cb/app/src/main/res/drawable/logoqurvex.jpg
--------------------------------------------------------------------------------
/app/src/main/res/drawable/spl.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/madeel20/Vehicle-Tracking-System-AndroidApp-PHP/9590f38af481e09d614b3b1f67daa950aeb342cb/app/src/main/res/drawable/spl.jpg
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_approve.xml:
--------------------------------------------------------------------------------
1 |
2 |
12 |
13 |
21 |
22 |
32 |
33 |
47 |
48 |
58 |
59 |
70 |
71 |
80 |
81 |
82 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_login.xml:
--------------------------------------------------------------------------------
1 |
2 |
12 |
19 |
20 |
31 |
32 |
41 |
42 |
51 |
52 |
61 |
62 |
71 |
72 |
81 |
82 |
91 |
92 |
101 |
102 |
111 |
112 |
121 |
122 |
131 |
132 |
141 |
142 |
151 |
152 |
153 |
154 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
14 |
22 |
23 |
33 |
45 |
46 |
59 |
60 |
73 |
74 |
88 |
89 |
90 |
91 |
92 |
93 |
102 |
103 |
104 |
105 |
106 |
107 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_register.xml:
--------------------------------------------------------------------------------
1 |
2 |
13 |
21 |
32 |
33 |
49 |
50 |
64 |
75 |
76 |
89 |
90 |
103 |
104 |
121 |
122 |
136 |
137 |
151 |
152 |
167 |
168 |
182 |
183 |
197 |
198 |
212 |
213 |
225 |
226 |
234 |
235 |
236 |
237 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_splash_screen.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
14 |
15 |
24 |
25 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/madeel20/Vehicle-Tracking-System-AndroidApp-PHP/9590f38af481e09d614b3b1f67daa950aeb342cb/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/madeel20/Vehicle-Tracking-System-AndroidApp-PHP/9590f38af481e09d614b3b1f67daa950aeb342cb/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/madeel20/Vehicle-Tracking-System-AndroidApp-PHP/9590f38af481e09d614b3b1f67daa950aeb342cb/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/madeel20/Vehicle-Tracking-System-AndroidApp-PHP/9590f38af481e09d614b3b1f67daa950aeb342cb/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/madeel20/Vehicle-Tracking-System-AndroidApp-PHP/9590f38af481e09d614b3b1f67daa950aeb342cb/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/values-w820dp/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 64dp
6 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/values/LoginActivity.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #3F51B5
4 | #303F9F
5 | #FF4081
6 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 16dp
4 | 16dp
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | MFE Vehicle Tracker
3 | mfenter.com/tracker
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/app/src/test/java/com/example/madeel/devicetracker/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package com.mfe.madeel.devicetracker;
2 |
3 | import org.junit.Test;
4 |
5 | import static org.junit.Assert.*;
6 |
7 | /**
8 | * To work on unit tests, switch the Test Artifact in the Build Variants view.
9 | */
10 | public class ExampleUnitTest {
11 | @Test
12 | public void addition_isCorrect() throws Exception {
13 | assertEquals(4, 2 + 2);
14 | }
15 | }
--------------------------------------------------------------------------------
/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 |
3 | buildscript {
4 | repositories {
5 | jcenter()
6 | }
7 | dependencies {
8 | classpath 'com.android.tools.build:gradle:2.1.2'
9 |
10 | // NOTE: Do not place your application dependencies here; they belong
11 | // in the individual module build.gradle files
12 | }
13 | }
14 |
15 | allprojects {
16 | repositories {
17 | jcenter()
18 | maven {url"https://maven.google.com"}
19 | }
20 | }
21 |
22 | task clean(type: Delete) {
23 | delete rootProject.buildDir
24 | }
25 |
--------------------------------------------------------------------------------
/css/stylesheet.css:
--------------------------------------------------------------------------------
1 | @charset "utf-8";
2 | label{
3 | font-size:15px;
4 | }
5 | body {
6 | font-family: 'Bitter', serif;
7 | font-size: 48px;
8 | padding:0;
9 | margin:0;
10 | }
11 | .error{
12 | color:red;
13 | font-size:20px;
14 | animation:0.2s linear error;
15 | }
16 | #head {
17 | }
18 | @media screen and (max-width: 48em){
19 | #head{
20 | text-align: justify ;
21 | margin-top:0;
22 | }
23 | #logodiv{
24 | text-align:center;
25 | }
26 | .profile {
27 | margin:0px;
28 | }
29 | }
30 |
31 | .headerbt{
32 | font-size:12px;
33 | border-left: 1px solid ;
34 | color:white;
35 | padding:10px;
36 | text-align:center;
37 | }
38 | .headerbt:hover {
39 | background:#3C71EC;
40 | border-left: 1px solid #FFFFFF;
41 | }
42 | .cover {
43 | border:1px double black;
44 | padding:100px;
45 | height:400px;
46 | }
47 | .profile {
48 | border:1px double black;
49 | margin-left:-90px;
50 | height:210px;
51 | background:white;
52 | }
53 | .nv{
54 | height:50px;
55 | }
56 |
57 |
58 |
--------------------------------------------------------------------------------
/devicetracker.sql:
--------------------------------------------------------------------------------
1 | -- phpMyAdmin SQL Dump
2 | -- version 4.5.1
3 | -- http://www.phpmyadmin.net
4 | --
5 | -- Host: 127.0.0.1
6 | -- Generation Time: Jul 12, 2017 at 09:20 AM
7 | -- Server version: 10.1.19-MariaDB
8 | -- PHP Version: 7.0.13
9 |
10 | SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
11 | SET time_zone = "+00:00";
12 |
13 |
14 | /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
15 | /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
16 | /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
17 | /*!40101 SET NAMES utf8mb4 */;
18 |
19 | --
20 | -- Database: `devicetracker`
21 | --
22 |
23 | -- --------------------------------------------------------
24 |
25 | --
26 | -- Table structure for table `admin`
27 | --
28 |
29 | CREATE TABLE `admin` (
30 | `username` text NOT NULL,
31 | `password` text NOT NULL
32 | ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
33 |
34 | --
35 | -- Dumping data for table `admin`
36 | --
37 |
38 | INSERT INTO `admin` (`username`, `password`) VALUES
39 | ('admin', 'admin');
40 |
41 | -- --------------------------------------------------------
42 |
43 | --
44 | -- Table structure for table `devices`
45 | --
46 |
47 | CREATE TABLE `devices` (
48 | `deviceid` int(11) NOT NULL,
49 | `username` text NOT NULL,
50 | `password` text NOT NULL,
51 | `longitude` text NOT NULL,
52 | `langitude` text NOT NULL,
53 | `devicename` text NOT NULL
54 | ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
55 |
56 | --
57 | -- Dumping data for table `devices`
58 | --
59 |
60 | INSERT INTO `devices` (`deviceid`, `username`, `password`, `longitude`, `langitude`, `devicename`) VALUES
61 | (3, 'ADEEL', 'adeel', '29340293', '23434', 'asdf;kl'),
62 | (4, 'ADEEL', 'adeel', '29340293', '23434', 'asdf;kl'),
63 | (6, 'ADEEL', 'adeel', '29340293', '23434', 'asdf;kl'),
64 | (7, 'ADEEL', 'adeel', '29340293', '23434', 'asdf;kl'),
65 | (10, 'ADEEL', 'adeel', '29340293', '23434', 'asdf;kl'),
66 | (14, 'ADEEL', 'adeel', '29340293', '23434', 'asdf;kl'),
67 | (16, 'ADEEL', 'adeel', '29340293', '23434', 'asdf;kl'),
68 | (17, 'ADEEL', 'adeel', '29340293', '23434', 'asdf;kl'),
69 | (18, 'ADEEL', 'adeel', '29340293', '23434', 'asdf;kl'),
70 | (19, 'ADEEL', 'adeel', '29340293', '23434', 'asdf;kl'),
71 | (20, 'ADEEL', 'adeel', '29340293', '23434', 'asdf;kl'),
72 | (21, 'ADEEL', 'adeel', '29340293', '23434', 'asdf;kl'),
73 | (22, 'ADEEL', 'adeel', '29340293', '23434', 'asdf;kl'),
74 | (23, 'ADEEL', 'adeel', '29340293', '23434', 'asdf;kl'),
75 | (24, 'ADEEL', 'adeel', '29340293', '23434', 'asdf;kl'),
76 | (25, 'ADEEL', 'adeel', '29340293', '23434', 'asdf;kl'),
77 | (26, 'ADEEL', 'adeel', '29340293', '23434', 'asdf;kl'),
78 | (27, 'ADEEL', 'adeel', '29340293', '23434', 'asdf;kl'),
79 | (28, 'ADEEL', 'adeel', '29340293', '23434', 'asdf;kl'),
80 | (29, 'ADEEL', 'adeel', '29340293', '23434', 'asdf;kl'),
81 | (30, 'ADEEL', 'adeel', '29340293', '23434', 'asdf;kl'),
82 | (31, 'ADEEL', 'adeel', '29340293', '23434', 'asdf;kl'),
83 | (32, 'ADEEL', 'adeel', '29340293', '23434', 'asdf;kl'),
84 | (33, 'ADEEL', 'adeel', '29340293', '23434', 'asdf;kl'),
85 | (34, 'ADEEL', 'adeel', '29340293', '23434', 'asdf;kl'),
86 | (35, 'ADEEL', 'adeel', '29340293', '23434', 'asdf;kl'),
87 | (36, 'ADEEL', 'adeel', '29340293', '23434', 'asdf;kl'),
88 | (37, 'ADEEL', 'adeel', '29340293', '23434', 'asdf;kl'),
89 | (38, 'ADEEL', 'adeel', '29340293', '23434', 'asdf;kl'),
90 | (39, 'ADEEL', 'adeel', '29340293', '23434', 'asdf;kl'),
91 | (40, 'ADEEL', 'adeel', '29340293', '23434', 'asdf;kl'),
92 | (41, 'ADEEL', 'adeel', '29340293', '23434', 'asdf;kl'),
93 | (42, 'ADEEL', 'adeel', '29340293', '23434', 'asdf;kl'),
94 | (43, 'ADEEL', 'adeel', '29340293', '23434', 'asdf;kl'),
95 | (44, 'ADEEL', 'adeel', '29340293', '23434', 'asdf;kl'),
96 | (45, 'ADEEL', 'adeel', '29340293', '23434', 'asdf;kl'),
97 | (46, 'ADEEL', 'adeel', '29340293', '23434', 'asdf;kl'),
98 | (47, 'ADEEL', 'adeel', '29340293', '23434', 'asdf;kl'),
99 | (48, 'ADEEL', 'adeel', '29340293', '23434', 'asdf;kl'),
100 | (49, 'ADEEL', 'adeel', '29340293', '23434', 'asdf;kl'),
101 | (50, 'ADEEL', 'adeel', '29340293', '23434', 'asdf;kl'),
102 | (51, 'ADEEL', 'adeel', '29340293', '23434', 'asdf;kl'),
103 | (52, 'ADEEL', 'adeel', '29340293', '23434', 'asdf;kl'),
104 | (53, 'ADEEL', 'adeel', '29340293', '23434', 'asdf;kl'),
105 | (54, 'ADEEL', 'adeel', '29340293', '23434', 'asdf;kl'),
106 | (55, 'ADEEL', 'adeel', '29340293', '23434', 'asdf;kl'),
107 | (56, 'ADEEL', 'adeel', '29340293', '23434', 'asdf;kl'),
108 | (57, 'ADEEL', 'adeel', '29340293', '23434', 'asdf;kl'),
109 | (58, 'ADEEL', 'adeel', '29340293', '23434', 'asdf;kl'),
110 | (59, 'ADEEL', 'adeel', '29340293', '23434', 'asdf;kl'),
111 | (61, 'zahid', 'zahid', '67.0622', '24.9977', 'Galaxy S5');
112 |
113 | --
114 | -- Indexes for dumped tables
115 | --
116 |
117 | --
118 | -- Indexes for table `devices`
119 | --
120 | ALTER TABLE `devices`
121 | ADD PRIMARY KEY (`deviceid`) KEY_BLOCK_SIZE=4 USING HASH;
122 |
123 | --
124 | -- AUTO_INCREMENT for dumped tables
125 | --
126 |
127 | --
128 | -- AUTO_INCREMENT for table `devices`
129 | --
130 | ALTER TABLE `devices`
131 | MODIFY `deviceid` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=62;
132 | /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
133 | /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
134 | /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
135 |
--------------------------------------------------------------------------------
/fonts/glyphicons-halflings-regular.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/madeel20/Vehicle-Tracking-System-AndroidApp-PHP/9590f38af481e09d614b3b1f67daa950aeb342cb/fonts/glyphicons-halflings-regular.eot
--------------------------------------------------------------------------------
/fonts/glyphicons-halflings-regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/madeel20/Vehicle-Tracking-System-AndroidApp-PHP/9590f38af481e09d614b3b1f67daa950aeb342cb/fonts/glyphicons-halflings-regular.ttf
--------------------------------------------------------------------------------
/fonts/glyphicons-halflings-regular.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/madeel20/Vehicle-Tracking-System-AndroidApp-PHP/9590f38af481e09d614b3b1f67daa950aeb342cb/fonts/glyphicons-halflings-regular.woff
--------------------------------------------------------------------------------
/fonts/glyphicons-halflings-regular.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/madeel20/Vehicle-Tracking-System-AndroidApp-PHP/9590f38af481e09d614b3b1f67daa950aeb342cb/fonts/glyphicons-halflings-regular.woff2
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 |
3 | # IDE (e.g. Android Studio) users:
4 | # Gradle settings configured through the IDE *will override*
5 | # any settings specified in this file.
6 |
7 | # For more details on how to configure your build environment visit
8 | # http://www.gradle.org/docs/current/userguide/build_environment.html
9 |
10 | # Specifies the JVM arguments used for the daemon process.
11 | # The setting is particularly useful for tweaking memory settings.
12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m
13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
14 |
15 | # When configured, Gradle will run in incubating parallel mode.
16 | # This option should only be used with decoupled projects. More details, visit
17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
18 | # org.gradle.parallel=true
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/madeel20/Vehicle-Tracking-System-AndroidApp-PHP/9590f38af481e09d614b3b1f67daa950aeb342cb/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Mon Dec 28 10:00:20 PST 2015
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-all.zip
7 |
--------------------------------------------------------------------------------
/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | ##############################################################################
4 | ##
5 | ## Gradle start up script for UN*X
6 | ##
7 | ##############################################################################
8 |
9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
10 | DEFAULT_JVM_OPTS=""
11 |
12 | APP_NAME="Gradle"
13 | APP_BASE_NAME=`basename "$0"`
14 |
15 | # Use the maximum available, or set MAX_FD != -1 to use that value.
16 | MAX_FD="maximum"
17 |
18 | warn ( ) {
19 | echo "$*"
20 | }
21 |
22 | die ( ) {
23 | echo
24 | echo "$*"
25 | echo
26 | exit 1
27 | }
28 |
29 | # OS specific support (must be 'true' or 'false').
30 | cygwin=false
31 | msys=false
32 | darwin=false
33 | case "`uname`" in
34 | CYGWIN* )
35 | cygwin=true
36 | ;;
37 | Darwin* )
38 | darwin=true
39 | ;;
40 | MINGW* )
41 | msys=true
42 | ;;
43 | esac
44 |
45 | # Attempt to set APP_HOME
46 | # Resolve links: $0 may be a link
47 | PRG="$0"
48 | # Need this for relative symlinks.
49 | while [ -h "$PRG" ] ; do
50 | ls=`ls -ld "$PRG"`
51 | link=`expr "$ls" : '.*-> \(.*\)$'`
52 | if expr "$link" : '/.*' > /dev/null; then
53 | PRG="$link"
54 | else
55 | PRG=`dirname "$PRG"`"/$link"
56 | fi
57 | done
58 | SAVED="`pwd`"
59 | cd "`dirname \"$PRG\"`/" >/dev/null
60 | APP_HOME="`pwd -P`"
61 | cd "$SAVED" >/dev/null
62 |
63 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
64 |
65 | # Determine the Java command to use to start the JVM.
66 | if [ -n "$JAVA_HOME" ] ; then
67 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
68 | # IBM's JDK on AIX uses strange locations for the executables
69 | JAVACMD="$JAVA_HOME/jre/sh/java"
70 | else
71 | JAVACMD="$JAVA_HOME/bin/java"
72 | fi
73 | if [ ! -x "$JAVACMD" ] ; then
74 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
75 |
76 | Please set the JAVA_HOME variable in your environment to match the
77 | location of your Java installation."
78 | fi
79 | else
80 | JAVACMD="java"
81 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
82 |
83 | Please set the JAVA_HOME variable in your environment to match the
84 | location of your Java installation."
85 | fi
86 |
87 | # Increase the maximum file descriptors if we can.
88 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
89 | MAX_FD_LIMIT=`ulimit -H -n`
90 | if [ $? -eq 0 ] ; then
91 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
92 | MAX_FD="$MAX_FD_LIMIT"
93 | fi
94 | ulimit -n $MAX_FD
95 | if [ $? -ne 0 ] ; then
96 | warn "Could not set maximum file descriptor limit: $MAX_FD"
97 | fi
98 | else
99 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
100 | fi
101 | fi
102 |
103 | # For Darwin, add options to specify how the application appears in the dock
104 | if $darwin; then
105 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
106 | fi
107 |
108 | # For Cygwin, switch paths to Windows format before running java
109 | if $cygwin ; then
110 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
111 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
112 | JAVACMD=`cygpath --unix "$JAVACMD"`
113 |
114 | # We build the pattern for arguments to be converted via cygpath
115 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
116 | SEP=""
117 | for dir in $ROOTDIRSRAW ; do
118 | ROOTDIRS="$ROOTDIRS$SEP$dir"
119 | SEP="|"
120 | done
121 | OURCYGPATTERN="(^($ROOTDIRS))"
122 | # Add a user-defined pattern to the cygpath arguments
123 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
124 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
125 | fi
126 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
127 | i=0
128 | for arg in "$@" ; do
129 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
130 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
131 |
132 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
133 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
134 | else
135 | eval `echo args$i`="\"$arg\""
136 | fi
137 | i=$((i+1))
138 | done
139 | case $i in
140 | (0) set -- ;;
141 | (1) set -- "$args0" ;;
142 | (2) set -- "$args0" "$args1" ;;
143 | (3) set -- "$args0" "$args1" "$args2" ;;
144 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
145 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
146 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
147 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
148 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
149 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
150 | esac
151 | fi
152 |
153 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
154 | function splitJvmOpts() {
155 | JVM_OPTS=("$@")
156 | }
157 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
158 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
159 |
160 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
161 |
--------------------------------------------------------------------------------
/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
12 | set DEFAULT_JVM_OPTS=
13 |
14 | set DIRNAME=%~dp0
15 | if "%DIRNAME%" == "" set DIRNAME=.
16 | set APP_BASE_NAME=%~n0
17 | set APP_HOME=%DIRNAME%
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windowz variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 | if "%@eval[2+2]" == "4" goto 4NT_args
53 |
54 | :win9xME_args
55 | @rem Slurp the command line arguments.
56 | set CMD_LINE_ARGS=
57 | set _SKIP=2
58 |
59 | :win9xME_args_slurp
60 | if "x%~1" == "x" goto execute
61 |
62 | set CMD_LINE_ARGS=%*
63 | goto execute
64 |
65 | :4NT_args
66 | @rem Get arguments from the 4NT Shell from JP Software
67 | set CMD_LINE_ARGS=%$
68 |
69 | :execute
70 | @rem Setup the command line
71 |
72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73 |
74 | @rem Execute Gradle
75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
76 |
77 | :end
78 | @rem End local scope for the variables with windows NT shell
79 | if "%ERRORLEVEL%"=="0" goto mainEnd
80 |
81 | :fail
82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83 | rem the _cmd.exe /c_ return code!
84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
85 | exit /b 1
86 |
87 | :mainEnd
88 | if "%OS%"=="Windows_NT" endlocal
89 |
90 | :omega
91 |
--------------------------------------------------------------------------------
/js/bootstrap.min.js:
--------------------------------------------------------------------------------
1 | /*!
2 | * Bootstrap v3.3.7 (http://getbootstrap.com)
3 | * Copyright 2011-2016 Twitter, Inc.
4 | * Licensed under the MIT license
5 | */
6 | if("undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");+function(a){"use strict";var b=a.fn.jquery.split(" ")[0].split(".");if(b[0]<2&&b[1]<9||1==b[0]&&9==b[1]&&b[2]<1||b[0]>3)throw new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher, but lower than version 4")}(jQuery),+function(a){"use strict";function b(){var a=document.createElement("bootstrap"),b={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var c in b)if(void 0!==a.style[c])return{end:b[c]};return!1}a.fn.emulateTransitionEnd=function(b){var c=!1,d=this;a(this).one("bsTransitionEnd",function(){c=!0});var e=function(){c||a(d).trigger(a.support.transition.end)};return setTimeout(e,b),this},a(function(){a.support.transition=b(),a.support.transition&&(a.event.special.bsTransitionEnd={bindType:a.support.transition.end,delegateType:a.support.transition.end,handle:function(b){if(a(b.target).is(this))return b.handleObj.handler.apply(this,arguments)}})})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var c=a(this),e=c.data("bs.alert");e||c.data("bs.alert",e=new d(this)),"string"==typeof b&&e[b].call(c)})}var c='[data-dismiss="alert"]',d=function(b){a(b).on("click",c,this.close)};d.VERSION="3.3.7",d.TRANSITION_DURATION=150,d.prototype.close=function(b){function c(){g.detach().trigger("closed.bs.alert").remove()}var e=a(this),f=e.attr("data-target");f||(f=e.attr("href"),f=f&&f.replace(/.*(?=#[^\s]*$)/,""));var g=a("#"===f?[]:f);b&&b.preventDefault(),g.length||(g=e.closest(".alert")),g.trigger(b=a.Event("close.bs.alert")),b.isDefaultPrevented()||(g.removeClass("in"),a.support.transition&&g.hasClass("fade")?g.one("bsTransitionEnd",c).emulateTransitionEnd(d.TRANSITION_DURATION):c())};var e=a.fn.alert;a.fn.alert=b,a.fn.alert.Constructor=d,a.fn.alert.noConflict=function(){return a.fn.alert=e,this},a(document).on("click.bs.alert.data-api",c,d.prototype.close)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.button"),f="object"==typeof b&&b;e||d.data("bs.button",e=new c(this,f)),"toggle"==b?e.toggle():b&&e.setState(b)})}var c=function(b,d){this.$element=a(b),this.options=a.extend({},c.DEFAULTS,d),this.isLoading=!1};c.VERSION="3.3.7",c.DEFAULTS={loadingText:"loading..."},c.prototype.setState=function(b){var c="disabled",d=this.$element,e=d.is("input")?"val":"html",f=d.data();b+="Text",null==f.resetText&&d.data("resetText",d[e]()),setTimeout(a.proxy(function(){d[e](null==f[b]?this.options[b]:f[b]),"loadingText"==b?(this.isLoading=!0,d.addClass(c).attr(c,c).prop(c,!0)):this.isLoading&&(this.isLoading=!1,d.removeClass(c).removeAttr(c).prop(c,!1))},this),0)},c.prototype.toggle=function(){var a=!0,b=this.$element.closest('[data-toggle="buttons"]');if(b.length){var c=this.$element.find("input");"radio"==c.prop("type")?(c.prop("checked")&&(a=!1),b.find(".active").removeClass("active"),this.$element.addClass("active")):"checkbox"==c.prop("type")&&(c.prop("checked")!==this.$element.hasClass("active")&&(a=!1),this.$element.toggleClass("active")),c.prop("checked",this.$element.hasClass("active")),a&&c.trigger("change")}else this.$element.attr("aria-pressed",!this.$element.hasClass("active")),this.$element.toggleClass("active")};var d=a.fn.button;a.fn.button=b,a.fn.button.Constructor=c,a.fn.button.noConflict=function(){return a.fn.button=d,this},a(document).on("click.bs.button.data-api",'[data-toggle^="button"]',function(c){var d=a(c.target).closest(".btn");b.call(d,"toggle"),a(c.target).is('input[type="radio"], input[type="checkbox"]')||(c.preventDefault(),d.is("input,button")?d.trigger("focus"):d.find("input:visible,button:visible").first().trigger("focus"))}).on("focus.bs.button.data-api blur.bs.button.data-api",'[data-toggle^="button"]',function(b){a(b.target).closest(".btn").toggleClass("focus",/^focus(in)?$/.test(b.type))})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.carousel"),f=a.extend({},c.DEFAULTS,d.data(),"object"==typeof b&&b),g="string"==typeof b?b:f.slide;e||d.data("bs.carousel",e=new c(this,f)),"number"==typeof b?e.to(b):g?e[g]():f.interval&&e.pause().cycle()})}var c=function(b,c){this.$element=a(b),this.$indicators=this.$element.find(".carousel-indicators"),this.options=c,this.paused=null,this.sliding=null,this.interval=null,this.$active=null,this.$items=null,this.options.keyboard&&this.$element.on("keydown.bs.carousel",a.proxy(this.keydown,this)),"hover"==this.options.pause&&!("ontouchstart"in document.documentElement)&&this.$element.on("mouseenter.bs.carousel",a.proxy(this.pause,this)).on("mouseleave.bs.carousel",a.proxy(this.cycle,this))};c.VERSION="3.3.7",c.TRANSITION_DURATION=600,c.DEFAULTS={interval:5e3,pause:"hover",wrap:!0,keyboard:!0},c.prototype.keydown=function(a){if(!/input|textarea/i.test(a.target.tagName)){switch(a.which){case 37:this.prev();break;case 39:this.next();break;default:return}a.preventDefault()}},c.prototype.cycle=function(b){return b||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(a.proxy(this.next,this),this.options.interval)),this},c.prototype.getItemIndex=function(a){return this.$items=a.parent().children(".item"),this.$items.index(a||this.$active)},c.prototype.getItemForDirection=function(a,b){var c=this.getItemIndex(b),d="prev"==a&&0===c||"next"==a&&c==this.$items.length-1;if(d&&!this.options.wrap)return b;var e="prev"==a?-1:1,f=(c+e)%this.$items.length;return this.$items.eq(f)},c.prototype.to=function(a){var b=this,c=this.getItemIndex(this.$active=this.$element.find(".item.active"));if(!(a>this.$items.length-1||a<0))return this.sliding?this.$element.one("slid.bs.carousel",function(){b.to(a)}):c==a?this.pause().cycle():this.slide(a>c?"next":"prev",this.$items.eq(a))},c.prototype.pause=function(b){return b||(this.paused=!0),this.$element.find(".next, .prev").length&&a.support.transition&&(this.$element.trigger(a.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},c.prototype.next=function(){if(!this.sliding)return this.slide("next")},c.prototype.prev=function(){if(!this.sliding)return this.slide("prev")},c.prototype.slide=function(b,d){var e=this.$element.find(".item.active"),f=d||this.getItemForDirection(b,e),g=this.interval,h="next"==b?"left":"right",i=this;if(f.hasClass("active"))return this.sliding=!1;var j=f[0],k=a.Event("slide.bs.carousel",{relatedTarget:j,direction:h});if(this.$element.trigger(k),!k.isDefaultPrevented()){if(this.sliding=!0,g&&this.pause(),this.$indicators.length){this.$indicators.find(".active").removeClass("active");var l=a(this.$indicators.children()[this.getItemIndex(f)]);l&&l.addClass("active")}var m=a.Event("slid.bs.carousel",{relatedTarget:j,direction:h});return a.support.transition&&this.$element.hasClass("slide")?(f.addClass(b),f[0].offsetWidth,e.addClass(h),f.addClass(h),e.one("bsTransitionEnd",function(){f.removeClass([b,h].join(" ")).addClass("active"),e.removeClass(["active",h].join(" ")),i.sliding=!1,setTimeout(function(){i.$element.trigger(m)},0)}).emulateTransitionEnd(c.TRANSITION_DURATION)):(e.removeClass("active"),f.addClass("active"),this.sliding=!1,this.$element.trigger(m)),g&&this.cycle(),this}};var d=a.fn.carousel;a.fn.carousel=b,a.fn.carousel.Constructor=c,a.fn.carousel.noConflict=function(){return a.fn.carousel=d,this};var e=function(c){var d,e=a(this),f=a(e.attr("data-target")||(d=e.attr("href"))&&d.replace(/.*(?=#[^\s]+$)/,""));if(f.hasClass("carousel")){var g=a.extend({},f.data(),e.data()),h=e.attr("data-slide-to");h&&(g.interval=!1),b.call(f,g),h&&f.data("bs.carousel").to(h),c.preventDefault()}};a(document).on("click.bs.carousel.data-api","[data-slide]",e).on("click.bs.carousel.data-api","[data-slide-to]",e),a(window).on("load",function(){a('[data-ride="carousel"]').each(function(){var c=a(this);b.call(c,c.data())})})}(jQuery),+function(a){"use strict";function b(b){var c,d=b.attr("data-target")||(c=b.attr("href"))&&c.replace(/.*(?=#[^\s]+$)/,"");return a(d)}function c(b){return this.each(function(){var c=a(this),e=c.data("bs.collapse"),f=a.extend({},d.DEFAULTS,c.data(),"object"==typeof b&&b);!e&&f.toggle&&/show|hide/.test(b)&&(f.toggle=!1),e||c.data("bs.collapse",e=new d(this,f)),"string"==typeof b&&e[b]()})}var d=function(b,c){this.$element=a(b),this.options=a.extend({},d.DEFAULTS,c),this.$trigger=a('[data-toggle="collapse"][href="#'+b.id+'"],[data-toggle="collapse"][data-target="#'+b.id+'"]'),this.transitioning=null,this.options.parent?this.$parent=this.getParent():this.addAriaAndCollapsedClass(this.$element,this.$trigger),this.options.toggle&&this.toggle()};d.VERSION="3.3.7",d.TRANSITION_DURATION=350,d.DEFAULTS={toggle:!0},d.prototype.dimension=function(){var a=this.$element.hasClass("width");return a?"width":"height"},d.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var b,e=this.$parent&&this.$parent.children(".panel").children(".in, .collapsing");if(!(e&&e.length&&(b=e.data("bs.collapse"),b&&b.transitioning))){var f=a.Event("show.bs.collapse");if(this.$element.trigger(f),!f.isDefaultPrevented()){e&&e.length&&(c.call(e,"hide"),b||e.data("bs.collapse",null));var g=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[g](0).attr("aria-expanded",!0),this.$trigger.removeClass("collapsed").attr("aria-expanded",!0),this.transitioning=1;var h=function(){this.$element.removeClass("collapsing").addClass("collapse in")[g](""),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!a.support.transition)return h.call(this);var i=a.camelCase(["scroll",g].join("-"));this.$element.one("bsTransitionEnd",a.proxy(h,this)).emulateTransitionEnd(d.TRANSITION_DURATION)[g](this.$element[0][i])}}}},d.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var b=a.Event("hide.bs.collapse");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.dimension();this.$element[c](this.$element[c]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse in").attr("aria-expanded",!1),this.$trigger.addClass("collapsed").attr("aria-expanded",!1),this.transitioning=1;var e=function(){this.transitioning=0,this.$element.removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse")};return a.support.transition?void this.$element[c](0).one("bsTransitionEnd",a.proxy(e,this)).emulateTransitionEnd(d.TRANSITION_DURATION):e.call(this)}}},d.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()},d.prototype.getParent=function(){return a(this.options.parent).find('[data-toggle="collapse"][data-parent="'+this.options.parent+'"]').each(a.proxy(function(c,d){var e=a(d);this.addAriaAndCollapsedClass(b(e),e)},this)).end()},d.prototype.addAriaAndCollapsedClass=function(a,b){var c=a.hasClass("in");a.attr("aria-expanded",c),b.toggleClass("collapsed",!c).attr("aria-expanded",c)};var e=a.fn.collapse;a.fn.collapse=c,a.fn.collapse.Constructor=d,a.fn.collapse.noConflict=function(){return a.fn.collapse=e,this},a(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',function(d){var e=a(this);e.attr("data-target")||d.preventDefault();var f=b(e),g=f.data("bs.collapse"),h=g?"toggle":e.data();c.call(f,h)})}(jQuery),+function(a){"use strict";function b(b){var c=b.attr("data-target");c||(c=b.attr("href"),c=c&&/#[A-Za-z]/.test(c)&&c.replace(/.*(?=#[^\s]*$)/,""));var d=c&&a(c);return d&&d.length?d:b.parent()}function c(c){c&&3===c.which||(a(e).remove(),a(f).each(function(){var d=a(this),e=b(d),f={relatedTarget:this};e.hasClass("open")&&(c&&"click"==c.type&&/input|textarea/i.test(c.target.tagName)&&a.contains(e[0],c.target)||(e.trigger(c=a.Event("hide.bs.dropdown",f)),c.isDefaultPrevented()||(d.attr("aria-expanded","false"),e.removeClass("open").trigger(a.Event("hidden.bs.dropdown",f)))))}))}function d(b){return this.each(function(){var c=a(this),d=c.data("bs.dropdown");d||c.data("bs.dropdown",d=new g(this)),"string"==typeof b&&d[b].call(c)})}var e=".dropdown-backdrop",f='[data-toggle="dropdown"]',g=function(b){a(b).on("click.bs.dropdown",this.toggle)};g.VERSION="3.3.7",g.prototype.toggle=function(d){var e=a(this);if(!e.is(".disabled, :disabled")){var f=b(e),g=f.hasClass("open");if(c(),!g){"ontouchstart"in document.documentElement&&!f.closest(".navbar-nav").length&&a(document.createElement("div")).addClass("dropdown-backdrop").insertAfter(a(this)).on("click",c);var h={relatedTarget:this};if(f.trigger(d=a.Event("show.bs.dropdown",h)),d.isDefaultPrevented())return;e.trigger("focus").attr("aria-expanded","true"),f.toggleClass("open").trigger(a.Event("shown.bs.dropdown",h))}return!1}},g.prototype.keydown=function(c){if(/(38|40|27|32)/.test(c.which)&&!/input|textarea/i.test(c.target.tagName)){var d=a(this);if(c.preventDefault(),c.stopPropagation(),!d.is(".disabled, :disabled")){var e=b(d),g=e.hasClass("open");if(!g&&27!=c.which||g&&27==c.which)return 27==c.which&&e.find(f).trigger("focus"),d.trigger("click");var h=" li:not(.disabled):visible a",i=e.find(".dropdown-menu"+h);if(i.length){var j=i.index(c.target);38==c.which&&j>0&&j--,40==c.which&&jdocument.documentElement.clientHeight;this.$element.css({paddingLeft:!this.bodyIsOverflowing&&a?this.scrollbarWidth:"",paddingRight:this.bodyIsOverflowing&&!a?this.scrollbarWidth:""})},c.prototype.resetAdjustments=function(){this.$element.css({paddingLeft:"",paddingRight:""})},c.prototype.checkScrollbar=function(){var a=window.innerWidth;if(!a){var b=document.documentElement.getBoundingClientRect();a=b.right-Math.abs(b.left)}this.bodyIsOverflowing=document.body.clientWidth',trigger:"hover focus",title:"",delay:0,html:!1,container:!1,viewport:{selector:"body",padding:0}},c.prototype.init=function(b,c,d){if(this.enabled=!0,this.type=b,this.$element=a(c),this.options=this.getOptions(d),this.$viewport=this.options.viewport&&a(a.isFunction(this.options.viewport)?this.options.viewport.call(this,this.$element):this.options.viewport.selector||this.options.viewport),this.inState={click:!1,hover:!1,focus:!1},this.$element[0]instanceof document.constructor&&!this.options.selector)throw new Error("`selector` option must be specified when initializing "+this.type+" on the window.document object!");for(var e=this.options.trigger.split(" "),f=e.length;f--;){var g=e[f];if("click"==g)this.$element.on("click."+this.type,this.options.selector,a.proxy(this.toggle,this));else if("manual"!=g){var h="hover"==g?"mouseenter":"focusin",i="hover"==g?"mouseleave":"focusout";this.$element.on(h+"."+this.type,this.options.selector,a.proxy(this.enter,this)),this.$element.on(i+"."+this.type,this.options.selector,a.proxy(this.leave,this))}}this.options.selector?this._options=a.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.getOptions=function(b){return b=a.extend({},this.getDefaults(),this.$element.data(),b),b.delay&&"number"==typeof b.delay&&(b.delay={show:b.delay,hide:b.delay}),b},c.prototype.getDelegateOptions=function(){var b={},c=this.getDefaults();return this._options&&a.each(this._options,function(a,d){c[a]!=d&&(b[a]=d)}),b},c.prototype.enter=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);return c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),b instanceof a.Event&&(c.inState["focusin"==b.type?"focus":"hover"]=!0),c.tip().hasClass("in")||"in"==c.hoverState?void(c.hoverState="in"):(clearTimeout(c.timeout),c.hoverState="in",c.options.delay&&c.options.delay.show?void(c.timeout=setTimeout(function(){"in"==c.hoverState&&c.show()},c.options.delay.show)):c.show())},c.prototype.isInStateTrue=function(){for(var a in this.inState)if(this.inState[a])return!0;return!1},c.prototype.leave=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);if(c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),b instanceof a.Event&&(c.inState["focusout"==b.type?"focus":"hover"]=!1),!c.isInStateTrue())return clearTimeout(c.timeout),c.hoverState="out",c.options.delay&&c.options.delay.hide?void(c.timeout=setTimeout(function(){"out"==c.hoverState&&c.hide()},c.options.delay.hide)):c.hide()},c.prototype.show=function(){var b=a.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(b);var d=a.contains(this.$element[0].ownerDocument.documentElement,this.$element[0]);if(b.isDefaultPrevented()||!d)return;var e=this,f=this.tip(),g=this.getUID(this.type);this.setContent(),f.attr("id",g),this.$element.attr("aria-describedby",g),this.options.animation&&f.addClass("fade");var h="function"==typeof this.options.placement?this.options.placement.call(this,f[0],this.$element[0]):this.options.placement,i=/\s?auto?\s?/i,j=i.test(h);j&&(h=h.replace(i,"")||"top"),f.detach().css({top:0,left:0,display:"block"}).addClass(h).data("bs."+this.type,this),this.options.container?f.appendTo(this.options.container):f.insertAfter(this.$element),this.$element.trigger("inserted.bs."+this.type);var k=this.getPosition(),l=f[0].offsetWidth,m=f[0].offsetHeight;if(j){var n=h,o=this.getPosition(this.$viewport);h="bottom"==h&&k.bottom+m>o.bottom?"top":"top"==h&&k.top-mo.width?"left":"left"==h&&k.left-lg.top+g.height&&(e.top=g.top+g.height-i)}else{var j=b.left-f,k=b.left+f+c;jg.right&&(e.left=g.left+g.width-k)}return e},c.prototype.getTitle=function(){var a,b=this.$element,c=this.options;return a=b.attr("data-original-title")||("function"==typeof c.title?c.title.call(b[0]):c.title)},c.prototype.getUID=function(a){do a+=~~(1e6*Math.random());while(document.getElementById(a));return a},c.prototype.tip=function(){if(!this.$tip&&(this.$tip=a(this.options.template),1!=this.$tip.length))throw new Error(this.type+" `template` option must consist of exactly 1 top-level element!");return this.$tip},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},c.prototype.enable=function(){this.enabled=!0},c.prototype.disable=function(){this.enabled=!1},c.prototype.toggleEnabled=function(){this.enabled=!this.enabled},c.prototype.toggle=function(b){var c=this;b&&(c=a(b.currentTarget).data("bs."+this.type),c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c))),b?(c.inState.click=!c.inState.click,c.isInStateTrue()?c.enter(c):c.leave(c)):c.tip().hasClass("in")?c.leave(c):c.enter(c)},c.prototype.destroy=function(){var a=this;clearTimeout(this.timeout),this.hide(function(){a.$element.off("."+a.type).removeData("bs."+a.type),a.$tip&&a.$tip.detach(),a.$tip=null,a.$arrow=null,a.$viewport=null,a.$element=null})};var d=a.fn.tooltip;a.fn.tooltip=b,a.fn.tooltip.Constructor=c,a.fn.tooltip.noConflict=function(){return a.fn.tooltip=d,this}}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.popover"),f="object"==typeof b&&b;!e&&/destroy|hide/.test(b)||(e||d.data("bs.popover",e=new c(this,f)),"string"==typeof b&&e[b]())})}var c=function(a,b){this.init("popover",a,b)};if(!a.fn.tooltip)throw new Error("Popover requires tooltip.js");c.VERSION="3.3.7",c.DEFAULTS=a.extend({},a.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:''}),c.prototype=a.extend({},a.fn.tooltip.Constructor.prototype),c.prototype.constructor=c,c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.setContent=function(){var a=this.tip(),b=this.getTitle(),c=this.getContent();a.find(".popover-title")[this.options.html?"html":"text"](b),a.find(".popover-content").children().detach().end()[this.options.html?"string"==typeof c?"html":"append":"text"](c),a.removeClass("fade top bottom left right in"),a.find(".popover-title").html()||a.find(".popover-title").hide()},c.prototype.hasContent=function(){return this.getTitle()||this.getContent()},c.prototype.getContent=function(){var a=this.$element,b=this.options;return a.attr("data-content")||("function"==typeof b.content?b.content.call(a[0]):b.content)},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")};var d=a.fn.popover;a.fn.popover=b,a.fn.popover.Constructor=c,a.fn.popover.noConflict=function(){return a.fn.popover=d,this}}(jQuery),+function(a){"use strict";function b(c,d){this.$body=a(document.body),this.$scrollElement=a(a(c).is(document.body)?window:c),this.options=a.extend({},b.DEFAULTS,d),this.selector=(this.options.target||"")+" .nav li > a",this.offsets=[],this.targets=[],this.activeTarget=null,this.scrollHeight=0,this.$scrollElement.on("scroll.bs.scrollspy",a.proxy(this.process,this)),this.refresh(),this.process()}function c(c){return this.each(function(){var d=a(this),e=d.data("bs.scrollspy"),f="object"==typeof c&&c;e||d.data("bs.scrollspy",e=new b(this,f)),"string"==typeof c&&e[c]()})}b.VERSION="3.3.7",b.DEFAULTS={offset:10},b.prototype.getScrollHeight=function(){return this.$scrollElement[0].scrollHeight||Math.max(this.$body[0].scrollHeight,document.documentElement.scrollHeight)},b.prototype.refresh=function(){var b=this,c="offset",d=0;this.offsets=[],this.targets=[],this.scrollHeight=this.getScrollHeight(),a.isWindow(this.$scrollElement[0])||(c="position",d=this.$scrollElement.scrollTop()),this.$body.find(this.selector).map(function(){var b=a(this),e=b.data("target")||b.attr("href"),f=/^#./.test(e)&&a(e);return f&&f.length&&f.is(":visible")&&[[f[c]().top+d,e]]||null}).sort(function(a,b){return a[0]-b[0]}).each(function(){b.offsets.push(this[0]),b.targets.push(this[1])})},b.prototype.process=function(){var a,b=this.$scrollElement.scrollTop()+this.options.offset,c=this.getScrollHeight(),d=this.options.offset+c-this.$scrollElement.height(),e=this.offsets,f=this.targets,g=this.activeTarget;if(this.scrollHeight!=c&&this.refresh(),b>=d)return g!=(a=f[f.length-1])&&this.activate(a);if(g&&b=e[a]&&(void 0===e[a+1]||b .dropdown-menu > .active").removeClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!1),b.addClass("active").find('[data-toggle="tab"]').attr("aria-expanded",!0),h?(b[0].offsetWidth,b.addClass("in")):b.removeClass("fade"),b.parent(".dropdown-menu").length&&b.closest("li.dropdown").addClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!0),e&&e()}var g=d.find("> .active"),h=e&&a.support.transition&&(g.length&&g.hasClass("fade")||!!d.find("> .fade").length);g.length&&h?g.one("bsTransitionEnd",f).emulateTransitionEnd(c.TRANSITION_DURATION):f(),g.removeClass("in")};var d=a.fn.tab;a.fn.tab=b,a.fn.tab.Constructor=c,a.fn.tab.noConflict=function(){return a.fn.tab=d,this};var e=function(c){c.preventDefault(),b.call(a(this),"show")};a(document).on("click.bs.tab.data-api",'[data-toggle="tab"]',e).on("click.bs.tab.data-api",'[data-toggle="pill"]',e)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.affix"),f="object"==typeof b&&b;e||d.data("bs.affix",e=new c(this,f)),"string"==typeof b&&e[b]()})}var c=function(b,d){this.options=a.extend({},c.DEFAULTS,d),this.$target=a(this.options.target).on("scroll.bs.affix.data-api",a.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",a.proxy(this.checkPositionWithEventLoop,this)),this.$element=a(b),this.affixed=null,this.unpin=null,this.pinnedOffset=null,this.checkPosition()};c.VERSION="3.3.7",c.RESET="affix affix-top affix-bottom",c.DEFAULTS={offset:0,target:window},c.prototype.getState=function(a,b,c,d){var e=this.$target.scrollTop(),f=this.$element.offset(),g=this.$target.height();if(null!=c&&"top"==this.affixed)return e=a-d&&"bottom"},c.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(c.RESET).addClass("affix");var a=this.$target.scrollTop(),b=this.$element.offset();return this.pinnedOffset=b.top-a},c.prototype.checkPositionWithEventLoop=function(){setTimeout(a.proxy(this.checkPosition,this),1)},c.prototype.checkPosition=function(){if(this.$element.is(":visible")){var b=this.$element.height(),d=this.options.offset,e=d.top,f=d.bottom,g=Math.max(a(document).height(),a(document.body).height());"object"!=typeof d&&(f=e=d),"function"==typeof e&&(e=d.top(this.$element)),"function"==typeof f&&(f=d.bottom(this.$element));var h=this.getState(g,b,e,f);if(this.affixed!=h){null!=this.unpin&&this.$element.css("top","");var i="affix"+(h?"-"+h:""),j=a.Event(i+".bs.affix");if(this.$element.trigger(j),j.isDefaultPrevented())return;this.affixed=h,this.unpin="bottom"==h?this.getPinnedOffset():null,this.$element.removeClass(c.RESET).addClass(i).trigger(i.replace("affix","affixed")+".bs.affix")}"bottom"==h&&this.$element.offset({top:g-b-f})}};var d=a.fn.affix;a.fn.affix=b,a.fn.affix.Constructor=c,a.fn.affix.noConflict=function(){return a.fn.affix=d,this},a(window).on("load",function(){a('[data-spy="affix"]').each(function(){var c=a(this),d=c.data();d.offset=d.offset||{},null!=d.offsetBottom&&(d.offset.bottom=d.offsetBottom),null!=d.offsetTop&&(d.offset.top=d.offsetTop),b.call(c,d)})})}(jQuery);
--------------------------------------------------------------------------------
/js/npm.js:
--------------------------------------------------------------------------------
1 | // This file is autogenerated via the `commonjs` Grunt task. You can require() this file in a CommonJS environment.
2 | require('../../js/transition.js')
3 | require('../../js/alert.js')
4 | require('../../js/button.js')
5 | require('../../js/carousel.js')
6 | require('../../js/collapse.js')
7 | require('../../js/dropdown.js')
8 | require('../../js/modal.js')
9 | require('../../js/tooltip.js')
10 | require('../../js/popover.js')
11 | require('../../js/scrollspy.js')
12 | require('../../js/tab.js')
13 | require('../../js/affix.js')
--------------------------------------------------------------------------------
/mfekey.jks:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/madeel20/Vehicle-Tracking-System-AndroidApp-PHP/9590f38af481e09d614b3b1f67daa950aeb342cb/mfekey.jks
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 |
--------------------------------------------------------------------------------