雷神索尔怎么死的:Get installed Applications with Name, Package Name, Version and Icon
来源:百度文库 编辑:九乡新闻网 时间:2024/04/24 21:40:04
Get installed Applications with Name, Package Name, Version and Icon
5 votes · 6 comments
This helper function retrieves all installed apps with the application name, package name, version-number and -code as well as the icons. The method getPackages() returns an ArrayList with all the apps.
·
copy
',1)">
·download
class PInfo {
private String appname = "";
private String pname = "";
private String versionName = "";
private int versionCode = 0;
private Drawable icon;
private void prettyPrint() {
Log.v(appname + "\t" + pname + "\t" + versionName + "\t" + versionCode);
}
}
private ArrayList getPackages() {
ArrayList apps = getInstalledApps(false); /* false = no system packages */
final int max = apps.size();
for (int i=0; iapps.get(i).prettyPrint();
}
return apps;
}
private ArrayList getInstalledApps(boolean getSysPackages) {
ArrayList res = new ArrayList();
List packs = getPackageManager().getInstalledPackages(0);
for(int i=0;iPackageInfo 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;
}
5 votes · 6 comments
This helper function retrieves all installed apps with the application name, package name, version-number and -code as well as the icons. The method getPackages() returns an ArrayList with all the apps.
·
copy
',1)">
·download
class PInfo {
private String appname = "";
private String pname = "";
private String versionName = "";
private int versionCode = 0;
private Drawable icon;
private void prettyPrint() {
Log.v(appname + "\t" + pname + "\t" + versionName + "\t" + versionCode);
}
}
private ArrayList
ArrayList
final int max = apps.size();
for (int i=0; i
}
return apps;
}
private ArrayList
ArrayList
List
for(int i=0;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;
}
Get installed Applications with Name, Package Name, Version and Icon
Name
spring roo :Error creating bean with name 'entityManagerFactory'
Animated Text and Icon Menu with jQuery | Codrops
To name a shoe
英语中surname,family name,last name ,first name,given name
What's in a name ... and what isn't? John May...
check version of Win Pe Installed
英语歌曲: Breathe Your Name
Mangled name的结构(borland)
ora-00957:duplicate column name
FIFA: Another name for corruption
print name 和 signature是什么意思?
流行美语:get with the program & cost an arm and a leg(英语听力)ZT
Rhianna ft. Drake - What's My Name
Failed to find 'glbl' in hierarchical name.
Trickery in the name of philanthropy
Trickery in the name of philanthropy ]
Unit 1 My name’s Gina.
get along well with others
Asia version of NATO resurfaces with Gillard'...
Xinjiang regional official opens microblog under real name
How to Select a Company or Product Name
【故障处理】ORA-12162: TNS:net service name is inco...