Wednesday, June 22, 2011

Installed application information in Android

Using PackageManager we can get the all installed application details in Android device like package name,version code,version info,class name etc.

Code snippet:

PackageManager pckMgr;
pckMgr = getPackageManager();
List appInfo = pckMgr.getInstalledPackages(PackageManager.GET_ACTIVITIES);
Log.i("Number of Applications are installed " ,":"+ appInfo.size());
for ( int cnt=0; cnt < appInfo.size(); cnt++){

Log.i("Package name ",":"+appInfo.get(cnt).packageName);
Log.i("Application name ",":"+appInfo.get(cnt).applicationInfo.loadLabel(getPackageManager()));
Log.i("Version code ",":"+appInfo.get(cnt).versionCode);
Log.i("Version name ",":"+appInfo.get(cnt).versionName);

}

1 comment:

walchelimvaldespino said...

Mr Green Casino and Hotel - DrMCD
Find 화성 출장샵 helpful customer reviews 전라남도 출장안마 and review 진주 출장샵 ratings for 성남 출장샵 Mr Green Casino and Hotel in MCD. 순천 출장안마 Learn more about their Hospitality, Gambling and Gaming market share.