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
82
votes
13 answers

FusedLocationApi.getLastLocation always null

I'd like to simply retrieve device location in my Android project and in order to do so I use the play-services approach: protected synchronized void buildGoogleApiClient() { mGoogleApiClient = new GoogleApiClient.Builder(…
Marco Zanetti
  • 4,051
  • 6
  • 32
  • 48
80
votes
15 answers

PHP header(Location: ...): Force URL change in address bar

I'm currently working on a mobile site with authentication using PHP sessions with a database. I have a login page with a form that goes to server_login.php on submit. The php file then creates some session data (store in $_SESSION), and redirects…
vemoxy
  • 1,015
  • 1
  • 8
  • 9
79
votes
10 answers

Android Google Maps API V2 Zoom to Current Location

I'm trying to mess around with the Maps API V2 to get more familiar with it, and I'm trying to start the map centered at the user's current location. Using the map.setMyLocationEnabled(true); statement, I am able to show my current location on the…
user139260
  • 987
  • 1
  • 6
  • 10
76
votes
5 answers

Indoor Positioning System based on Gyroscope and Accelerometer

I am developing an Android App to track indoor position. My phone is an Google Nexus S using two sensors, the first being an Accelerometer and the second being a Gyroscope. My idea is that from a starting reference point (a known GPS position),…
Alexis
  • 1,825
  • 4
  • 23
  • 28
76
votes
17 answers

Test if links are external with jQuery / javascript?

How do I test to see if links are external or internal? Please note: I cannot hard code the local domain. I cannot test for "http". I could just as easily be linking to my own site with an http absolute link. I want to use jQuery / javascript, not…
Matrym
  • 16,643
  • 33
  • 95
  • 140
75
votes
7 answers

Get GPS location via a service in Android

I need to monitor user's locations using a background service, and then load them and show the path to the user. Using an activity, it was quite easy to get GPS locations, but when I got to do it via a service, I came into a problem as it seems to…
android developer
  • 114,585
  • 152
  • 739
  • 1,270
73
votes
11 answers

Calculate compass bearing / heading to location in Android

I want to display an arrow at my location on a google map view that displays my direction relative to a destination location (instead of north). a) I have calculated north using the sensor values from the magnetometer and accelerometer. I know this…
Damian
  • 8,062
  • 4
  • 42
  • 43
71
votes
11 answers

How can I change a project's location pointer in Eclipse?

A project has moved to a different location, so Eclipse won't open the project. You'll immediately think about simply changing the pointer to the location, but in Eclipse they try to make this impossible for some reason. You cannot change the…
Redsandro
  • 11,060
  • 13
  • 76
  • 106
68
votes
7 answers

iPhone - Backgrounding to poll for events

For quite a while I'd been looking into a way in my iPhone app to poll every X minutes to check the data counters. After much reading of the Background Execution documentation and a few trial apps I'd dismissed this as impossible without abusing the…
NeilInglis
  • 3,431
  • 4
  • 30
  • 31
66
votes
13 answers

LocationClient getLastLocation() return null

Like the questions someone encountered before I tested one the nexus s(4.0.4 with google play service available) and avd (4.2.2 with google api), in both case locationclient's getLastLocation() always return null. public class MainActivity extends…
oscarthecat
  • 1,811
  • 1
  • 18
  • 28
63
votes
8 answers

Android: How to get accurate altitude?

I need to get an accurate measurement of altitude using GPS only. I tried Location.getAltitude(), but that is terribly inaccurate. Any advice?
ask
  • 2,160
  • 7
  • 31
  • 42
62
votes
3 answers

Difference between document.URL and location.href

I know that document.URL can not be set, while location.href can. But the Document indicates: URL is a replacement for the DOM Level 0 location.href property. So when would we use document.URL?
eddie yang
  • 1,241
  • 2
  • 13
  • 15
62
votes
10 answers

Where are C/C++ main function's parameters?

In C/C++, the main function receives parameters which are of type char*. int main(int argc, char* argv[]){ return 0; } argv is an array of char*, and points to strings. Where are these string located? Are they on the heap, stack, or somewhere…
remainn
  • 1,125
  • 3
  • 9
  • 14
61
votes
7 answers

How to set the location of WPF window to the bottom right corner of desktop?

I want to show my window on top of the TaskBar's clock when the windows starts. How can I find the bottom right corner location of my desktop? I use this code that works well in windows forms app but does not work correctly in WPF: var…
Mahdi7s
  • 813
  • 1
  • 9
  • 14
60
votes
8 answers

get the current location fast and once in android

I have an android application that need device current location (latitude and longitude). I've tried some tutorial on the net and specially some solutions from stack overflow, but they doesn't work well for me. My requirement is so simple: First I…
Mohamad MohamadPoor
  • 1,350
  • 2
  • 14
  • 35