Questions tagged [location]

Location is a specific position in physical space, e.g. a point on the surface of the Earth described using latitude and longitude coordinates. This tag should NOT be used for questions related to the position of a virtual element e.g. position of a pixel on a bitmap or position of a layout element on UI (use [position] tag in that cases).

The term location is used to identify a point or an area in physical space, such as on the Earths surface or within a room.

A relative location is a description of position relative to another known site — for example, "2 miles north of London".

An absolute location is designated using a specific pairing of latitude and longitude in a Cartesian coordinate grid — for example, a Spherical coordinate system or an ellipsoid-based system such as the World Geodetic System—or similar methods.

The term location generally implies a relatively high degree of certainty of position.

9647 questions
24
votes
8 answers

My current location always returns null. How can I fix this?

I am trying to find my current location for an android project. When the application is loaded my current location is always null. I have set up the permissions in the manifest etc. When I find the current location I intend to use the coordinates to…
devinefergal
  • 287
  • 1
  • 4
  • 10
24
votes
5 answers

Foreground service not receiving location updates in Android 7.0+ when screen is off

I am trying to create an Android application that continuously logs device location data in realtime while the device screen is off. My code works correctly with Android 6.0 and earlier but it seems that Android 7.0+ breaks my app. I have…
Joshua W
  • 4,973
  • 5
  • 24
  • 30
24
votes
1 answer

Angular: Location back history

I have a form with a "back" button. When the user presses the back button, the script goes to the previous page: import { Location } from '@angular/common'; // In a place in La Mancha, whose name I do not want to…
Cequiel
  • 3,505
  • 6
  • 27
  • 44
24
votes
9 answers

Getting country name from country code

I have found the answer for this for objective-c but Im having a hard time doing this in swift. I have used this to get the country code for the current location: let countryCode = NSLocale.currentLocale().objectForKey(NSLocaleCountryCode) as!…
Tarjerw
  • 505
  • 1
  • 5
  • 12
24
votes
9 answers

javascript location.hash refreshing in IE

I need to modify the hash, remove it after certain processing takes place so that if the user refreshes they do not cause the process to run again. This works fine in FF, but it seems that IE is reloading every time I try to change the hash. I…
aepheus
  • 7,827
  • 7
  • 36
  • 51
24
votes
3 answers

AngularJS change url with $location

I'm trying to change the URL with AngularJS, but not with a redirect, just change the URL after an event. What I need is this: www.myurl.com/inbox/1 to this www.myurl.com/inbox/25 In other words, just change the last Id. I'm trying to do…
Matheus Lima
  • 2,103
  • 3
  • 31
  • 49
24
votes
3 answers

is there another site like freegeoip.net

is this site not working any more as i cant get it to work, it used to work. is there any RELIABLE service like it http://freegeoip.net/
user2899094
  • 491
  • 1
  • 4
  • 17
24
votes
3 answers

Will iOS wake up the terminated app if it's registered with location for UIBackgroundModes?

I know that if an app uses "The significant-change location service", iOS will wake it up if there's a location update to be delivered, even if the app is terminated. I couldn't find a clear answer about the case if the app is using standard…
aslı
  • 8,740
  • 10
  • 59
  • 80
23
votes
3 answers

Android: requestLocationUpdates updates location at most every 45 seconds

Background I am writing an Android app whose main function is tracking the user's location and making an alert when the user gets near some point. Therefore I need to update the user's location at regular intervals, and these intervals should get…
stemadsen
  • 1,841
  • 2
  • 16
  • 15
23
votes
4 answers

Location getAccuracy() what this function do?

I know that this function returns a float indicating the accuracy of a particular location. My question is: Is it right that greater the value returned by this function means more accurate the location is? Or it is the inverse what I am saying ?
Khawar Raza
  • 15,870
  • 24
  • 70
  • 127
23
votes
11 answers

why getSpeed() always return 0 on android

I need to get the speed and heading from the gps. However the only number i have from location.getSpeed() is 0 or sometimes not available. my code: String provider = initLocManager(); if (provider == null) return false; …
user591539
  • 233
  • 1
  • 2
  • 4
23
votes
7 answers

Error invoke virtual method 'double android.location.Location.getLatitude()' on a null object reference

All I am trying to do is let the user get a list of the places of types he likes. For example if the input was hospital my application would open google maps with the search string "Hospital". But as suggested in the documentation using the geocode…
KISHORE_ZE
  • 1,466
  • 3
  • 16
  • 26
22
votes
3 answers

Use GPS and Network Provider at the same time in Android

I have implemented a locationlistener in my app which uses the Network Provider. This all works fine because i want a location quickly and with GPS Provider it takes ages. But I've come to a point in my app where location has to be accurate (max…
Galip
  • 5,435
  • 10
  • 37
  • 47
22
votes
3 answers

How does Doze/Standby feature affect location updates?

Does anyone know if a whitelisted app that is holding a partial wake-lock can receive location updates while the device is in Doze or the app is in Standby? The Android docs…
user462297
22
votes
3 answers

When do you put Javascript in body, when in head and when use doc.load?

Possible Duplicate: Where to place Javascript in a HTML file? Should I write script in the body or the head of the html? I've always wondered, mainly because when creating pages I always run into trouble, based on the following thing: When do you…
Sander Schaeffer
  • 2,757
  • 7
  • 28
  • 58