Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
import java.io.IOException;
import java.util.List;
import java.util.Locale;
import android.content.Context;
import android.location.Address;
import android.location.Geocoder;
import android.location.Location;

public class Main {
    public static List<Address> getAddress(Context c, Location loc) throws IOException {
        Geocoder geocoder = new Geocoder(c, Locale.getDefault());
        List<Address> addresses = null;

        addresses = geocoder.getFromLocation(loc.getLatitude(), loc.getLongitude(), 1);

        return addresses;
    }
}