Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class MapsActivity extends FragmentActivity implements OnMapReadyCallback, GoogleApiClient.ConnectionCallbacks,
- GoogleApiClient.OnConnectionFailedListener, LocationListener {
- private GoogleMap mMap;
- String Longitude, Latitude;
- Location ll;
- final String TAG = "GPS";
- private long UPDATE_INTERVAL = 2 * 1000; /* 10 secs */
- private long FASTEST_INTERVAL = 2000; /* 2 sec */
- static final int MY_PERMISSIONS_REQUEST_ACCESS_FINE_LOCATION = 1;
- GoogleApiClient gac;
- LocationRequest locationRequest;
- int PLACE_AUTOCOMPLETE_REQUEST_CODE = 1;
- PlaceAutocompleteFragment autocompleteFragment;
- Marker markerDesti, markerCurrentLoc;
- LatLng DestiLoc;
- double LatDesti, latCurrent;
- double LonDesti, lngCurrent;
- private static final int REQUEST_CODE_PERMISSION = 2;
- String mPermission = Manifest.permission.ACCESS_FINE_LOCATION;
- PendingIntent mGeofencePendingIntent;
- ArrayList<Geofence> mGeofenceList;
- private GeofencingClient mGeofencingClient;
- TextView TestBtn;
- LocationRequest mLocationRequest;
- private GeofancingResultCallBack geofancingResultCallBack;
- public static final class Constants {
- public static int GEOFENCE_RADIUS_IN_METERS = 1000;
- public static int GEOFENCE_EXPIRATION_IN_MILLISECONDS = 1000;
- }
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.activity_main);
- SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager()
- .findFragmentById(R.id.map);
- mapFragment.getMapAsync(this);
- TestBtn = (TextView) findViewById(R.id.TestBtn);
- isGooglePlayServicesAvailable();
- if (!isLocationEnabled())
- showAlert();
- locationRequest = new LocationRequest();
- locationRequest.setInterval(UPDATE_INTERVAL);
- locationRequest.setFastestInterval(FASTEST_INTERVAL);
- locationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);
- gac = new GoogleApiClient.Builder(this)
- .addConnectionCallbacks(this)
- .addOnConnectionFailedListener(this)
- .addApi(LocationServices.API)
- .build();
- //========================= PLACES API DROP DOWN============================//
- mGeofencingClient = LocationServices.getGeofencingClient(this);
- mGeofenceList = new ArrayList<>();
- }
- @Override
- public void onMapReady(GoogleMap googleMap) {
- mMap = googleMap;
- if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION)
- != PackageManager.PERMISSION_GRANTED &&
- ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION)
- != PackageManager.PERMISSION_GRANTED) {
- // TODO: Consider calling
- // ActivityCompat#requestPermissions
- // here to request the missing permissions, and then overriding
- // public void onRequestPermissionsResult(int requestCode, String[] permissions,
- // int[] grantResults)
- // to handle the case where the user grants the permission. See the documentation
- // for ActivityCompat#requestPermissions for more details.
- return;
- }
- mMap.setMyLocationEnabled(true);
- getPlacesApi();
- }
- @Override
- protected void onStart() {
- gac.connect();
- super.onStart();
- }
- @Override
- protected void onStop() {
- gac.disconnect();
- super.onStop();
- }
- @Override
- public void onLocationChanged(Location location) {
- if (location != null) {
- updateUI(location);
- }
- }
- @Override
- public void onConnected(@Nullable Bundle bundle) {
- if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION)
- != PackageManager.PERMISSION_GRANTED
- && ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION)
- != PackageManager.PERMISSION_GRANTED) {
- ActivityCompat.requestPermissions(MapsActivity.this,
- new String[]{Manifest.permission.ACCESS_FINE_LOCATION},
- MY_PERMISSIONS_REQUEST_ACCESS_FINE_LOCATION);
- return;
- }
- Log.d(TAG, "onConnected");
- ll = LocationServices.FusedLocationApi.getLastLocation(gac);
- Log.d(TAG, "LastLocation: " + (ll == null ? "NO LastLocation" : ll.toString()));
- Log.e("MYLatLonLocationService", ll.toString());
- Latitude = Double.toString(ll.getLatitude());
- Longitude = Double.toString(ll.getLongitude());
- Toast.makeText(getApplicationContext(), Latitude + "n" + Longitude, Toast.LENGTH_LONG).show();
- Log.e("Lat&Lon", Latitude + "n" + Longitude);
- latCurrent = ll.getLatitude();
- lngCurrent = ll.getLongitude();
- LatLng locCurrent = new LatLng(latCurrent, lngCurrent);
- markerCurrentLoc = mMap.addMarker(new MarkerOptions()
- .position(locCurrent)
- .title("My Location"));
- if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION)
- != PackageManager.PERMISSION_GRANTED &&
- ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION)
- != PackageManager.PERMISSION_GRANTED) {
- return;
- }
- LocationServices.FusedLocationApi.requestLocationUpdates(gac, locationRequest, this);
- }
- //=========== DRAW CURRENT LOCATION==============//
- private void drawAllMarker() {
- LatLng locCurrent = new LatLng(latCurrent, lngCurrent);
- //mMap.addMarker(new MarkerOptions().position(locCurrent).title("My Location"));
- markerCurrentLoc = mMap.addMarker(new MarkerOptions()
- .position(locCurrent)
- .title("My Location"));
- /*mMap.moveCamera(CameraUpdateFactory.newLatLng(locCurrent));
- CameraPosition cameraPosition = new CameraPosition.Builder().target(
- locCurrent).zoom(13).build();
- mMap.animateCamera(CameraUpdateFactory.newCameraPosition(cameraPosition));*/
- if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION)
- != PackageManager.PERMISSION_GRANTED &&
- ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION)
- != PackageManager.PERMISSION_GRANTED) {
- return;
- }
- LocationServices.FusedLocationApi.requestLocationUpdates(gac, locationRequest, this);
- }
- //=========== onRequestPermissionsResult ==============//
- @Override
- public void onRequestPermissionsResult(
- int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
- switch (requestCode) {
- case MY_PERMISSIONS_REQUEST_ACCESS_FINE_LOCATION: {
- // If request is cancelled, the result arrays are empty.
- if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
- Toast.makeText(MapsActivity.this, "Permission was granted!", Toast.LENGTH_LONG).show();
- try {
- LocationServices.FusedLocationApi.requestLocationUpdates(
- gac, locationRequest, this);
- } catch (SecurityException e) {
- Toast.makeText(MapsActivity.this, "SecurityException:n" + e.toString(), Toast.LENGTH_LONG).show();
- }
- } else {
- Toast.makeText(MapsActivity.this, "Permission denied!", Toast.LENGTH_LONG).show();
- }
- return;
- }
- }
- }
- @Override
- public void onConnectionSuspended(int i) {
- }
- @Override
- public void onConnectionFailed(@NonNull ConnectionResult connectionResult) {
- Toast.makeText(MapsActivity.this, "onConnectionFailed: n" + connectionResult.toString(),
- Toast.LENGTH_LONG).show();
- Log.d("DDD", connectionResult.toString());
- }
- private void updateUI(Location loc) {
- Log.d(TAG, "updateUI");
- /*tvLatitude.setText(Double.toString(loc.getLatitude()));
- tvLongitude.setText(Double.toString(loc.getLongitude()));
- tvTime.setText(DateFormat.getTimeInstance().format(loc.getTime()));*/
- TestBtn.setText(Double.toString(loc.getLatitude()));
- if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION)
- != PackageManager.PERMISSION_GRANTED &&
- ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
- // TODO: Consider calling
- return;
- }
- ll = LocationServices.FusedLocationApi.getLastLocation(gac);
- Log.d(TAG, "LastLocation: " + (ll == null ? "NO LastLocation" : ll.toString()));
- Log.e("MYLatLonLocationService", ll.toString());
- Latitude = Double.toString(ll.getLatitude());
- Longitude = Double.toString(ll.getLongitude());
- Toast.makeText(getApplicationContext(), Latitude + "n" + Longitude, Toast.LENGTH_LONG).show();
- Log.e("Lat&Lon", Latitude + "n" + Longitude);
- if (markerCurrentLoc != null) {
- markerCurrentLoc.remove();
- latCurrent = ll.getLatitude();
- lngCurrent = ll.getLongitude();
- LatLng locCurrent = new LatLng(latCurrent, lngCurrent);
- markerCurrentLoc = mMap.addMarker(new MarkerOptions()
- .position(locCurrent)
- .title("My Location"));
- CameraPosition cameraPosition = new CameraPosition.Builder().target(
- locCurrent).zoom(12).build();
- mMap.animateCamera(CameraUpdateFactory.newCameraPosition(cameraPosition));
- if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION)
- != PackageManager.PERMISSION_GRANTED &&
- ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION)
- != PackageManager.PERMISSION_GRANTED) {
- return;
- }
- LocationServices.FusedLocationApi.requestLocationUpdates(gac, locationRequest, this);
- }else {
- latCurrent = ll.getLatitude();
- lngCurrent = ll.getLongitude();
- LatLng locCurrent = new LatLng(latCurrent, lngCurrent);
- markerCurrentLoc = mMap.addMarker(new MarkerOptions()
- .position(locCurrent)
- .title("My Location"));
- markerCurrentLoc = mMap.addMarker(new MarkerOptions()
- .position(locCurrent)
- .title("My Location"));
- CameraPosition cameraPosition = new CameraPosition.Builder().target(
- locCurrent).zoom(12).build();
- mMap.animateCamera(CameraUpdateFactory.newCameraPosition(cameraPosition));
- if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION)
- != PackageManager.PERMISSION_GRANTED &&
- ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION)
- != PackageManager.PERMISSION_GRANTED) {
- return;
- }
- LocationServices.FusedLocationApi.requestLocationUpdates(gac, locationRequest, this);
- }
- }
- private boolean isLocationEnabled() {
- LocationManager locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
- return locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER) ||
- locationManager.isProviderEnabled(LocationManager.NETWORK_PROVIDER);
- }
- private boolean isGooglePlayServicesAvailable() {
- final int PLAY_SERVICES_RESOLUTION_REQUEST = 9000;
- GoogleApiAvailability apiAvailability = GoogleApiAvailability.getInstance();
- int resultCode = apiAvailability.isGooglePlayServicesAvailable(this);
- if (resultCode != ConnectionResult.SUCCESS) {
- if (apiAvailability.isUserResolvableError(resultCode)) {
- apiAvailability.getErrorDialog(this, resultCode, PLAY_SERVICES_RESOLUTION_REQUEST)
- .show();
- } else {
- Log.d(TAG, "This device is not supported.");
- finish();
- }
- return false;
- }
- Log.d(TAG, "This device is supported.");
- return true;
- }
- private void showAlert() {
- final AlertDialog.Builder dialog = new AlertDialog.Builder(this);
- dialog.setTitle("Enable Location")
- .setMessage("Your Locations Settings is set to 'Off'.nPlease Enable Location to " +
- "use this app")
- .setPositiveButton("Location Settings", new DialogInterface.OnClickListener() {
- @Override
- public void onClick(DialogInterface paramDialogInterface, int paramInt) {
- Intent myIntent = new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS);
- startActivity(myIntent);
- }
- })
- .setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
- @Override
- public void onClick(DialogInterface paramDialogInterface, int paramInt) {
- }
- });
- dialog.show();
- }
- //=========================== PLACES API=======================//
- public void getPlacesApi() {
- autocompleteFragment = (PlaceAutocompleteFragment)
- getFragmentManager().findFragmentById(R.id.place_autocomplete_fragment);
- autocompleteFragment.setOnPlaceSelectedListener(new PlaceSelectionListener() {
- @Override
- public void onPlaceSelected(Place place) {
- // TODO: Get info about the selected place.
- Log.i(TAG, "Place: " + place.getName());
- if (markerDesti != null) {
- markerDesti.remove();
- LatDesti = place.getLatLng().latitude;
- LonDesti = place.getLatLng().longitude;
- Log.e("LatLonDest", String.valueOf(LatDesti));
- DestiLoc = new LatLng(LatDesti, LonDesti);
- markerDesti = mMap.addMarker(new MarkerOptions()
- .position(DestiLoc)
- .title("My Destination"));
- mMap.moveCamera(CameraUpdateFactory.newLatLng(DestiLoc));
- CameraPosition cameraPosition = new CameraPosition.Builder().target(
- DestiLoc).zoom(12).build();
- mMap.animateCamera(CameraUpdateFactory.newCameraPosition(cameraPosition));
- mGeofenceList.add(new Geofence.Builder()
- .setRequestId("120")
- .setCircularRegion(
- LatDesti,
- LonDesti,
- Constants.GEOFENCE_RADIUS_IN_METERS
- )
- .setExpirationDuration(Constants.GEOFENCE_EXPIRATION_IN_MILLISECONDS)
- .setTransitionTypes(Geofence.GEOFENCE_TRANSITION_ENTER |
- Geofence.GEOFENCE_TRANSITION_EXIT)
- .build());
- //geofancingResultCallBack.regesterAllGeofance();
- //geofancingResultCallBack.myUpdateGeoFance(LatDesti, LonDesti);
- //geofancingResultCallBack.getGeofencingRequest();
- //geofancingResultCallBack.getmPendingIntent();
- } else {
- LatDesti = place.getLatLng().latitude;
- LonDesti = place.getLatLng().longitude;
- Log.e("LatLonDest", String.valueOf(LatDesti));
- DestiLoc = new LatLng(LatDesti, LonDesti);
- markerDesti = mMap.addMarker(new MarkerOptions()
- .position(DestiLoc)
- .title("My Destination"));
- mMap.moveCamera(CameraUpdateFactory.newLatLng(DestiLoc));
- CameraPosition cameraPosition = new CameraPosition.Builder().target(
- DestiLoc).zoom(12).build();
- mMap.animateCamera(CameraUpdateFactory.newCameraPosition(cameraPosition));
- mGeofenceList.add(new Geofence.Builder()
- .setRequestId("120")
- .setCircularRegion(
- LatDesti,
- LonDesti,
- Constants.GEOFENCE_RADIUS_IN_METERS
- )
- .setExpirationDuration(Constants.GEOFENCE_EXPIRATION_IN_MILLISECONDS)
- .setTransitionTypes(Geofence.GEOFENCE_TRANSITION_ENTER |
- Geofence.GEOFENCE_TRANSITION_EXIT)
- .build());
- //geofancingResultCallBack.regesterAllGeofance();
- //geofancingResultCallBack.myUpdateGeoFance(LatDesti, LonDesti);
- //geofancingResultCallBack.getGeofencingRequest();
- //geofancingResultCallBack.getmPendingIntent();
- }
- if (ActivityCompat.checkSelfPermission(MapsActivity.this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
- // TODO: Consider calling
- return;
- }
- mGeofencingClient.addGeofences(getGeofencingRequest(), getGeofencePendingIntent())
- .addOnSuccessListener(MapsActivity.this, new OnSuccessListener<Void>() {
- @Override
- public void onSuccess(Void aVoid) {
- // Geofences added
- Log.e("Geofencing Location service Api Client", "successfully added");
- }
- })
- .addOnFailureListener(MapsActivity.this, new OnFailureListener() {
- @Override
- public void onFailure(@NonNull Exception e) {
- // Failed to add geofences
- Log.e("Geofencing Location service Api Client", "unsuccessful");
- }
- });
- //============================================================================================//
- }
- @Override
- public void onError(Status status) {
- // TODO: Handle the error.
- Log.i(TAG, "An error occurred: " + status);
- }
- });
- }
- @Override
- protected void onActivityResult(int requestCode, int resultCode, Intent data) {
- super.onActivityResult(requestCode, resultCode, data);
- //autocompleteFragment.onActivityResult(requestCode, resultCode, data);
- if (requestCode == PLACE_AUTOCOMPLETE_REQUEST_CODE) {
- if (resultCode == RESULT_OK) {
- Place place = PlaceAutocomplete.getPlace(this, data);
- Log.i(TAG, "Place:" + place.toString());
- } else if (resultCode == PlaceAutocomplete.RESULT_ERROR) {
- Status status = PlaceAutocomplete.getStatus(this, data);
- Log.i(TAG, status.getStatusMessage());
- } else if (requestCode == RESULT_CANCELED) {
- }
- }
- }
- //============================== GEO FANCING=================================//
- private GeofencingRequest getGeofencingRequest() {
- GeofencingRequest.Builder builder = new GeofencingRequest.Builder();
- builder.setInitialTrigger(GeofencingRequest.INITIAL_TRIGGER_ENTER);
- builder.addGeofences(mGeofenceList);
- return builder.build();
- }
- private PendingIntent getGeofencePendingIntent() {
- // Reuse the PendingIntent if we already have it.
- if (mGeofencePendingIntent != null) {
- return mGeofencePendingIntent;
- }
- Intent intent = new Intent(this, BroadcastReciver.class);
- // We use FLAG_UPDATE_CURRENT so that we get the same pending intent back when
- // calling addGeofences() and removeGeofences().
- mGeofencePendingIntent = PendingIntent.getService(this, 0, intent, PendingIntent.
- FLAG_UPDATE_CURRENT);
- return mGeofencePendingIntent;
- }
- public class BroadcastReciver extends BroadcastReceiver {
- //Placer Geofence intent action name
- public static final String INTENT_ACTION_TRIGGER_FIRED = "com.placer.action.TRIGGER_FIRED";
- public static final String TAG1 = GeofanceBroadCastReciver.class.getSimpleName();
- private static final String TAG = "GeofenceTransitions";
- public BroadcastReciver() {
- }
- @Override
- public void onReceive(Context context, Intent intent) {
- /*GeofencingEvent geofencingEvent = GeofencingEvent.fromIntent(intent);
- if (geofencingEvent.hasError()){
- Log.e(TAG,String.format("Error code :%d",geofencingEvent.getErrorCode()));
- return;
- }
- int geofenceTransition = geofencingEvent.getGeofenceTransition();
- if (geofenceTransition == Geofence.GEOFENCE_TRANSITION_ENTER){
- Log.e("Geo Fance ENTER","Geo Fance ENTER");
- Toast.makeText(context, "Geo Fance ENTER", Toast.LENGTH_SHORT).show();
- }else if (geofenceTransition == Geofence.GEOFENCE_TRANSITION_EXIT){
- Log.e("Geo Fance EXIT","Geo Fance EXIT");
- Toast.makeText(context,"Geo Fance EXIT",Toast.LENGTH_SHORT).show();
- }
- else {
- Log.e(TAG,String.format("Unknown Transition :%",geofenceTransition));
- return;
- }
- sendNotification(context,geofenceTransition);*/
- if (intent.getAction().equals(INTENT_ACTION_TRIGGER_FIRED)) {
- Log.e("ReciverWorking","ReciverWorking");
- GeofencingEvent geofencingEvent = GeofencingEvent.fromIntent(intent);
- if (geofencingEvent.hasError()) {
- Log.e(TAG, "Goefencing Error " + geofencingEvent.getErrorCode());
- return;
- }
- // Get the transition type.
- int geofenceTransition = geofencingEvent.getGeofenceTransition();
- Log.i(TAG, "geofenceTransition = " + geofenceTransition + " Enter : " + Geofence.GEOFENCE_TRANSITION_ENTER + "Exit : " + Geofence.GEOFENCE_TRANSITION_EXIT);
- if (geofenceTransition == Geofence.GEOFENCE_TRANSITION_ENTER || geofenceTransition == Geofence.GEOFENCE_TRANSITION_DWELL){
- showNotification("Congrats!!!", "You have reached your destination..",context);
- Toast.makeText(context,"Enter the Location",Toast.LENGTH_SHORT).show();
- }
- else if(geofenceTransition == Geofence.GEOFENCE_TRANSITION_EXIT) {
- Log.i(TAG, "Showing Notification...");
- showNotification("Exited", "Exited the Location",context);
- Toast.makeText(context,"Exited the Location",Toast.LENGTH_SHORT).show();
- } else {
- // Log the error.
- showNotification("Error", "Error",context);
- Log.e(TAG, "Error ");
- }
- }else {
- throw new UnsupportedOperationException("Not yet implemented");
- }
- }
- private void sendNotification(Context context,int transationType){
- Intent notificationIntent = new Intent(context,MapsActivity.class);
- TaskStackBuilder stackBuilder = TaskStackBuilder.create(context);
- stackBuilder.addParentStack(MapsActivity.class);
- stackBuilder.addNextIntent(notificationIntent);
- PendingIntent notificationpendingIntent = stackBuilder.getPendingIntent(0,PendingIntent.FLAG_UPDATE_CURRENT);
- NotificationCompat.Builder builder = new NotificationCompat.Builder(context);
- if (transationType == Geofence.GEOFENCE_TRANSITION_ENTER){
- builder.setSmallIcon(R.mipmap.ic_launcher);
- builder.setContentTitle("Entered");
- }else if (transationType == Geofence.GEOFENCE_TRANSITION_EXIT) {
- builder.setSmallIcon(R.mipmap.ic_launcher);
- builder.setContentTitle("Exit");
- }
- builder.setContentText("Touch to launch the app");
- builder.setContentIntent(notificationpendingIntent);
- builder.setAutoCancel(true);
- NotificationManager notificationManager = (NotificationManager)context.getSystemService(Context.NOTIFICATION_SERVICE);
- notificationManager.notify(0, builder.build());
- }
- public void showNotification(String text, String bigText,Context context) {
- // 1. Create a NotificationManager
- NotificationManager notificationManager = (NotificationManager)context.getSystemService(Context.NOTIFICATION_SERVICE);
- // 2. Create a PendingIntent for AllGeofencesActivity
- Intent intent = new Intent(context, MapsActivity.class);
- intent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_CLEAR_TOP);
- PendingIntent pendingNotificationIntent = PendingIntent.getActivity(context, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT);
- // 3. Create and send a notification
- Notification notification = new NotificationCompat.Builder(context)
- .setSmallIcon(R.mipmap.ic_launcher)
- .setContentTitle("Congrats!!!")
- .setContentText("You Have reached the destination")
- .setContentIntent(pendingNotificationIntent)
- .setStyle(new NotificationCompat.BigTextStyle().bigText(bigText))
- .setPriority(NotificationCompat.PRIORITY_HIGH)
- .setAutoCancel(true)
- .build();
- notificationManager.notify(0, notification);
- }
- <?xml version="1.0" encoding="utf-8"?>
- <!--
- The ACCESS_COARSE/FINE_LOCATION permissions are not required to use
- Google Maps Android API v2, but you must specify either coarse or fine
- location permissions for the 'MyLocation' functionality.
- -->
- <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
- <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
- <uses-permission android:name="android.permission.INTERNET" />
- <uses-feature android:name="android.hardware.location.gps" />
- <application
- android:allowBackup="true"
- android:icon="@mipmap/ic_launcher"
- android:label="@string/app_name"
- android:supportsRtl="true"
- android:theme="@style/AppTheme">
- <meta-data
- android:name="com.google.android.geo.API_KEY"
- android:value="@string/google_maps_key" />
- <activity
- android:name=".main.MapsActivity"
- android:label="@string/title_activity_maps">
- <intent-filter>
- <action android:name="android.intent.action.MAIN" />
- <category android:name="android.intent.category.LAUNCHER" />
- </intent-filter>
- </activity>
- <service
- android:name=".adapters.GeofenceTransitionsIntentService"
- android:exported="true" />
- <receiver
- android:name="com.map.pallabedp.locationbasedtracking.main.BroadcastReciver"
- android:enabled="true"
- android:exported="false">
- <intent-filter>
- <action android:name="com.placer.action.TRIGGER_FIRED" />
- <action android:name="my.action.string" />
- <action android:name="com.map.pallabedp.locationbasedtracking.main.BroadcastReciver"/>
- </intent-filter>
- </receiver>
- </application>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement