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!