Priya
Priya

Reputation: 157

current location without using gps

hai Can we know current location without using gps? Is it possible?

Upvotes: 5

Views: 7415

Answers (8)

Chetan Bhalara
Chetan Bhalara

Reputation: 10344

Core Location does what you want (by using Wi-Fi triangulation). Check out the documentation of CLLocationManager

Upvotes: 3

visakh7
visakh7

Reputation: 26400

To add to @Jenifer's answer

showsUserLocation

Discussion

This property does not indicate whether the user’s position is actually visible on the map, only whether the map view is allowed to display it. To determine whether the user’s position is visible, use the userLocationVisible property. The default value of this property is NO.

Setting this property to YES causes the map view to use the Core Location framework to find the current location. As long as this property is YES, the map view continues to track the user’s location and update it periodically.

Core Location Framework

The Core Location framework lets you determine the current location or heading associated with a device. The framework uses the available hardware to determine the user’s position and heading. You use the classes and protocols in this framework to configure and schedule the delivery of location and heading events. You can also use it to define geographic regions and monitor when the user crosses the boundaries of those regions.

If you want to know How does the Core Location do this

It actually uses several mechanisms.

  1. GPS
  2. Cell Tower Triangulation
  3. Wifi Hotspot cataloging
  4. Randomly assuming you are in Cupertino

There are tradeoffs based on speed, precision, and available hardware. A first Gen iPad will only have the 3 option available while the iPhone simulator makes use of the last mechanism.

You can observe the difference in these systems in the map application where it initially guesses based on the cell tower, then refines the guess via GPS.

Only options #3 requires a data connection.

And for the humor impaired including #4 was not totally serious although it is functionally correct. (I think they simulate the GPS reporting that location rather than just hard coding it, but I haven't checked.)

From How does CoreLocation locate the device?

Upvotes: 1

Scorpion1031
Scorpion1031

Reputation: 21

Well thats kind of a very broad and very general question. If you are talking cell phones you can use three tower triangulation which is good when you are hitting three towers all at once, but if you are only hitting one the error can be up to a few kilometers.

Now if you are talking internet accessing devices (ie something with an IP address) again things get dicey. If you are using a stationary access point you will get a close approximation using nearest known Hubs with the IP range the device is in. Mobile devices with IPs are really hard to pinpoint.

Upvotes: 2

Ryan Wersal
Ryan Wersal

Reputation: 3228

The iPhone SDK has a framework that automatically utilizes the proper mechanism for determining location based on how accurate the result needs to be. Apple has a good article discussing these different methods of locating a device.

Also, here is a good starting point for learning about programming with Location Services.

Furthermore, you can dive right into the CoreLocation framework documentation and learn about everything you can do using Location Services on iOS.

Upvotes: 7

DarkDust
DarkDust

Reputation: 92424

Yes, CoreLocation can triangulate your position via nearby cell phone towers, but the position won't be as accurate as with GPS. Also, it can get your location via nearby WLANs, but this is even less reliable.

Upvotes: 4

Gypsa
Gypsa

Reputation: 11314

Try this

map.showsUserLocation = YES;

map is my MKMapView Object.

Upvotes: 2

Brian Willis
Brian Willis

Reputation: 23924

The iPod Touch does something like this. It doesn't have a GPS chip, but instead uses the available WiFi networks in the area to get a rough idea of where you're located.

Upvotes: 0

Related Questions