Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
import android.content.Context;
import android.location.LocationManager;

import java.util.List;

public class Main {

    public static boolean isGPSEnabled(Context cxt) {
        LocationManager locationManager = ((LocationManager) cxt.getSystemService(Context.LOCATION_SERVICE));
        List<String> accessibleProviders = locationManager.getProviders(true);
        return accessibleProviders != null && accessibleProviders.size() > 0;
    }
}