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
57
votes
8 answers

How can I get the country (or its ISO code)?

What is the best way to get the country code? As of now, I know two ways. One is to get by TelephonyManager and another by Locale. Which is another best and unique way to find the country code on Android? To be more specific if TelephonyManager is…
Vishal Pawar
  • 4,324
  • 4
  • 28
  • 54
56
votes
1 answer

Getting The Location Of A Control Relative To The Entire Screen?

Let's say I have a Control and its location is relative to its parent. If its embedded many times and is the great great great grandchild of the main form, how can I determine what its location is on my entire screen, not just its location in the…
sooprise
  • 22,657
  • 67
  • 188
  • 276
56
votes
6 answers

Why I have to call 'exit' after redirection through header('Location..') in PHP?

You know that if you want to redirect a user in PHP you can use the header function: header('Location: http://smowhere.com'); It is also well known that it is a good practice to put also an exit; after the header call, to prevent execution of other…
Nicolò Martini
  • 5,182
  • 4
  • 32
  • 38
55
votes
5 answers

NSLocationWhenInUseUsageDescription warning, but I have already added it

While I have already added: NSLocationWhenInUseUsageDescription I keep receiving this warning: This app has attempted to access privacy-sensitive data without a usage description. The app's Info.plist must contain an…
Mohamed
  • 647
  • 1
  • 5
  • 9
52
votes
3 answers

jQuery x y document coordinates of DOM object

I need to get the X,Y coordinates (relative to the document's top/left) for a DOM element. I can't locate any plugins or jQuery property or method that can give these to me. I can get the top and left of the DOM element, but that can be either…
DMCS
  • 31,720
  • 14
  • 71
  • 104
48
votes
3 answers

What is meaning of negative dbm in signal strength?

When we try to get nearby cells and their LAC, MNC, signal (and while using other android apps) we are getting signal as negative value (like -85dbm). How should I take this? Should I ignore -ve sign and take absolute value or -85 is smaller…
Pranit Kothari
  • 9,721
  • 10
  • 61
  • 137
46
votes
6 answers

Create new C++ object at specific memory address?

Is it possible in C++ to create a new object at a specific memory location? I have a block of shared memory in which I would like to create an object. Is this possible?
Chris
  • 600
  • 1
  • 5
  • 11
45
votes
8 answers

Android O - Old start foreground service still working?

So, with Android O, you need to have your service running as a foreground service if you want to receive more than just a few location updates per hour. I noticed that the old method for starting a foreground service does seem to work on O. i.e.…
the_new_mr
  • 3,476
  • 5
  • 42
  • 57
45
votes
1 answer

Android play services 6.5: LocationClient is missing

After updating to Google Play Services 6.5.87 my app was failed to compile because of missing LocationCLient class. The documentation link is corrupted at the moment (404 Not Found) How can I fix it? I want to receive location updates, work with…
45
votes
9 answers

How to get current longitude and latitude using CLLocationManager-Swift

I want to get the current longitude and latitude of a location using Swift and display them via labels. I tried to do this but nothing displays on the labels. import UIKit import CoreLocation class ViewController: UIViewController,…
Beginner
  • 465
  • 1
  • 4
  • 5
44
votes
9 answers

How to Get City Name by Latitude &Longitude in android?

I want to city name by current location but i have latitude and longitude.how to get it? i used button click then i get double value latitude and longitude. my code in below.please help me. Thanks!! Button btnShowLocation; GPSTracker gps; …
crickpatel0024
  • 1,999
  • 6
  • 30
  • 47
44
votes
9 answers

How to set fake GPS location on IOS real device

Currently I have to test app and set the different fake GPS locations on real IOS 7 devices. On Android I use 'My Fake Location'. Unfortunately, I didn't find the same app for IOS 7. Any ideas to solve my problem?
Maksim Alekseychik
  • 3,578
  • 5
  • 17
  • 15
43
votes
2 answers

Time zone issue involving date fns format()

const dt = new Date('2017-12-12'); console.log(format(dt, 'YYYY-MM-DD')); The above code logs 2017-12-11 in the US, but 2017-12-12 in India. I followed this github thread here and tried out things but am not getting the desired results. My…
codeX
  • 4,842
  • 2
  • 31
  • 36
42
votes
4 answers

How to force a page to reload if all what was changed in url is hash?

I am trying to reload current page with different url hash, but it doesn't work as expected. (Clarification how I want it to work: Reload the page and then scroll to the new hash.) Approach #1: window.location.hash = "#" + newhash; Only scrolls to…
serg
  • 109,619
  • 77
  • 317
  • 330
41
votes
2 answers

How does it work - requestLocationUpdates() + LocationRequest/Listener

I am new Android coder and I have problem with requesting updates for my localization. I working with tutorials from http://developer.android.com/training/location/receive-location-updates.html . My application can handle exceptions, getting…
F1sher
  • 7,140
  • 11
  • 48
  • 85