diff --git a/Taxi app clone/ubersachin/.gitignore b/Taxi app clone/ubersachin/.gitignore
new file mode 100644
index 0000000..603b140
--- /dev/null
+++ b/Taxi app clone/ubersachin/.gitignore
@@ -0,0 +1,14 @@
+*.iml
+.gradle
+/local.properties
+/.idea/caches
+/.idea/libraries
+/.idea/modules.xml
+/.idea/workspace.xml
+/.idea/navEditor.xml
+/.idea/assetWizardSettings.xml
+.DS_Store
+/build
+/captures
+.externalNativeBuild
+.cxx
diff --git a/Taxi app clone/ubersachin/.idea/.name b/Taxi app clone/ubersachin/.idea/.name
new file mode 100644
index 0000000..ac07623
--- /dev/null
+++ b/Taxi app clone/ubersachin/.idea/.name
@@ -0,0 +1 @@
+uber sachin
\ No newline at end of file
diff --git a/Taxi app clone/ubersachin/.idea/codeStyles/Project.xml b/Taxi app clone/ubersachin/.idea/codeStyles/Project.xml
new file mode 100644
index 0000000..681f41a
--- /dev/null
+++ b/Taxi app clone/ubersachin/.idea/codeStyles/Project.xml
@@ -0,0 +1,116 @@
+
+
+
+
+
+
+
+
+
+
+
+
+ xmlns:android
+
+ ^$
+
+
+
+
+
+
+
+
+ xmlns:.*
+
+ ^$
+
+
+ BY_NAME
+
+
+
+
+
+
+ .*:id
+
+ http://schemas.android.com/apk/res/android
+
+
+
+
+
+
+
+
+ .*:name
+
+ http://schemas.android.com/apk/res/android
+
+
+
+
+
+
+
+
+ name
+
+ ^$
+
+
+
+
+
+
+
+
+ style
+
+ ^$
+
+
+
+
+
+
+
+
+ .*
+
+ ^$
+
+
+ BY_NAME
+
+
+
+
+
+
+ .*
+
+ http://schemas.android.com/apk/res/android
+
+
+ ANDROID_ATTRIBUTE_ORDER
+
+
+
+
+
+
+ .*
+
+ .*
+
+
+ BY_NAME
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Taxi app clone/ubersachin/.idea/gradle.xml b/Taxi app clone/ubersachin/.idea/gradle.xml
new file mode 100644
index 0000000..5cd135a
--- /dev/null
+++ b/Taxi app clone/ubersachin/.idea/gradle.xml
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Taxi app clone/ubersachin/.idea/inspectionProfiles/Project_Default.xml b/Taxi app clone/ubersachin/.idea/inspectionProfiles/Project_Default.xml
new file mode 100644
index 0000000..43e37dd
--- /dev/null
+++ b/Taxi app clone/ubersachin/.idea/inspectionProfiles/Project_Default.xml
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Taxi app clone/ubersachin/.idea/misc.xml b/Taxi app clone/ubersachin/.idea/misc.xml
new file mode 100644
index 0000000..37a7509
--- /dev/null
+++ b/Taxi app clone/ubersachin/.idea/misc.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Taxi app clone/ubersachin/.idea/runConfigurations.xml b/Taxi app clone/ubersachin/.idea/runConfigurations.xml
new file mode 100644
index 0000000..7f68460
--- /dev/null
+++ b/Taxi app clone/ubersachin/.idea/runConfigurations.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Taxi app clone/ubersachin/app/.gitignore b/Taxi app clone/ubersachin/app/.gitignore
new file mode 100644
index 0000000..796b96d
--- /dev/null
+++ b/Taxi app clone/ubersachin/app/.gitignore
@@ -0,0 +1 @@
+/build
diff --git a/Taxi app clone/ubersachin/app/build.gradle b/Taxi app clone/ubersachin/app/build.gradle
new file mode 100644
index 0000000..e288404
--- /dev/null
+++ b/Taxi app clone/ubersachin/app/build.gradle
@@ -0,0 +1,52 @@
+apply plugin: 'com.android.application'
+
+
+android {
+ compileSdkVersion 29
+ buildToolsVersion "29.0.3"
+
+ defaultConfig {
+ applicationId "com.example.ubersachin"
+ minSdkVersion 23
+ targetSdkVersion 29
+ versionCode 1
+ versionName "1.0"
+
+ testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
+ }
+
+ buildTypes {
+ release {
+ minifyEnabled false
+ proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
+ }
+ }
+
+}
+
+dependencies {
+ implementation fileTree(dir: 'libs', include: ['*.jar'])
+
+ implementation 'androidx.appcompat:appcompat:1.0.2'
+ implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
+ implementation 'com.google.android.gms:play-services-maps:17.0.0'
+ testImplementation 'junit:junit:4.12'
+ androidTestImplementation 'androidx.test.ext:junit:1.1.1'
+ androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
+ implementation 'com.google.firebase:firebase-analytics:17.2.2'
+ implementation 'com.google.firebase:firebase-analytics:17.3.0'
+ implementation 'com.google.firebase:firebase-auth:19.3.0'
+ implementation 'com.google.firebase:firebase-storage:19.1.1'
+ implementation 'com.google.firebase:firebase-storage-ktx:19.1.1'
+ implementation 'com.github.bumptech.glide:glide:4.11.0'
+ annotationProcessor 'com.github.bumptech.glide:compiler:4.11.0'
+ implementation 'com.google.firebase:firebase-core:17.2.3'
+ implementation 'com.google.firebase:firebase-database:19.2.1'
+ implementation 'com.google.android.gms:play-services-location:17.0.0'
+ implementation 'com.firebase:geofire-java:3.0.0'
+ implementation 'com.android.support:cardview-v7:28.0.0'
+ implementation 'com.google.android.libraries.places:places:2.2.0'
+ implementation 'com.github.jd-alexander:library:1.1.0'
+
+}
+apply plugin: 'com.google.gms.google-services'
diff --git a/Taxi app clone/ubersachin/app/google-services.json b/Taxi app clone/ubersachin/app/google-services.json
new file mode 100644
index 0000000..edb8b74
--- /dev/null
+++ b/Taxi app clone/ubersachin/app/google-services.json
@@ -0,0 +1,48 @@
+{
+ "project_info": {
+ "project_number": "494657388959",
+ "firebase_url": "https://uber-sachin-82ddf.firebaseio.com",
+ "project_id": "uber-sachin-82ddf",
+ "storage_bucket": "uber-sachin-82ddf.appspot.com"
+ },
+ "client": [
+ {
+ "client_info": {
+ "mobilesdk_app_id": "1:494657388959:android:faf577dff0bc8c574a7daa",
+ "android_client_info": {
+ "package_name": "com.example.ubersachin"
+ }
+ },
+ "oauth_client": [
+ {
+ "client_id": "494657388959-ebcoaioos5fo33ho1c70t3t8o6h56h3a.apps.googleusercontent.com",
+ "client_type": 1,
+ "android_info": {
+ "package_name": "com.example.ubersachin",
+ "certificate_hash": "6db7111d5bdaad7b0d931c94169d9c4103b264e7"
+ }
+ },
+ {
+ "client_id": "494657388959-7p3irkdsnsdms0jo25e7nfhtlquqtccd.apps.googleusercontent.com",
+ "client_type": 3
+ }
+ ],
+ "api_key": [
+ {
+ "current_key": "AIzaSyDi0bUEQDUtK_ewpzzKYp5bSFb1pKbSDjs"
+ }
+ ],
+ "services": {
+ "appinvite_service": {
+ "other_platform_oauth_client": [
+ {
+ "client_id": "494657388959-7p3irkdsnsdms0jo25e7nfhtlquqtccd.apps.googleusercontent.com",
+ "client_type": 3
+ }
+ ]
+ }
+ }
+ }
+ ],
+ "configuration_version": "1"
+}
\ No newline at end of file
diff --git a/Taxi app clone/ubersachin/app/proguard-rules.pro b/Taxi app clone/ubersachin/app/proguard-rules.pro
new file mode 100644
index 0000000..f1b4245
--- /dev/null
+++ b/Taxi app clone/ubersachin/app/proguard-rules.pro
@@ -0,0 +1,21 @@
+# Add project specific ProGuard rules here.
+# You can control the set of applied configuration files using the
+# proguardFiles setting in build.gradle.
+#
+# For more details, see
+# http://developer.android.com/guide/developing/tools/proguard.html
+
+# If your project uses WebView with JS, uncomment the following
+# and specify the fully qualified class name to the JavaScript interface
+# class:
+#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
+# public *;
+#}
+
+# Uncomment this to preserve the line number information for
+# debugging stack traces.
+#-keepattributes SourceFile,LineNumberTable
+
+# If you keep the line number information, uncomment this to
+# hide the original source file name.
+#-renamesourcefileattribute SourceFile
diff --git a/Taxi app clone/ubersachin/app/src/androidTest/java/com/example/ubersachin/ExampleInstrumentedTest.java b/Taxi app clone/ubersachin/app/src/androidTest/java/com/example/ubersachin/ExampleInstrumentedTest.java
new file mode 100644
index 0000000..de6bd18
--- /dev/null
+++ b/Taxi app clone/ubersachin/app/src/androidTest/java/com/example/ubersachin/ExampleInstrumentedTest.java
@@ -0,0 +1,27 @@
+package com.example.ubersachin;
+
+import android.content.Context;
+
+import androidx.test.platform.app.InstrumentationRegistry;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import static org.junit.Assert.*;
+
+/**
+ * Instrumented test, which will execute on an Android device.
+ *
+ * @see Testing documentation
+ */
+@RunWith(AndroidJUnit4.class)
+public class ExampleInstrumentedTest {
+ @Test
+ public void useAppContext() {
+ // Context of the app under test.
+ Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
+
+ assertEquals("com.example.ubersachin", appContext.getPackageName());
+ }
+}
diff --git a/Taxi app clone/ubersachin/app/src/debug/res/values/google_maps_api.xml b/Taxi app clone/ubersachin/app/src/debug/res/values/google_maps_api.xml
new file mode 100644
index 0000000..c63a261
--- /dev/null
+++ b/Taxi app clone/ubersachin/app/src/debug/res/values/google_maps_api.xml
@@ -0,0 +1,24 @@
+
+
+ AIzaSyCndmznM6wBjnRssApDPH8-eYRU38zb7mI
+
diff --git a/Taxi app clone/ubersachin/app/src/main/AndroidManifest.xml b/Taxi app clone/ubersachin/app/src/main/AndroidManifest.xml
new file mode 100644
index 0000000..ecd28d7
--- /dev/null
+++ b/Taxi app clone/ubersachin/app/src/main/AndroidManifest.xml
@@ -0,0 +1,48 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Taxi app clone/ubersachin/app/src/main/java/com/example/ubersachin/CustomerLoginActivity.java b/Taxi app clone/ubersachin/app/src/main/java/com/example/ubersachin/CustomerLoginActivity.java
new file mode 100644
index 0000000..d66e599
--- /dev/null
+++ b/Taxi app clone/ubersachin/app/src/main/java/com/example/ubersachin/CustomerLoginActivity.java
@@ -0,0 +1,97 @@
+package com.example.ubersachin;
+
+import androidx.annotation.NonNull;
+import androidx.appcompat.app.AppCompatActivity;
+
+import android.annotation.SuppressLint;
+import android.content.Intent;
+import android.os.Bundle;
+import android.view.View;
+import android.widget.Button;
+import android.widget.EditText;
+import android.widget.Toast;
+
+import com.google.android.gms.tasks.OnCompleteListener;
+import com.google.android.gms.tasks.Task;
+import com.google.firebase.auth.AuthResult;
+import com.google.firebase.auth.FirebaseAuth;
+import com.google.firebase.auth.FirebaseUser;
+import com.google.firebase.database.DatabaseReference;
+import com.google.firebase.database.FirebaseDatabase;
+
+public class CustomerLoginActivity extends AppCompatActivity {
+
+ private EditText mEmail, mPassword;
+ private Button mLogin, mRegistration;
+
+ private FirebaseAuth mAuth;
+ private FirebaseAuth.AuthStateListener firebaseAuthListener;
+
+ public void onClick1(View v) {
+ final String email = mEmail.getText().toString();
+ final String password = mPassword.getText().toString();
+ mAuth.createUserWithEmailAndPassword(email, password).addOnCompleteListener(CustomerLoginActivity.this, new OnCompleteListener() {
+ @Override
+ public void onComplete(@NonNull Task task) {
+ if(!task.isSuccessful()){
+ Toast.makeText(CustomerLoginActivity.this, "sign up error", Toast.LENGTH_SHORT).show();
+ }else{
+ String user_id = mAuth.getCurrentUser().getUid();
+ DatabaseReference current_user_db = FirebaseDatabase.getInstance().getReference().child("Users").child("Customers").child(user_id);
+ current_user_db.setValue(true);
+ }
+ }
+ });
+ }
+ public void onClick2(View v) {
+ final String email = mEmail.getText().toString();
+ final String password = mPassword.getText().toString();
+ mAuth.signInWithEmailAndPassword(email, password).addOnCompleteListener(CustomerLoginActivity.this, new OnCompleteListener() {
+ @Override
+ public void onComplete(@NonNull Task task) {
+ if(!task.isSuccessful()){
+ Toast.makeText(CustomerLoginActivity.this, "sign in error", Toast.LENGTH_SHORT).show();
+ }
+ }
+ });
+
+ }
+ @SuppressLint("WrongViewCast")
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_customer_login);
+ mAuth = FirebaseAuth.getInstance();
+
+ firebaseAuthListener = new FirebaseAuth.AuthStateListener() {
+ @Override
+ public void onAuthStateChanged(@NonNull FirebaseAuth firebaseAuth) {
+ FirebaseUser user = FirebaseAuth.getInstance().getCurrentUser();
+ if(user!=null){
+ Intent intent = new Intent(CustomerLoginActivity.this, CustomerMapActivity.class);
+ startActivity(intent);
+ finish();
+ }
+ }
+ };
+
+ mEmail = (EditText) findViewById(R.id.email);
+ mPassword = (EditText) findViewById(R.id.password);
+
+ mLogin = (Button) findViewById(R.id.login);
+ mRegistration = (Button) findViewById(R.id.registration);
+ }
+
+
+
+ @Override
+ protected void onStart() {
+ super.onStart();
+ mAuth.addAuthStateListener(firebaseAuthListener);
+ }
+ @Override
+ protected void onStop() {
+ super.onStop();
+ mAuth.removeAuthStateListener(firebaseAuthListener);
+ }
+}
diff --git a/Taxi app clone/ubersachin/app/src/main/java/com/example/ubersachin/CustomerMapActivity.java b/Taxi app clone/ubersachin/app/src/main/java/com/example/ubersachin/CustomerMapActivity.java
new file mode 100644
index 0000000..3c299b4
--- /dev/null
+++ b/Taxi app clone/ubersachin/app/src/main/java/com/example/ubersachin/CustomerMapActivity.java
@@ -0,0 +1,352 @@
+package com.example.ubersachin;
+
+import androidx.annotation.NonNull;
+import androidx.appcompat.app.AppCompatActivity;
+import androidx.core.app.ActivityCompat;
+import androidx.core.content.ContextCompat;
+import androidx.fragment.app.FragmentActivity;
+
+import android.Manifest;
+import android.content.Context;
+import android.content.Intent;
+import android.content.pm.PackageManager;
+import android.location.Location;
+import android.location.LocationListener;
+import android.location.LocationManager;
+import android.os.Build;
+import android.os.Bundle;
+import android.util.Log;
+import android.view.View;
+import android.widget.Button;
+
+import com.firebase.geofire.GeoFire;
+import com.firebase.geofire.GeoLocation;
+import com.firebase.geofire.GeoQuery;
+import com.firebase.geofire.GeoQueryEventListener;
+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.BitmapDescriptorFactory;
+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.google.firebase.auth.FirebaseAuth;
+import com.google.firebase.database.DataSnapshot;
+import com.google.firebase.database.DatabaseError;
+import com.google.firebase.database.DatabaseReference;
+import com.google.firebase.database.FirebaseDatabase;
+import com.google.firebase.database.ValueEventListener;
+
+import java.util.HashMap;
+import java.util.List;
+
+public class CustomerMapActivity extends FragmentActivity implements OnMapReadyCallback {
+ private int radius = 1;
+ private Boolean driverFound = false;
+ private String driverFoundID;
+ private Button mRequest; private Marker pickupMarker;
+ Location mLastLocation;
+ private LatLng pickupLocation;
+ private GoogleMap mMap;
+ LocationManager locationManager;
+ private Boolean requestBol=false;
+
+
+ android.location.LocationListener locationListener;
+
+ public void Settings(View view){
+ Intent intent = new Intent(CustomerMapActivity.this, CustomerSettingsActivity.class);
+ startActivity(intent);
+ return;
+ }
+ public void logout(View view) {
+ FirebaseAuth.getInstance().signOut();
+ Intent intent = new Intent(CustomerMapActivity.this, MainActivity.class);
+ startActivity(intent);
+ finish();
+ }
+
+
+ @Override
+ public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
+ super.onRequestPermissionsResult(requestCode, permissions, grantResults);
+
+ if (requestCode == 1) {
+ if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
+ if (ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED) {
+ locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, locationListener);
+ }
+ }
+ }
+ }
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_customer_map);
+ // 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);
+
+
+ mRequest = findViewById(R.id.calluber);
+ }
+ private GeoQuery geoQuery;
+ public void calluber(final View view) {
+
+ if (requestBol){
+ requestBol = false;
+
+
+
+ if (driverFoundID != null){
+ DatabaseReference driverRef = FirebaseDatabase.getInstance().getReference().child("Users").child("Drivers").child(driverFoundID);
+ driverRef.setValue(true);
+ driverFoundID = null;
+ geoQuery.removeAllListeners();
+ driverLocationRef.removeEventListener(driverLocationRefListener);
+
+ }
+ driverFound = false;
+ radius = 1;
+ String userId = FirebaseAuth.getInstance().getCurrentUser().getUid();
+
+ DatabaseReference ref = FirebaseDatabase.getInstance().getReference("customerRequest");
+ GeoFire geoFire = new GeoFire(ref);
+ geoFire.removeLocation(userId, new GeoFire.CompletionListener() {
+ @Override
+ public void onComplete(String key, DatabaseError error) {
+ if (error != null) {
+ System.err.println("There was an error removing the location from GeoFire: " + error);
+
+ } else {
+ System.out.println("Location removed on server successfully!");
+
+ }
+ }
+ });
+
+ if(pickupMarker != null){
+ pickupMarker.remove();
+ }
+ mRequest.setText("call Uber");
+
+ }
+ else {
+ requestBol = true;
+ locationManager = (LocationManager) this.getSystemService(Context.LOCATION_SERVICE);
+ locationListener = new LocationListener() {
+ @Override
+ public void onLocationChanged(Location location) {
+
+ mMap.clear();
+ String userId = FirebaseAuth.getInstance().getCurrentUser().getUid();
+
+ DatabaseReference ref = FirebaseDatabase.getInstance().getReference("customerRequest");
+ GeoFire geoFire = new GeoFire(ref);
+ geoFire.setLocation(userId, new GeoLocation(location.getLatitude(), location.getLongitude()), new
+ GeoFire.CompletionListener() {
+ @Override
+ public void onComplete(String key, DatabaseError error) {
+ //Do some stuff if you want to
+ if (error != null) {
+ System.err.println("There was an error saving the location to GeoFire: " + error);
+ } else {
+ System.out.println("Location saved on server successfully!");
+ }
+ }
+ });
+
+ pickupLocation = new LatLng(location.getLatitude(), location.getLongitude());
+ pickupMarker=mMap.addMarker(new MarkerOptions().position(pickupLocation).title("Pickup Here"));
+ DatabaseReference driverLocation = FirebaseDatabase.getInstance().getReference().child("driversAvailable");
+
+ GeoFire geoFire1 = new GeoFire(driverLocation);
+ pickupLocation = new LatLng(location.getLatitude(), location.getLongitude());
+ pickupMarker=mMap.addMarker(new MarkerOptions().position(pickupLocation).title("Pickup Here"));
+
+ geoQuery = geoFire1.queryAtLocation(new GeoLocation(pickupLocation.latitude, pickupLocation.longitude), radius);
+ geoQuery.removeAllListeners();
+ geoQuery.addGeoQueryEventListener(new GeoQueryEventListener() {
+ @Override
+ public void onKeyEntered(String key, GeoLocation location) {
+ if (!driverFound) {
+ driverFound = true;
+ driverFoundID = key;
+
+ DatabaseReference driverRef = FirebaseDatabase.getInstance().getReference().child("Users").child("Drivers").child(driverFoundID);
+ String customerId = FirebaseAuth.getInstance().getCurrentUser().getUid();
+ HashMap map = new HashMap();
+ map.put("customerRideId", customerId);
+ driverRef.updateChildren(map);
+
+
+ mRequest.setText("Looking for Driver Location....");
+ getDriverLocation();
+
+ }
+ }
+
+ @Override
+ public void onKeyExited(String key) {
+
+ }
+
+ @Override
+ public void onKeyMoved(String key, GeoLocation location) {
+
+ }
+
+ @Override
+ public void onGeoQueryReady() {
+ if (!driverFound) {
+ radius++;
+ System.out.println("radius is" + radius);
+ calluber(view);
+ }
+ else
+ getDriverLocation();
+ }
+
+ @Override
+ public void onGeoQueryError(DatabaseError error) {
+
+ }
+ });
+
+
+ }
+
+ @Override
+ public void onStatusChanged(String provider, int status, Bundle extras) {
+
+ }
+
+ @Override
+ public void onProviderEnabled(String provider) {
+
+ }
+
+ @Override
+ public void onProviderDisabled(String provider) {
+
+ }
+ };
+
+
+ if (Build.VERSION.SDK_INT < 23) {
+ locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, locationListener);
+ } else {
+ if (ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
+ ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.ACCESS_FINE_LOCATION}, 1);
+ } else {
+ locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, locationListener);
+ Location lastKnownLocation = locationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER);
+
+ mMap.clear();
+ LatLng userLocation = new LatLng(lastKnownLocation.getLatitude(), lastKnownLocation.getLongitude());
+ Log.i("location", userLocation.toString());
+ pickupMarker=mMap.addMarker(new MarkerOptions().position(userLocation).title("pickup"));
+ mMap.moveCamera(CameraUpdateFactory.newLatLng(userLocation));
+
+ }
+ }
+ }
+ }
+
+
+ private DatabaseReference driverLocationRef;
+ private Marker mDriverMarker;
+ private ValueEventListener driverLocationRefListener ;
+ private void getDriverLocation() {
+ driverLocationRef = FirebaseDatabase.getInstance().getReference().child("driversWorking").child(driverFoundID).child("l");
+ driverLocationRefListener =driverLocationRef.addValueEventListener(new ValueEventListener() {
+ @Override
+ public void onDataChange(DataSnapshot dataSnapshot) {
+ if(dataSnapshot.exists()){
+ List