首页 > 代码库 > android通过apk包得到apk包信息

android通过apk包得到apk包信息

    //安装包路径          String weicharFilePath="sdcard/weichar.apk";        PackageManager pm = getPackageManager();            PackageInfo info = pm.getPackageArchiveInfo(weicharFilePath, PackageManager.GET_ACTIVITIES);            if(info != null){                ApplicationInfo appInfo = info.applicationInfo;                String appName = pm.getApplicationLabel(appInfo).toString();           //得到安装包名称              String packageName = appInfo.packageName;           //得到版本信息                String version=info.versionName;            //得到图标信息              Drawable icon = pm.getApplicationIcon(appInfo);        } 

 

android通过apk包得到apk包信息