geolocation

If I have ACCESS_FINE_LOCATION already, can I omit ACCESS_COARSE_LOCATION?

只谈情不闲聊 提交于 2019-11-28 18:30:46
I have a GPS app that already requests ACCESS_FINE_LOCATION permission in the manifest, now I want to add a library (MoPub) that requires ACCESS_COARSE_LOCATION . Am I correct in assuming that ACCESS_FINE_LOCATION is enough, and I can leave out ACCESS_COARSE_LOCATION from my manifest? https://developer.android.com/guide/topics/location/strategies.html#Permission Note: If you are using both NETWORK_PROVIDER and GPS_PROVIDER, then you need to request only the ACCESS_FINE_LOCATION permission, because it includes permission for both providers. (Permission for ACCESS_COARSE_LOCATION includes

watchPosition() vs getCurrentPosition() with setTimeout

半城伤御伤魂 提交于 2019-11-28 17:33:22
I need to determine a person's location within 50m. I'm wondering if I should use navigator.location.watchPostion() or call getCurrentPostion() over and over again. watchPostion() is the proper W3C API for doing what I want, but practically, it seems to be overkill. Here's my code: var map = null; var marker = null; var layer = null; function locFn(pos) { var lat = pos.coords.latitude; var lon = pos.coords.longitude; $("#hlat").val(lat); $("#hlong").val(lon); document.getElementById("lnkMap").href = "http://maps.google.com/maps?q=My+Loc@" + lat + "," + lon + "&z=18&t=h"; var point = new

How to check if a certain coordinates fall to another coordinates radius using PHP only

拥有回忆 提交于 2019-11-28 17:05:33
I have seen so many functions but it happens to work only for MySQL or Postgresql. I want the equivalent logic for PHP. I'm doing some comparisons, like I have this data that were being produced when created. Lat: 56.130366 Long: -106.34677099999 Later on, I want to check if this coordinates will fall within a radius of another coordinates. Lat: 57.223366 Long: -106.34675644699 radius: 100000 ( meters ) Thanks in advance! Kenneth Palaganas Thanks for the help. Below is an example function that takes two sets of longitude and latitude co-ordinates and returns the distance between the two.

How to track the device location (iOS and Android) device using Phonegap

╄→尐↘猪︶ㄣ 提交于 2019-11-28 16:54:36
I would like to know when a user arrives or leaves certain location. I was trying to do this using the wireless network (check for mobile devices), but I couldn't for several reasons. 1) I needed real time updates or every 1 - 5 min of the information about which devices are connected and which devices have just disconnected. 2) I had very high ping from my PC to my iPhone on the same network (still don't know why). Now I want to do it using geolocation from a Phonegap application (running in the background) suspended on iOS or running in the background in Android. Any help would be

Converting latitude/longitude into city name? (reverse geolocating)

孤街醉人 提交于 2019-11-28 16:52:57
问题 I'm working on a job board in Codeigniter PHP + jQuery where employers enter their location and we use Google Maps API to plot it. While this has had awesome usability results, the problem is when we try to display these locations to job seekers they are muddled and hard to visually discern (they read like this: "02905, 2 miles away","171 John St., 4 miles away", "Providence, RI, 10 miles away". I want to be able to reverse geolocate from a longitude/latitude to a set level (ideally, city

Get country location of an IP with native PHP

萝らか妹 提交于 2019-11-28 16:50:52
问题 Read on before you say this is a duplicate, it's not. (as far as I could see) I want to get the county code in php from the client. Yes I know you can do this using external sites or with the likes of "geoip_record_by_name" but I don't want to be dependent on an external site, and I can't install "pear" for php as im using shard Dreamhost hosting. I thought I could just do something like this: $output = shell_exec('whois '.$ip.' -H | grep country | awk \'{print $2}\''); echo "<pre>$output<

Phonegap geolocation sometimes not working on android

微笑、不失礼 提交于 2019-11-28 16:45:20
I have using cordova v3.4.1 to build android and ios app, on ios geolocation function is returning very quickly and works fine always,but on android, sometimes it not working. The strange thing is after I reboot my android phone,it works fine. In more than a few hours geolocation gets the postion very quickly both in wifi and 3G. But after serval hours, I open the app again, the geolocation can not work.Sometimes when I outside, it can get postion with gps satellite,but very slow,often occur timeout error. I try to remove the app and reinstall it again,but the problem still exist,unless reboot

How to track user location in background?

那年仲夏 提交于 2019-11-28 16:44:22
I'm looking for an open source app or library to track user location in the background. Now I'm trying to do it with CLLocation and background tasks, but accuracy is not enough for my case. Could you explain, how apps, like "moves", "runkeeper", "endmondo", creates my route? Should I use Accelerometer or/and compass to create a route between CLLocation background points? Some code: //location manager init self.locationManager = [[CLLocationManager alloc] init]; self.locationManager.distanceFilter = kCLDistanceFilterNone; self.locationManager.desiredAccuracy = kCLLocationAccuracyBest; self

In Oreo (8.0.0+) (API 26+), How to get a location services update when the app is in the background or kill

南楼画角 提交于 2019-11-28 16:35:10
In Android O (8.0.0+) (API 26+), How to get a location services update when the app is in the background or kill. In "Strava" Android App (Available on Play Store ), location services run properly when the app is in the background or kill. I need to build same functionality in my app. Whenever I start service using startService(new Intent(this, GpsServices.class)); Then the onDestroy method is called after 10 sec when an app is an idle mode (the app is in the background or kill). Below is my code. public class GpsServices extends Service implements LocationListener, Listener { @Override public

Android Google Map how to check if the gps location is inside the circle

六月ゝ 毕业季﹏ 提交于 2019-11-28 16:15:38
I'm trying to detect if a user is in the radius of a Marker , using the users gps location. I have the marker's coordinates, but I don't know how to calculate whether the user is in the area. I've tried to use the following, but even when the current location is inside the circle I keep getting the "outside" message. public class MapaEscola extends FragmentActivity { private GoogleMap googleMap; private Serializable escolas; private ProgressDialog dialog; private Circle mCircle; private Marker mMarker; @TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH) @Override protected void onCreate(Bundle