Java tutorial
//package com.java2s; import android.location.Criteria; import android.location.LocationManager; public class Main { public static String getBestProvider(LocationManager locationManager) throws IllegalArgumentException { Criteria criteria = new Criteria(); criteria.setAccuracy(Criteria.ACCURACY_FINE); criteria.setPowerRequirement(Criteria.NO_REQUIREMENT); return locationManager.getBestProvider(criteria, true); } }