List of utility methods to do Address Get
boolean | isVictoriaAddress(Address address) is Victoria Address boolean ret = false; if (address != null) { String countryCode = address.getCountryCode(); String adminArea = address.getAdminArea(); String postalCode = address.getPostalCode(); if (countryCode != null && adminArea != null && postalCode != null && postalCode.length() != 0) { if (countryCode.equals("AU") ... |
String | getAddress(int contactId) This method used to get address from contact id. String postalData = ""; String addrWhere = ContactsContract.Data.CONTACT_ID + " = ? AND " + ContactsContract.Data.MIMETYPE + " = ?"; String[] addrWhereParams = new String[] { String.valueOf(contactId), ContactsContract.CommonDataKinds.StructuredPostal.CONTENT_ITEM_TYPE }; Cursor addrCur = mSmartAndroidActivity.managedQuery( ContactsContract.Data.CONTENT_URI, null, addrWhere, ... |
Address | getLatLongFromAddress(String address) This method used to get latitude-longitude from address. if (address != null && address.length() > 0) { geocoder = new Geocoder(mSmartAndroidActivity); List<Address> list = null; try { list = geocoder.getFromLocationName(address, 1); return list.get(0); } catch (Throwable e) { e.printStackTrace(); ... |