2012-07-11 2 views
0

est-il un moyen d'obtenir des détails sur les applications installées dans l'appareil? Je veux mettre en œuvre une application qui peut avoir au moins les noms des applications installées. merci d'avance.android détail de l'application intallée

+1

vous devez utiliser PackageManager –

Répondre

2

Vous pouvez utiliser le PackageManager:

final PackageManager pm = getPackageManager(); 
//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); 
     Log.d(TAG, "Launch Activity :" 
         + pm.getLaunchIntentForPackage(packageInfo.packageName)); 
     Log.d(TAG, "Application name :" + pm.getApplicationLabel(packageInfo)); 

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

Edit: Vous pouvez utiliser getApplicationLabel() pour obtenir le nom, comme indiqué ci-dessus.

http://qtcstation.com/2011/02/how-to-launch-another-app-from-your-app/

+0

grâce, a voté, mais j'ai besoin noms d'applications ... –

+0

@AbdulWahab voir mon édition. – Tushar

+0

gentil ... Je ne sais pas, y j'ai eu le droit de voter pour cet article .... :( –

0

Ici, vous allez:

final Intent intent = new Intent(Intent.ACTION_MAIN, null); 
intent.addCategory(Intent.CATEGORY_LAUNCHER); 
final List appsList = context.getPackageManager().queryIntentActivities(intent, 0); 
Questions connexes