Java tutorial
//package com.java2s; import android.content.Context; import android.location.LocationManager; import java.util.List; public class Main { public static boolean supportGps(Context context) { final LocationManager mgr = (LocationManager) context.getSystemService(Context.LOCATION_SERVICE); if (mgr != null) { List<String> providers = mgr.getAllProviders(); return providers != null && providers.contains(LocationManager.GPS_PROVIDER); } return false; } }