Skip to content

Commit

Permalink
Fin.
Browse files Browse the repository at this point in the history
  • Loading branch information
naman committed Mar 19, 2016
1 parent 693522a commit a33c9af
Show file tree
Hide file tree
Showing 18 changed files with 570 additions and 127 deletions.
11 changes: 11 additions & 0 deletions .idea/libraries/bolts_android_1_4_0.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions .idea/libraries/bolts_applinks_1_4_0.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions .idea/libraries/bolts_tasks_1_4_0.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

371 changes: 251 additions & 120 deletions .idea/workspace.xml

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions app/app.iml
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@
<orderEntry type="library" exported="" name="play-services-base-8.4.0" level="project" />
<orderEntry type="library" exported="" name="play-services-measurement-8.4.0" level="project" />
<orderEntry type="library" exported="" name="play-services-maps-8.4.0" level="project" />
<orderEntry type="library" exported="" name="bolts-tasks-1.4.0" level="project" />
<orderEntry type="library" exported="" name="play-services-cast-8.4.0" level="project" />
<orderEntry type="library" exported="" name="play-services-vision-8.4.0" level="project" />
<orderEntry type="library" exported="" name="Parse-1.13.0" level="project" />
Expand All @@ -128,6 +129,7 @@
<orderEntry type="library" exported="" name="play-services-analytics-8.4.0" level="project" />
<orderEntry type="library" exported="" name="support-v4-23.2.1" level="project" />
<orderEntry type="library" exported="" name="play-services-drive-8.4.0" level="project" />
<orderEntry type="library" exported="" name="bolts-android-1.4.0" level="project" />
<orderEntry type="library" exported="" name="support-annotations-23.2.1" level="project" />
<orderEntry type="library" exported="" name="animated-vector-drawable-23.2.1" level="project" />
<orderEntry type="library" exported="" name="support-vector-drawable-23.2.1" level="project" />
Expand All @@ -141,6 +143,7 @@
<orderEntry type="library" exported="" name="OnBarcode.AndroidBarcode" level="project" />
<orderEntry type="library" exported="" name="play-services-gcm-8.4.0" level="project" />
<orderEntry type="library" exported="" name="mediarouter-v7-23.0.0" level="project" />
<orderEntry type="library" exported="" name="bolts-applinks-1.4.0" level="project" />
<orderEntry type="library" exported="" name="play-services-nearby-8.4.0" level="project" />
<orderEntry type="library" exported="" name="play-services-basement-8.4.0" level="project" />
<orderEntry type="library" exported="" name="play-services-fitness-8.4.0" level="project" />
Expand Down
2 changes: 2 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ android {
buildTypes {
release {
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
Expand All @@ -28,4 +29,5 @@ dependencies {
compile 'com.google.android.gms:play-services-plus:8.4.0'
compile 'com.google.android.gms:play-services-maps:8.4.0'
compile 'com.google.android.gms:play-services:8.4.0'
compile 'com.parse.bolts:bolts-android:1.+'
}
17 changes: 16 additions & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,21 @@
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

<permission
android:name="com.parse.starter.permission.C2D_MESSAGE"
android:protectionLevel="signature" />

<uses-permission android:name="com.disperz.codeforindia.permission.C2D_MESSAGE" />

<application
android:name=".ParseApplication"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<service android:name="com.parse.PushService" />

<activity android:name=".Login">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
Expand All @@ -44,7 +53,13 @@
android:label="@string/title_activity_maps" />
<activity
android:name=".CheckpointsMapsActivity"
android:label="@string/title_activity_checkpoints_maps"></activity>
android:label="@string/title_activity_checkpoints_maps" />
<activity
android:name=".RF"
android:label="@string/title_activity_lt" />
<activity
android:name=".AK"
android:label="@string/title_activity_ak"></activity>
</application>

</manifest>
91 changes: 91 additions & 0 deletions app/src/main/java/com/disperz/codeforindia/disperz/AK.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
package com.disperz.codeforindia.disperz;

import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.FragmentActivity;

import com.google.android.gms.maps.CameraUpdateFactory;
import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.maps.OnMapReadyCallback;
import com.google.android.gms.maps.SupportMapFragment;
import com.google.android.gms.maps.model.LatLng;
import com.google.android.gms.maps.model.Marker;
import com.google.android.gms.maps.model.MarkerOptions;

public class AK extends FragmentActivity implements OnMapReadyCallback {

private GoogleMap mMap;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_ak);
// Obtain the SupportMapFragment and get notified when the map is ready to be used.
SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager()
.findFragmentById(R.id.map);
mapFragment.getMapAsync(this);
}


/**
* Manipulates the map once available.
* This callback is triggered when the map is ready to be used.
* This is where we can add markers or lines, add listeners or move the camera. In this case,
* we just add a marker near Sydney, Australia.
* If Google Play services is not installed on the device, the user will be prompted to install
* it inside the SupportMapFragment. This method will only be triggered once the user has
* installed Google Play services and returned to the app.
*/
@Override
public void onMapReady(GoogleMap googleMap) {
mMap = googleMap;


LatLng chLocation = new LatLng(28.612706, 77.277546);
mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(chLocation, 17));

LatLng check1 = new LatLng(28.612706, 77.277546);
mMap.addMarker(new MarkerOptions().position(check1).title("Mandir"));

LatLng rash = new LatLng(28.613781, 77.277174);
mMap.addMarker(new MarkerOptions().position(rash).title("Hirdya Kamal")).showInfoWindow();

LatLng akshar = new LatLng(28.613877, 77.279382);
mMap.addMarker(new MarkerOptions().position(akshar).title("Gandhi Statue"));

LatLng redfort = new LatLng(28.614041, 77.280853);
mMap.addMarker(new MarkerOptions().position(redfort).title("Freedom Fighters"));

mMap.setOnMarkerClickListener(new GoogleMap.OnMarkerClickListener() {

@Override
public boolean onMarkerClick(Marker arg0) {

Intent intent = new Intent(AK.this, GetTicket.class);
intent.putExtra("PLACE", arg0.getTitle());

if (arg0.getTitle().equals("Mandir")) // if marker source is clicked
{
intent.putExtra("GATE", "Gate 1");
}
if (arg0.getTitle().equals("Hirdya Kamal")) // if marker source is clicked
{
intent.putExtra("GATE", "Gate 2");
}

if (arg0.getTitle().equals("Gandhi Statue")) // if marker source is clicked
{
intent.putExtra("GATE", "Gate 3");
}

if (arg0.getTitle().equals("Freedom Fighters")) // if marker source is clicked
{
intent.putExtra("GATE", "Gate 4");
}

startActivity(intent);
return true;
}
});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import com.google.android.gms.maps.model.LatLng;
import com.google.android.gms.maps.model.Marker;
import com.google.android.gms.maps.model.MarkerOptions;
import com.parse.ParseUser;

public class CheckpointsMapsActivity extends FragmentActivity implements OnMapReadyCallback {

Expand All @@ -20,6 +21,9 @@ public class CheckpointsMapsActivity extends FragmentActivity implements OnMapRe
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_checkpoints_maps);

ParseUser.enableAutomaticUser();

// Obtain the SupportMapFragment and get notified when the map is ready to be used.
SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager()
.findFragmentById(R.id.map);
Expand Down Expand Up @@ -92,4 +96,5 @@ public boolean onMarkerClick(Marker arg0) {
}
});
}

}
24 changes: 20 additions & 4 deletions app/src/main/java/com/disperz/codeforindia/disperz/GetTicket.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,27 @@ protected void onCreate(Bundle savedInstanceState) {
public void run() {
//Do something after 100ms

Intent intent_1 = new Intent(GetTicket.this, CheckpointsMapsActivity.class);
intent_1.putExtra("PLACE", name);
startActivity(intent_1);
if (name.equals("Red Fort")) // if marker source is clicked
{
Intent intent = new Intent(GetTicket.this, RF.class);
intent.putExtra("PLACE", name);
intent.putExtra("GATE", "Entry");
startActivity(intent);
}
if (name.equals("Akshardham")) // if marker source is clicked
{
Intent intent = new Intent(GetTicket.this, AK.class);
intent.putExtra("PLACE", name);
intent.putExtra("GATE", "Entry");
startActivity(intent);
}
if (name.equals("Rashtrapati Bhavan")) {
Intent intent = new Intent(GetTicket.this, CheckpointsMapsActivity.class);
intent.putExtra("PLACE", name);
startActivity(intent);
}
}
}, 6000);
}, 10000);

setContentView(view);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ protected void onCreate(Bundle savedInstanceState) {
public void onMapReady(GoogleMap googleMap) {
mMap = googleMap;

LatLng chLocation = new LatLng(28, 77);
LatLng chLocation = new LatLng(28.631713, 77.217109);
mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(chLocation, 9));

// Add a marker in Sydney and move the camera
Expand All @@ -52,9 +52,11 @@ public void onMapReady(GoogleMap googleMap) {

LatLng redfort = new LatLng(28.6560, 77.2410);
mMap.addMarker(new MarkerOptions().position(redfort).title("Red Fort"));
/*
LatLng lotus = new LatLng(28.5533, 77.2586);
mMap.addMarker(new MarkerOptions().position(lotus).title("Lotus Temple"));
*/

mMap.setOnMarkerClickListener(new GoogleMap.OnMarkerClickListener() {

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package com.disperz.codeforindia.disperz;

import android.app.Application;

import com.parse.Parse;
import com.parse.ParseInstallation;

public class ParseApplication extends Application {
public static final String YOUR_APPLICATION_ID = "s1z27FruCTuXoiupts6PXKsrYMYUnvm5W9QhpouM";
public static final String YOUR_CLIENT_KEY = "HdN6B3JN6jGbGVUNJL8aFuRQhkrBBiiMXyNDImJr";

@Override
public void onCreate() {
super.onCreate();

try {
// Add your initialization code here
Parse.initialize(this, YOUR_APPLICATION_ID, YOUR_CLIENT_KEY);
ParseInstallation.getCurrentInstallation().saveInBackground();
} catch (Exception e) {
e.printStackTrace();
}

}
}

Loading

0 comments on commit a33c9af

Please sign in to comment.