add = add + "\n" + obj.getSubAdminArea(); add = add + "\n" + obj.getLocality(); add = add + "\n" + obj.getSubThoroughfare();
add = add + "\n" + obj.getSubAdminArea(); add = add + "\n" + obj.getLocality(); add = add + "\n" + obj.getSubThoroughfare();
public void getAddressByPostalCode(String val_pcode) { Geocoder geocoder = new Geocoder(this.getApplicationContext(), Locale.getDefault()); try { List<Address> addresses1 = geocoder.getFromLocationName (val_pcode, 1); Address obj1 = addresses1.get(0); List<Address> addresses = geocoder.getFromLocation(obj1.getLatitude(), obj1.getLongitude(), 1); Address obj = addresses.get(0); EditText street = (EditText)findViewById(R.id.editText3); EditText pcode = (EditText)findViewById(R.id.editText4); EditText blk = (EditText)findViewById(R.id.editText13); EditText build = (EditText)findViewById(R.id.buildingtext); street.setText(obj.getThoroughfare()); pcode.setText(obj.getPostalCode()); blk.setText(obj.getSubThoroughfare()); build.setText(obj.getPremises()); } catch (IOException e) { Toast.makeText(this, e.getMessage(), Toast.LENGTH_LONG).show(); }
public String getAddress(Context context, double lat, double lng) { Geocoder geocoder = new Geocoder(context, Locale.getDefault()); try { List<Address> addresses = geocoder.getFromLocation(lat, lng, 1); Address obj = addresses.get(0); String add = obj.getAddressLine(0); add = add + "\n" + obj.getCountryName(); add = add + "\n" + obj.getCountryCode(); add = add + "\n" + obj.getAdminArea(); add = add + "\n" + obj.getPostalCode(); add = add + "\n" + obj.getSubAdminArea(); add = add + "\n" + obj.getLocality(); add = add + "\n" + obj.getSubThoroughfare(); return add; } catch (IOException e) { e.printStackTrace(); Toast.makeText(this, e.getMessage(), Toast.LENGTH_SHORT).show(); return null; } }
public String getAddress(double lat, double lng) { Geocoder geocoder = new Geocoder(MapsActivity.this, Locale.getDefault()); String Address=" "; Log.e("ADDRESS","ADDRESS"); try { List<Address> addresses = geocoder.getFromLocation(lat, lng, 1); Address obj = addresses.get(0); String add = obj.getAddressLine(0); Address= obj.getAddressLine(0); add = add + "\n" + obj.getCountryName(); add = add + "\n" + obj.getCountryCode(); add = add + "\n" + obj.getAdminArea(); add = add + "\n" + obj.getPostalCode(); add = add + "\n" + obj.getSubAdminArea(); add = add + "\n" + obj.getLocality(); add = add + "\n" + obj.getSubThoroughfare(); Log.e("IGA", "Address" + add); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); Toast.makeText(this, e.getMessage(), Toast.LENGTH_SHORT).show(); } return Address; }
add = add + "\n" + obj.getSubAdminArea(); add = add + "\n" + obj.getLocality(); add = add + "\n" + obj.getSubThoroughfare(); System.out.println("obj.getSubAdminArea()"+obj.getSubAdminArea()); System.out.println("obj.getLocality()"+obj.getLocality()); System.out.println("obj.getSubThoroughfare()"+obj.getSubThoroughfare());
add = add + "\n" + obj.getSubAdminArea(); add = add + "\n" + obj.getLocality(); add = add + "\n" + obj.getSubThoroughfare();
add = add + "\nFeatureName " + obj.getFeatureName(); add = add + "\nLocality " + obj.getLocality(); add = add + "\n" + obj.getSubThoroughfare(); add = add + "\nurl " + obj.getUrl(); add = add + "\nLatitude " + obj.getLatitude();
add = add + "\n" + obj.getSubAdminArea(); add = add + "\n" + obj.getLocality(); add = add + "\n" + obj.getSubThoroughfare();
List<Address> addresses; Geocoder geocoder = new Geocoder(getActivity()); addresses = geocoder.getFromLocation(latitude, longitude, 10); if (addresses == null || addresses.isEmpty()) addresses = MyGeocoder.getFromLocation(latitud, longitud, 10); //Mygeocoder is a class with a http request to google server, that replaces Geocoder, if not work HashMap itemAddress; ArrayList itemList = new ArrayList<HashMap<String, String>>(); Log.d("Addresses", "" + "Start to print the ArrayList"); for (int i = 0; i < addresses.size(); i++) { itemAddress = new HashMap<String, String>(); Address address = addresses.get(i); String addressline = "Addresses from getAddressLine(): "; for (int n = 0; n <= address.getMaxAddressLineIndex(); n++) { addressline += " index n: " + n + ": " + address.getAddressLine(n) + ", "; } Log.d ("Addresses: ", addressline); Log.d("Addresses getAdminArea()", "" + address.getAdminArea()); Log.d("Addresses getCountryCode()", "" + address.getCountryCode()); Log.d("Addresses getCountryName()", "" + address.getCountryName()); Log.d("Addresses getFeatureName()", "" + address.getFeatureName()); Log.d("Addresses getLocality()", "" + address.getLocality()); Log.d("Addresses getPostalCode()", "" + address.getPostalCode()); Log.d("Addresses getPremises()", "" + address.getPremises()); Log.d("Addresses getSubAdminArea()", "" + address.getSubAdminArea()); Log.d("Addresses getSubLocality()", "" + address.getSubLocality()); Log.d("Addresses getSubThoroughfare()", "" + address.getSubThoroughfare()); Log.d("Addresses getThoroughfare()", "" + address.getThoroughfare()); }
add = add + "\n" + obj.getSubAdminArea(); add = add + "\n" + obj.getLocality(); add = add + "\n" + obj.getSubThoroughfare();
add = add + "\n" + obj.getSubAdminArea(); add = add + "\n" + obj.getLocality(); add = add + "\n" + obj.getSubThoroughfare();
add = add + "\n" + obj.getSubAdminArea(); add = add + "\n" + obj.getLocality(); add = add + "\n" + obj.getSubThoroughfare();
add = add + "\n" + obj.getSubAdminArea(); add = add + "\n" + obj.getLocality(); add = add + "\n" + obj.getSubThoroughfare();
add = add + "\n" + obj.getSubAdminArea(); add = add + "\n" + obj.getLocality(); add = add + "\n" + obj.getSubThoroughfare();
add = add + "\n" + obj.getSubAdminArea(); add = add + "\n" + obj.getLocality(); add = add + "\n" + obj.getSubThoroughfare();
add = add + "\n" + obj.getSubAdminArea(); add = add + "\n" + obj.getLocality(); add = add + "\n" + obj.getSubThoroughfare();
add = add + "\n" + obj.getSubAdminArea(); add = add + "\n" + obj.getLocality(); add = add + "\n" + obj.getSubThoroughfare();