class PInfo {
private String appname = "";
private String pname = "";
private String versionName = "";
private int versionCode = 0;
private Drawable icon;
private void prettyPrint() {
log(appname + "\t" + pname + "\t" + versionName + "\t" + versionCode + "\t");
}
}
private void listPackages() {
ArrayList<PInfo> apps = getInstalledApps(false); /* false = no system packages */
final int max = apps.size();
for (int i=0; i<max; i++) {
apps.get(i).prettyPrint();
}
}
private ArrayList<PInfo> getInstalledApps(boolean getSysPackages) {
ArrayList<PInfo> res = new ArrayList<PInfo>();
List<PackageInfo> packs = getPackageManager().getInstalledPackages(0);
for(int i=0;i<packs.size();i++) {
PackageInfo p = packs.get(i);
if ((!getSysPackages) && (p.versionName == null)) {
continue ;
}
PInfo newInfo = new PInfo();
newInfo.appname = p.applicationInfo.loadLabel(getPackageManager()).toString();
newInfo.pname = p.packageName;
newInfo.versionName = p.versionName;
newInfo.versionCode = p.versionCode;
newInfo.icon = p.applicationInfo.loadIcon(getPackageManager());
res.add(newInfo);
}
return res;
}
http://www.androidsnippets.org/snippets/70/
相关推荐
Get the most recent Vim, GVim, and Neovim versions installed Become efficient at navigating and editing text Uncover niche Vim plugins and pick the best ones Discover multiple ways of organizing ...
如何解决TOMCAT的Tomcat's administration web application is no longer installed by default. Download and install the admin package to use it.
delphi开发小工具,可以得到系统已安装的应用程序列表.
The first stable version of CoreOS Linux was made available in July 2014 and since has become one of the most commonly used operating system for containers. What You'll Learn Use Kubernetes with ...
Easy to use and modern user interface allows to comfortably work with Uninstall Tool. Multilingual interface! Translate to your language and get it for free! Option to replace Add/Remove program ...
For the best experience, have the latest version of Node installed (at least version 7). You can test most examples in the console of Chrome or other modern web browser. If you'd like to run the tests...
Several examples of ready-to-use code are provided to get you started and to continue to support applications with embedded T-SQL queries. Report designers will find this book to be a go-to ...
You'll find out how to connect to the internet, change your desktop settings, and you'll get a tour of installed applications. Next, you'll take your first steps toward being a Raspberry Pi expert by...
1.点击Preferences>BrowsePackages菜单 2.进入打开的目录的上层目录,然后再进入Installed Packages/目录 3.下载Package Control.sublime-package并复制到Installed Packages/目录 4.重启SublimeText。
3.Download Package Control.sublime-package and copy it into the Installed Packages/ directory 4. Restart Sublime Text --------------------- Package Control 安装成功的验证 5.按住Ctrl + shift + p,输入...
The version of the documentation you are reading matches the version of NTSD that was installed with the Debugging Tools for Windows package — it might not match the version of NTSD installed with ...
/P Prompt if the driver package to be installed is not better than the current one. /P 如果驱动包已经安装以及比当前使用的版本要旧就发出提示。 /F Force install inf the driver package is not better ...
It shows the Version, Edition, Service Pack, Platform and all installed applications! The data can be exported to an xml file and run via commandline. Vendors/software developers can use it to get ...
Acunetix Version 12Acunetix Version
Envision Image Library - Version 3.10 ...The design-time package need to be installed in the Delphi In the IDE of all versions, this is done from the Component | Install Packages menu.
This book shows you how to use PowerShell to quickly pinpoint, diagnose, and solve problems with your Windows Server environment, reducing the need for external tools, and ensuring you stay up-to-date...
Don't forget to mention your name, street address, EMail and web site. Contributions: -------------- ICS has been designed by Fran鏾is PIETTE but many other peoples are working on the components ...
This is to ensure compatibilty with applications built with older runtime package files or with different Delphi and C++Builder versions. If you have created packages which require these TopGrid ...
Data mining is the art and science of intelligent data ... Coupling Rattle with R delivers a very sophisticated data mining environment with all the power, and more, of the many commercial offerings.
The binaries will be installed to C:\Program Files (x86)\Windows Kits\10\Redist\ucrt. You will need to copy all of the DLLs with your app (note that the set of DLLs are necessary is different on ...