Android GPS Lokasyon Bilgisi Alma

private LocationManager loc;
private String provider;
public Location location;
loc = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
provider = LocationManager.GPS_PROVIDER;
location = loc.getLastKnownLocation(provider);
if (location != null) {
int lati = (int) location.getLatitude();
int longi = (int) location.getLongitude();
}

« »