Android examples for Map:Location
Returns whether the Location Service is available on the current device
//package com.java2s; import android.content.Context; public class Main { /**/*from w ww .j a v a2 s . co m*/ * Returns whether the Location Service is available on the current device * * @param ctx the current context * @return <code>true</code> if device supports location services <code>false * otherwise</code> */ public static boolean isLocationAvailable(Context ctx) { Object service = ctx.getSystemService(Context.LOCATION_SERVICE); return (service != null); } }