Questions tagged location

Explore the latest questions and answers asked by our top developers.

Android kotlin continue check after some times if the location service is enabled or not

I’m making a weather application. As a weather application, I have to track the current location. But I want to keep tracking the Location service is enabled or not every 10 seconds. Is there any way to loop the if statement after 10 seconds to check the Location service enabled or not? Here is the […]

By A I Shakil
Published
Categorized as android, kotlin, location

Asking for location permission only appears when app is interrupted

I am developing an android application that uses Google Maps. The expected behavior is: Enter the map activity Ask user to use his location Show nearby places When I run the application using an emulator in Android Studio , the flow is the expected one (Pixel 2 Api 30), but when I run it on […]

By F bio Pires
Published
Categorized as android, google-maps, location, permissions

How can I ask for location permission and turn on GPS settings programmatically on android device?

I want to get user current location only once. And turn on GPS settings programmatically. How can I do those task with new activityresultLauncher API? (ask location permission, turn on GPS, get current location). In Java language. Source: Android Questions

By MK Roy
Published
Categorized as android, gps, java, location

Android: Why does the gps stop 60 seconds after turning off the screen?

I created an application that retrieves the location every second with LocationManager requestUpdateLocations. At first, without using a foreground service, the location updates stopped immediately when I turned off the screen. Then I set up a foreground service that implements LocationListener and GpsStatus.Listener. I start this service with startForegroundService in my MainActivity and a notification […]

By user3603586
Published
Categorized as android, background, gps, location

isFromMockProvider() is returning true even if I am turning off fake/mock location

I am getting location, to check that is it Mock or not I am doing it as: if(location.isFromMockProvider()){ return true; } If there is no fake gps app, it will return false. I am testing it by downloading fake gps apps and adding them to developer options as Mock Location App and turning on that […]

How to get name of MockLocationApps on android 11?

In my app, I have to get names of the apps that are used for Fake/Mock locations. I am using this code for this purpose: public static List<String> getListOfFakeLocationAppsFromAll(Context context) { List<String> fakeApps = new ArrayList<>(); try { List<ApplicationInfo> packages = context.getPackageManager().getInstalledApplications(PackageManager.GET_META_DATA); for (ApplicationInfo aPackage : packages) { boolean isSystemPackage = ((aPackage.flags & ApplicationInfo.FLAG_SYSTEM) != […]

By Faizan Ahmad
Published
Categorized as android, android-11, android-gps, location, mock-location

Running a Android/iOS App in the background every 5 min without foreground service

I am struggling to find a suitable solution to send location data from a Android and/or iOS App to a server with a periodically interval of about 5 min. When I inform about Background services on Android, it is hard to find out the right approach to get location data in combination with sending it […]

Fatal exception for location live data, most probably looper value

I am trying to get location updates through live data in Kotlin. The class and its methods are class LocationLiveData(context: Context): LiveData<LocationDetails>() { private var fusedLocationClient = LocationServices.getFusedLocationProviderClient(context) //fusedLocationClient combines locationRequest and locationCallback private val locationCallback = object: LocationCallback() { override fun onLocationResult(locationResult: LocationResult) { super.onLocationResult(locationResult) locationResult ?: return for (location in locationResult.locations) { setLocationData(location) […]

By Anthon Santhez
Published
Categorized as android, gps, kotlin, location

flutter location , Unhandled Exception: PlatformException(PERMISSION_DENIED_NEVER_ASK, Background location permission denied forever

I’m using Location flutter package to access the user’s background location, first time any user opens the app it asks for permission, and when the user accepts it brings back this error in the console Unhandled Exception: PlatformException(PERMISSION_DENIED_NEVER_ASK, Background location permission denied forever – please open app settings, null, null) if the user closed the […]

By Ahmed Wagdi
Published
Categorized as android, flutter, location

How to get exact live location of website user?

Is there any method through which I can get live exact location of website user such that I should able to see is the user is available in 50 – 100 m² area ? Is it possible through nodeJs and if not then any other way. Is it possible through Android development ? Suppose i […]

By Yash
Published
Categorized as android, location, node.js, web, web-development-server
1 2 3 42

Still Have Questions?


Our dedicated development team is here for you!

We can help you find answers to your question for as low as 5$.

Contact Us
faq