Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- String your app_selected = "your package name";
- final PackageManager pm = getPackageManager();
- //get a list of installed apps.
- List<ApplicationInfo> packages = pm.getInstalledApplications(
- PackageManager.GET_META_DATA);
- int UID;
- //loop through the list of installed packages and see if the selected
- //app is in the list
- for (ApplicationInfo packageInfo : packages) {
- if(packageInfo.packageName.equals(app_selected)){
- //get the UID for the selected app
- UID = packageInfo.uid;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement