Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does location service require Internet to get location?

I am little confused with the answers. can anybody give me a right answer to solve this question. I have developed an emergency alert app. I am getting location from GPS and Network service. In some situation there is no mobile data or WiFi connected so no internet.

I would like to know will my app still get LAT/LONG or is internet required to get LAT/LONG?

I am trying this on Galaxy Nexus which runs version 4.3...

I am using Google play service option:

@Override
public void onConnected(Bundle bundle) 
{
    locationRequest = LocationRequest.create();
    locationRequest.setInterval(1000);
    locationRequest.setFastestInterval(1000); 
    locationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);

    LocationServices.FusedLocationApi.requestLocationUpdates(mGoogleApiClient, locationRequest, this);
}

@Override
public void onLocationChanged(Location location) 
{
    Log.e("location","onLocationChanged");

    if (location != null) 
    {
      Log.e("SaveCurrent","Location"+String.valueOf(location.getLatitude()));
      Log.e("SaveCurrent","Location"+String.valueOf(location.getLongitude()));
    }
 }

Thanks!

like image 559
TheDevMan Avatar asked Sep 30 '22 03:09

TheDevMan


1 Answers

GPS - Geolocation Positioning Services works using satellite, so no internet is required if your cellphone have GPS. So coordinates can be acquired using this alone which would be very accurate.

According to wikipedia also :- "The Global Positioning System (GPS) is a space-based satellite navigation system that provides location and time information in all weather conditions, anywhere on or near the Earth where there is an unobstructed line of sight to four or more GPS satellites."

Internet Location - Other than GPS you can also get your current position using internet, which uses your mobile network or wifi network location to triangulate your current location. This is not as highly accurate as GPS.

So for your emergency application you can get the current location if GPS satellite services is available without having any internet connection.

like image 78
Aks Avatar answered Oct 03 '22 03:10

Aks