How to get Latitude and longitude coordinates from text address in your Android App? - Geocoder API

preview_player
Показать описание
This video shows the steps to get latitude and longitude coordinates from the text address. It uses Geocoder APIs to get the address list. In this video it just fetches the 1st most probable address matching the text string. However, for more advanced location search one can filter the addresses from the list based on various parameters.

Complete source code and other details of this video are posted in the below link:

However, the main Java code is copied below also for reference:

public class MainActivity extends AppCompatActivity {

private EditText editText;
private TextView textView;

@Override
protected void onCreate(Bundle savedInstanceState) {

}

public void buttonGetCoordinates(View view){
Geocoder geocoder = new Geocoder(this);
List LESS_THAN Address GREATER_THAN addressList;

try {

if (addressList != null){

}
} catch (IOException e) {
}
}
}
Рекомендации по теме
Комментарии
Автор

Hi, Great tutorial! I have created an application similar to this, but after someone enters their address and clicks the button, it should show their location on the map. How would I go about doing this ?

tamannanankoomar
Автор

Which software ur using to create app?

abhilashgoogly
Автор

I am doing the same but it throws how to resolve it .. I have given all the necessary permission like - Fine location and coarse location??

CricketHub-qf
join shbcf.ru