Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

android check if package is installed

 import android.content.pm.PackageManager;

 public boolean isPackageExisted(String targetPackage){
   PackageManager pm=getPackageManager();
   try {
     PackageInfo info=pm.getPackageInfo(targetPackage,PackageManager.GET_META_DATA);
   } catch (PackageManager.NameNotFoundException e) {
     return false;
   }  
   return true;
 }
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #android #check #package #installed
ADD COMMENT
Topic
Name
9+8 =