Android examples for Hardware:Gps
Purpose - Check if GPS is present.
//package com.java2s; import android.content.Context; import android.content.pm.PackageManager; public class Main { /**/*w w w.j av a 2 s . c o m*/ * Purpose - Check if GPS is present. * * @param context Current Activity\Context from which this method is called * */ public static boolean getGPSPresentStatus(Context context) { if (context == null) return false; PackageManager pm = context.getPackageManager(); return pm.hasSystemFeature(PackageManager.FEATURE_LOCATION_GPS); } }