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<pinfo> getPackages() {
ArrayList<pinfo>
apps = getInstalledApps( false );
/*
false = no system packages */
final
int
max = apps.size();
for
(
int
i=
0 ;
i<max; arraylist<pinfo= ""
private
= ""
}=
""
apps;=
""
return
= ""
apps.get(i).prettyprint();=
""
{=
""
i++)=
"" >
getInstalledApps( boolean
getSysPackages) {
ArrayList<pinfo>
res = new
ArrayList<pinfo>();
List<packageinfo>
packs = getPackageManager().getInstalledPackages( 0 );
for ( int
i=
0 ;i<packs.size();i++)
}= ""
return
= ""
{=
""
pre=
""
<=
""
res;=
""
res.add(newinfo);=
""
newinfo.icon=
"p.applicationInfo.loadIcon(getPackageManager());"
newinfo.versioncode=
"p.versionCode;"
newinfo.versionname=
"p.versionName;"
newinfo.pname=
"p.packageName;"
newinfo.appname=
"p.applicationInfo.loadLabel(getPackageManager()).toString();"
pinfo();=
""
newinfo=
"new"
pinfo=
""
;=
""
continue
= ""
null
))= ""
(p.versionname=
"="
&&=
""
((!getsyspackages)=
""
if
= ""
p=
"packs.get(i);"
packageinfo=
"" ></packs.size();i++)></packageinfo></pinfo></pinfo></max;></pinfo></pinfo>
|