Reputation: 957
I'm trying to listen for updates to apps that aren't my own. You can listen for intent.action.PACKAGE_ADDED and use the uid to get the app name like so:
PackageManager manager = context.getPackageManager();
String name = manager.getNameForUid(uid);
Is there any way to get that app's version number? I've looked through the PackageManager methods and couldn't find anything helpful.
Upvotes: 1
Views: 74
Reputation: 55340
That information is part of PackageInfo
(versionCode
and versionName
).
You can get that via the PackageManager.getPackageInfo()
method
Upvotes: 2