Android examples for android.location:Address
get Address String
import android.location.Address; public class Main{ public static String getAddressString(Address address) { if (address.getMaxAddressLineIndex() == -1) { return null; }//w w w . jav a 2 s . c o m StringBuilder addressStringBuilder = new StringBuilder(); for (int i = 0; i <= address.getMaxAddressLineIndex(); i++) { addressStringBuilder.append(address.getAddressLine(i)); if (i != address.getMaxAddressLineIndex()) { addressStringBuilder.append(", "); } } return addressStringBuilder.toString(); } }