sample code to Display all installed applications in Our Device in Android

final PackageManager pm = getPackageManager();
        String str="com.tf.thinkdroid.amlite";
      //get a list of installed apps.
              List<ApplicationInfo> packages = pm
                      .getInstalledApplications(PackageManager.GET_META_DATA);

              for (ApplicationInfo packageInfo : packages) {

                  Log.d("TAG", "Installed package :" + packageInfo.packageName);
                  if((packageInfo.packageName).equalsIgnoreCase(str)){
                      System.out.println("*****s/w installed");
                                        break;}
                  Log.d("TAG",
                          "Launch Activity :"
                                  + pm.getLaunchIntentForPackage(packageInfo.packageName));

              }// the getLaunchIntentForPackage returns an intent that you can use with startActivity()

Comments

Popular posts from this blog

Custom Dialog with no title and full screen in Android

code to display .pdf,.text,.DOC,.DOCX,.doc extension files exists in SDCard

Best working code to set Date limits on Date Picker Dialog,in Android