String archiveFilePath="sdcard/DangDang.apk";//安装包路径
PackageManager
pm = getPackageManager();
PackageInfo
info = pm.getPackageArchiveInfo(archiveFilePath,
PackageManager.GET_ACTIVITIES);
if(info !=
null){
ApplicationInfo appInfo = info.applicationInfo;
String appName = pm.getApplicationLabel(appInfo).toString();
String packageName = appInfo.packageName; //得到安装包名称
String version=info.versionName;
//得到版本信息
//
Toast.makeText(TestActivity.this, , Toast.LENGTH_LONG).show();
Drawable icon = pm.getApplicationIcon(appInfo);//得到图标信息
TextView tv =
(TextView)findViewById(R.id.tv);
tv.setText("appName:"+appName+"---packageName:"+packageName);
//显示图标
ImageView
tu=(ImageView)findViewById(R.id.imageView1);
tu.setBackgroundDrawable(icon);
原文地址:http://www.cnblogs.com/CaptainLin/p/3770192.html