Geocoding Example Android
Geocoding Example Android
import android.location.Address;
import android.location.Geocoder;
import android.os.Bundle;
import android.widget.TextView;
import androidx.appcompat.app.AppCompatActivity;
import java.io.IOException;
import java.util.List;
import java.util.Locale;
TextView textView;
Geocoder geocoder;
@Override
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
textView = findViewById(R.id.textView);
try {
} catch (IOException e) {
e.printStackTrace();
try {
} catch (IOException e) {
e.printStackTrace();
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
Geocoding and Reverse Geocoding Example in Android
android:layout_width="match_parent"
android:orientation="vertical"
android:padding="16dp"
android:layout_height="match_parent">
<TextView
android:id="@+id/textView"
android:textSize="16sp"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</LinearLayout>
Notes