Skip to content

Commit 0823355

Browse files
committed
Bus Tracking App For Normal Users
1 parent 1c7212f commit 0823355

File tree

91 files changed

+1584
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

91 files changed

+1584
-0
lines changed

.gitignore

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
*.iml
2+
.gradle
3+
/local.properties
4+
/.idea/workspace.xml
5+
/.idea/libraries
6+
.DS_Store
7+
/build
8+
/captures
9+
.externalNativeBuild

.idea/compiler.xml

+22
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/copyright/profiles_settings.xml

+3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/gradle.xml

+18
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

+46
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules.xml

+9
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/runConfigurations.xml

+12
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/build

app/build.gradle

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
apply plugin: 'com.android.application'
2+
3+
android {
4+
compileSdkVersion 25
5+
buildToolsVersion "25.0.2"
6+
defaultConfig {
7+
applicationId "com.example.ninox.mapsmeuser"
8+
minSdkVersion 16
9+
targetSdkVersion 25
10+
versionCode 1
11+
versionName "1.0"
12+
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
13+
}
14+
buildTypes {
15+
release {
16+
minifyEnabled false
17+
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
18+
}
19+
}
20+
}
21+
22+
dependencies {
23+
compile fileTree(dir: 'libs', include: ['*.jar'])
24+
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
25+
exclude group: 'com.android.support', module: 'support-annotations'
26+
})
27+
28+
29+
compile 'com.android.support:appcompat-v7:25.3.1'
30+
compile 'com.android.support:design:25.3.1'
31+
compile 'com.google.android.gms:play-services-maps:10.2.4'
32+
compile 'com.mcxiaoke.volley:library-aar:1.0.0'
33+
compile 'com.android.support.constraint:constraint-layout:1.0.2'
34+
testCompile 'junit:junit:4.12'
35+
}

app/proguard-rules.pro

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Add project specific ProGuard rules here.
2+
# By default, the flags in this file are appended to flags specified
3+
# in C:\Users\Ninox\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+
19+
# Uncomment this to preserve the line number information for
20+
# debugging stack traces.
21+
#-keepattributes SourceFile,LineNumberTable
22+
23+
# If you keep the line number information, uncomment this to
24+
# hide the original source file name.
25+
#-renamesourcefileattribute SourceFile
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
package com.example.ninox.mapsmeuser;
2+
3+
import android.content.Context;
4+
import android.support.test.InstrumentationRegistry;
5+
import android.support.test.runner.AndroidJUnit4;
6+
7+
import org.junit.Test;
8+
import org.junit.runner.RunWith;
9+
10+
import static org.junit.Assert.*;
11+
12+
/**
13+
* Instrumentation test, which will execute on an Android device.
14+
*
15+
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
16+
*/
17+
@RunWith(AndroidJUnit4.class)
18+
public class ExampleInstrumentedTest {
19+
@Test
20+
public void useAppContext() throws Exception {
21+
// Context of the app under test.
22+
Context appContext = InstrumentationRegistry.getTargetContext();
23+
24+
assertEquals("com.example.ninox.mapsmeuser", appContext.getPackageName());
25+
}
26+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<resources>
2+
<!--
3+
TODO: Before you run your application, you need a Google Maps API key.
4+
5+
To get one, follow this link, follow the directions and press "Create" at the end:
6+
7+
https://console.developers.google.com/flows/enableapi?apiid=maps_android_backend&keyType=CLIENT_SIDE_ANDROID&r=52:A3:00:8B:D8:C9:DF:5D:41:7B:02:0E:7D:4E:87:41:BC:28:41:24%3Bcom.example.ninox.mapsmeuser
8+
9+
You can also add your credentials to an existing key, using these values:
10+
11+
Package name:
12+
52:A3:00:8B:D8:C9:DF:5D:41:7B:02:0E:7D:4E:87:41:BC:28:41:24
13+
14+
SHA-1 certificate fingerprint:
15+
52:A3:00:8B:D8:C9:DF:5D:41:7B:02:0E:7D:4E:87:41:BC:28:41:24
16+
17+
Alternatively, follow the directions here:
18+
https://developers.google.com/maps/documentation/android/start#get-key
19+
20+
Once you have your key (it starts with "AIza"), replace the "google_maps_key"
21+
string in this file.
22+
-->
23+
<string name="google_maps_key" templateMergeStrategy="preserve" translatable="false">AIzaSyB-6U57nqMgWJjyBWgQquxghpr3-k0dPBM</string>
24+
</resources>

app/src/main/AndroidManifest.xml

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
package="com.example.ninox.mapsmeuser">
4+
5+
<!--
6+
The ACCESS_COARSE/FINE_LOCATION permissions are not required to use
7+
Google Maps Android API v2, but you must specify either coarse or fine
8+
location permissions for the 'MyLocation' functionality.
9+
-->
10+
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
11+
12+
<application
13+
android:allowBackup="true"
14+
android:icon="@mipmap/ic_launcher"
15+
android:label="@string/app_name"
16+
android:roundIcon="@mipmap/ic_launcher_round"
17+
android:supportsRtl="true"
18+
android:theme="@style/AppTheme">
19+
20+
<!--
21+
The API key for Google Maps-based APIs is defined as a string resource.
22+
(See the file "res/values/google_maps_api.xml").
23+
Note that the API key is linked to the encryption key used to sign the APK.
24+
You need a different API key for each encryption key, including the release key that is used to
25+
sign the APK for publishing.
26+
You can define the keys for the debug and release targets in src/debug/ and src/release/.
27+
-->
28+
<meta-data
29+
android:name="com.google.android.geo.API_KEY"
30+
android:value="@string/google_maps_key" />
31+
32+
<activity
33+
android:name=".MapsActivity"
34+
android:label="@string/title_activity_maps">
35+
36+
</activity>
37+
<activity android:name=".MainActivity">
38+
<intent-filter>
39+
<action android:name="android.intent.action.MAIN" />
40+
41+
<category android:name="android.intent.category.LAUNCHER" />
42+
</intent-filter>
43+
</activity>
44+
</application>
45+
46+
</manifest>

app/src/main/ic_launcher-web.png

14.3 KB
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
package com.example.ninox.mapsmeuser;
2+
3+
import android.content.Intent;
4+
import android.support.annotation.NonNull;
5+
import android.support.design.widget.NavigationView;
6+
import android.support.v4.widget.DrawerLayout;
7+
import android.support.v7.app.ActionBarDrawerToggle;
8+
import android.support.v7.app.AppCompatActivity;
9+
import android.os.Bundle;
10+
import android.view.MenuItem;
11+
import android.view.View;
12+
import android.widget.Button;
13+
14+
import com.google.android.gms.maps.model.MapStyleOptions;
15+
16+
public class MainActivity extends AppCompatActivity {
17+
private DrawerLayout mDrawerLayout;
18+
private ActionBarDrawerToggle mToggle;
19+
private Button btnmaps;
20+
private NavigationView mNavigationView;
21+
22+
@Override
23+
protected void onCreate(Bundle savedInstanceState) {
24+
super.onCreate(savedInstanceState);
25+
setContentView(R.layout.activity_main);
26+
27+
btnmaps= (Button) findViewById(R.id.button3);
28+
29+
mNavigationView = (NavigationView) findViewById(R.id.navigation_view);
30+
mDrawerLayout = (DrawerLayout) findViewById(R.id.drawerlayout);
31+
mToggle = new ActionBarDrawerToggle(this, mDrawerLayout, R.string.open , R.string.colse);
32+
33+
mDrawerLayout.addDrawerListener(mToggle);
34+
mToggle.syncState();
35+
36+
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
37+
btnmaps.setOnClickListener(new View.OnClickListener() {
38+
39+
@Override
40+
public void onClick(View v) {
41+
Intent intent = new Intent(MainActivity.this, MapsActivity.class);
42+
startActivity(intent);
43+
}
44+
});
45+
46+
47+
mNavigationView.setNavigationItemSelectedListener(new NavigationView.OnNavigationItemSelectedListener() {
48+
@Override
49+
public boolean onNavigationItemSelected(MenuItem menuItem) {
50+
switch (menuItem.getItemId()) {
51+
case(R.id.nav_account):
52+
Intent in = new Intent(getApplicationContext(),MapsActivity.class);
53+
startActivity(in);
54+
55+
}
56+
return true;
57+
}
58+
});
59+
}
60+
61+
@Override
62+
public boolean onOptionsItemSelected(MenuItem item) {
63+
64+
if (mToggle.onOptionsItemSelected(item)){
65+
return true;}
66+
return super.onOptionsItemSelected(item);
67+
}
68+
69+
70+
}

0 commit comments

Comments
 (0)