location

iOS Waiting for Location Manager to Init

感情迁移 提交于 2019-12-21 12:17:40
问题 I'm developing an iOS app based on the map and location tracking. When the user first boots the app it asks for permission to track location etc. just fine. The only problem is while it's doing that, I have code setting up the initial map view and other location-based variables before the user has clicked OK. I've found I can put these initiation steps after a while loop that waits for the user to change the location manager's permissions as below but this can't possibly be best practice, not

LocationRequest smallest displacement and accuracy

戏子无情 提交于 2019-12-21 09:00:28
问题 I'm building an Android app in which I need to have a very accurate location at a very high frequency. I dove into google play services api for location, and found the LocationRequest.setSmallestDisplacement very useful to limit battery consumption. However, as I am testing it indoor, the locations I get have an accuracy that varies a lot (sometimes 10m, sometimes 96m...), even when I set the Priority of my request as high accuracy. My prob1em is that setSmallestDisplacement doesn't give a sh

How to change the location of `web root` folder of EasyPHP?

眉间皱痕 提交于 2019-12-21 07:37:41
问题 Currently on my Windows 7 machine, it is C:\Program Files (x86)\EasyPHP-5.3.8.1\www I want to point it into another location on drive D, says D:\code How would I do that? 回答1: You need to right click on the icon on the Easyphp icon on the taskbar and select configuration->Apache. This will open httpd.conf in a notepad window. You need to modify it as follows: DocumentRoot "D:/code" (...) # DocumentRootDirectory <Directory "D:\code"> Options Indexes FollowSymLinks AllowOverride All Order allow

Get current latitude and longitude android

蓝咒 提交于 2019-12-21 06:28:32
问题 Requirement : 1.Sometimes(not everytime) I am getting latitude and longitude 0.0. 2.I want to know how to get the location update after user has enabled the gps from the settings. Here is my code public class GPSTracker extends Service implements LocationListener { private final Context mContext; // flag for GPS status boolean isGPSEnabled = false; // flag for network status boolean isNetworkEnabled = false; // flag for GPS status boolean canGetLocation = false; Location location; // location

How to keep GPS turned on when switching between activities but off when when “home” is pressed

你。 提交于 2019-12-21 06:18:16
问题 I am trying to figure out the best way to implement Listener to location with the onResume and onPause. Best I can do not it to turn it off on onPause and reconnect on onResume. But then I keep having disconnect-reconnect when all I want is for the GPS to stay on for the duration of the application. When Home is pressed (or another application is interrupting) then GPS can be downed off for battery saving. Any ideas? Thanks. 回答1: Your question can be generalized to "How do I tell when my app

How to keep GPS turned on when switching between activities but off when when “home” is pressed

无人久伴 提交于 2019-12-21 06:18:11
问题 I am trying to figure out the best way to implement Listener to location with the onResume and onPause. Best I can do not it to turn it off on onPause and reconnect on onResume. But then I keep having disconnect-reconnect when all I want is for the GPS to stay on for the duration of the application. When Home is pressed (or another application is interrupting) then GPS can be downed off for battery saving. Any ideas? Thanks. 回答1: Your question can be generalized to "How do I tell when my app

How can I detect if user disable GPS (Android - Play Services)

混江龙づ霸主 提交于 2019-12-21 06:15:07
问题 I use gms.location.LocationListener (Google Play Services) to get the user's location. It works fine but I want to detect whenever the user disables or enables his/her GPS. As in this picture. When I turn ON/OFF location no methods are called. When I switch apps and return to my app this methods are called: onStart onResume onConnected But I need the event to be called whenever the user turns ON/OFF location those events I listed don't get called. Note: With Android API I am able to get those

Appstate keep on getting change in React native in Android

南笙酒味 提交于 2019-12-21 06:00:52
问题 I am working on React native project and there I am taking location permissions. Also I have to track location permissions always like if user has given permission access after install the application and then after sometime user goes to the app settings in device settings and disable/revoked the permissions. Again once app comes from background to foreground, I have to check permission based on that, Needs to show the messages. So that, I am using Appstate. But, In Android strangely, After

StartUpdatingLocation Vs significant-change location service

自闭症网瘾萝莉.ら 提交于 2019-12-21 05:37:06
问题 I am having issue regarding significant-change location service. Apple documentation says "Whether you use the standard location service or the significant-change location service to get location events, the way you receive those events is the same." but in case of "significant-change location service" I am not able to get any callbacks which I get in case of "standard location service" Please let me know if anybody has any inputs? 回答1: startUpdatingLocation updates the location when it is

Get locations within radius

点点圈 提交于 2019-12-21 05:33:07
问题 In a database I have stored around 500 records, each with a latitude and a longitude. In an Activity I implement a LocationListener and in the onLocationChanged -method I need to show the records that is within a radius of XX metres from the location received from this listener. Is there an (easy) way to do this, either in SQL or Java? 回答1: Try this sample code, rs = st.executeQuery("SELECT longititude,latitude FROM location"); while (rs.next()) { double venueLat =rs.getDouble("latitude");