How to Use Core Location/Gps Without Any Internet Connection/Disabled Cellular Network

Is it possible to use Core Location / GPS without any internet connection / disabled cellular network?

Some iOS devices have a real GPS chip allowing you to get location data even with no Internet connection. I believe the last few iPhones all have GPS. Some of the iPad models have GPS. I don't believe any of the iPod touch models have GPS.

Obviously without Internet you can't show any map data unless it is part of the app, but the app will be able to record real location data.

Also, without Internet, the GPS may take longer to get an initial position. The devices with GPS have what is called "assisted GPS". This means Cellular and/or WiFi triangulation is used to help get an initial position fix quicker that without.

Devices without GPS use cellular and/or WiFi triangulation to get estimated location data which is far less accurate than devices with GPS.

How to get address from location without Internet connection

For your information, by using GPS, we can get current location without active internet connection, but it

(1) takes a long time to get position and (2) doesn't work properly inside buildings or streets

--- UPDATE (as question updated) ---

By using apple's native iOS API, you can do reverse geocoding by using MKReverseGeocoder (available in MapKit framework) or CLGeocoder (available in CoreLocation framework).

But, this require working internet connection for getting data from server.

So, you can't do reverse geocoding without internet connection using native iOS APIs.

However, by using following third party libraries, you can get limited available address information (Country Name and ISO Code):

IOS-Offline-GeoCoder

ios-offline-reverse-geocode-country,

iOS: Is it possible to ask core location framework to fetch location using only cell tower or only WiFi or using GPS antennas?

As rmaddy mentioned, you do not have control over how the location is determined. In other words, you cannot ask the app/device to use one of GPS/CellTower/Wifi.

However you can, through the type of location update, tell the App whether to "favor" GPS or Cell Tower.

If you do:

[locationManager startUpdatingLocation];

Then the app will definitely use GPS + maybe wifi and/or cell tower.

if you do:

[locationManager startMonitoringSignificantLocationChanges];

Then the app will definitely use cell tower and provide a location update when you move from one cell tower to the next. This should reduce your GPS usage and battery usage. Having said that, I am not sure if in this case, GPS usage is completely eliminated.

Hope this sheds some light.

Update

See Apple's link:
CLLocationManager Class Reference

But in general you can always get one update (will arrive through the delegate method) and then use:

[locationManager stopMonitoringSignificantLocationChanges];

You will have to do a bit more work and check the timestamp of the location to make sure the update is not one of the old cached one.

iOS devices without Internet to capture current location

Sure it does automatically, if no WiFi is enabled it should automatically trigger the GPS, it takes a long time because if no location data is cached it starts to search for satellites.

If you want to display and error message, you can use a timer, if after X seconds no location is obtained just stop updates and show an alert to the user.

A great difference in time is made by the desiredAccuracy, if you set a lower accuracy even if when the GPS is on it will require less to get your position.



Related Topics



Leave a reply



Submit