check For Location Services - Android Map

Android examples for Map:Location

Description

check For Location Services

Demo Code


//package com.java2s;
import android.content.Context;
import android.os.Build;

public class Main {
    public static boolean checkForLocationServices(Context paramContext) {
        return (paramContext.getPackageManager()
                .hasSystemFeature("android.hardware.location"))
                || ((!isKindleFireGen1()) && (isKindle()));
    }//from  ww w .  ja  va 2 s .  c o m

    public static boolean isKindleFireGen1() {
        return (isKindle())
                && (("Kindle Fire".equals(Build.MODEL)) || ("KFOT"
                        .equals(Build.MODEL)));
    }

    public static boolean isKindle() {
        return "Amazon".equals(Build.MANUFACTURER);
    }
}

Related Tutorials