is Amazon Device - Android Hardware

Android examples for Hardware:Vendor

Description

is Amazon Device

Demo Code


//package com.java2s;

import android.app.Activity;
import android.app.Application;

import android.os.Build;

public class Main {
    public static boolean isAmazonDevice(Activity activity) {
        boolean isAmazonDevice = Build.MANUFACTURER
                .equalsIgnoreCase("amazon");

        final Application application = activity.getApplication();
        String installerName = application.getPackageManager()
                .getInstallerPackageName(application.getPackageName());
        boolean fromAmazonStore = installerName != null
                && installerName.equalsIgnoreCase("com.amazon.venezia");

        return isAmazonDevice || fromAmazonStore;
    }// www  .j a v a2  s. co m
}

Related Tutorials