Reputation: 22066
hello expert,
i want to get information of all apk in mobile, like name,icon,date etc....
i refer check it but there are not satisfied solution. so can you help me?
Upvotes: 0
Views: 519
Reputation: 1779
In addition to the above answer, You should also have a look at http://developer.android.com/reference/android/os/Build.html.
It holds various informations regarding the cellphone (or tablet)
Upvotes: 0
Reputation: 1506
From your activity you should call
List<ApplicationInfo> applications = getPackageManager().getInstalledPackages(0);
Then you can get the information by running though the applications list.
You can check http://developer.android.com/reference/android/content/pm/PackageManager.html#getInstalledApplications(int) for more info on the falgs you can use.
If you want the icon and install/update of an application you should instead use
List<PackageInfo> applications = getPackagerManager().getInstalledPackages(0);
This will give you a list of PackageInfos. Then you can acces the information you seek:
for(PackageInfo info : applications){
Drawable icon = info.applicationInfo.loadIcon(getContext());
long firstInstalled = info.firstInstallTime;
long lastUpdate = info.lastUpdateTime;
}
Checkout http://developer.android.com/reference/android/content/pm/PackageInfo.html to see what else you can get from the packageinfo.
Upvotes: 1