i am trying to get the user current city (not the exact address, only the city)
for getting the country , i am using this code:
String locale = context.getResources().getConfiguration().locale.getCountry();
i tried this code for getting the city:
Geocoder gcd = new Geocoder(context, Locale.getDefault());
List<Address> addresses = gcd.getFromLocation(lat, lng, 1);
if (addresses.size() > 0)
System.out.println(addresses.get(0).getLocality());
however it return for me an empty string: ""
p.s: i already have a ACCESS_FINE_LOCATION and internet permission in the manifest file
thanks alot