Android examples for App:App Running
check App Sideloaded
//package com.java2s; import android.content.Context; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.List; public class Main { private static List<String> playstoreList = new ArrayList<>( Arrays.asList("com.android.vending", "com.google.android.feedback")); private static List<String> amazonList = new ArrayList<>( Collections.singletonList("com.amazon.venezia")); public static boolean checkSideloaded(Context context) { return !checkNotSideloaded(context); }//from w ww.ja v a 2 s. c om public static boolean checkNotSideloaded(Context context) { List<String> mergedList = new ArrayList<>(); mergedList.addAll(playstoreList); mergedList.addAll(amazonList); final String installer = context.getPackageManager() .getInstallerPackageName(context.getPackageName()); return installer != null && mergedList.contains(installer); } }