I need to calculate time difference between every location change(onLocationChanged). What is a proper way to do that?
My code for getting user's location:
public class LocationService extends Service implements
…
I need accurate location updates. When using FusedLocationServices from GooglePlayServices, even if I set HighAccuracy, it will get locations from Wi-Fi and cellular when GPS is not available. How do I request locations ONLY from GPS, and with no…
ACCESS_COARSE_LOCATION and ACCESS_FINE_LOCATON have both been included in the manifest. Also included in the Activity are:
import android.location.Location;
import android.location.LocationManager;
I have a listener for the nav drawer with the…
My requirement is very simple.
I want to get the user's location and display the same on screen.
The emulator shows Currently reported location correctly. But I am unable to extract the same to my TextView. Not quite sure what is wrong here.
Please…
I'm developing an android app and I want to retrieve user's current location as soon as the app is launched.
I'm using this code:
@Override
public void onConnected(@Nullable Bundle bundle) {
if (ActivityCompat.checkSelfPermission(this,…
I am developing an application in which the user's location is tracked using the GPS provider only (device only mode of Location) . Therefore if the user sets his location priority to Approximate Location using Wifi and Data, the application wont…
I am using Google's Place Api for getting a list of places from the string searched from a end user. But i want to remove the country name from the suggestion coming as well as from list of responses for a address.
how can i achieve this in android…
I am using GoogleApiClient to get user location. I created a singleton class to get user location. Here is that class:
public class LocationUtils {
private static LocationUtils locationUtils;
private GoogleApiClient googleApiClient;
…
return TODO;
I am trying to detect userlocation using fused location API,it asks me to check permission from user but it gives "Cannot resolve symbol TODO"
private Location getLocation() {
// If Google Play Services is available
if…
I want it to be more accurate in calculations.
Now is like a 24.0, but I want it to be 24.1234512563.
I don't know what I need to change. I was trying to change from int to double but it is not working.
import android.app.Activity;
import…
I want to show dialog box for turn on GPS when GPS is disable .
See the image. When i click on YES then should be automatically turn on my GPS without going into setting.
So , how can i enable GPS by select YES option ?
I want to fetch the current location (latitude,longitude pair) of user and send it to server only when user has traveled 100 Kilo meters away from previous fetched location. What is the best way to do this if there is any?
My purpose is to use…
In my application it is require the status of Bluetooth and location,
so that the functionality always depends on those status . is there any way to get the enable or disable status of both Bluetooth and location at same time?.
any way i got the…
I've been working on this for quite some time. I've tried everything I can think of.
I'm trying to get a rough location (Coarse location). First try was the following:
googleApiClient = new GoogleApiClient.Builder(this)
…
The code that i wrote is supposed to show the location of the device on a map when the user opens the app.So i tried it on my phone and when i opened it i could see my location, however i walked about 2 km from that location and then opened the app…