-
Notifications
You must be signed in to change notification settings - Fork 1
Package Info
levching edited this page Apr 15, 2020
·
3 revisions
Android Native gives you access to the native Android PackageManager via AN_PackageManager class.
First of all, you need to get AN_PackageManager instance. See the example below:
using SA.Android.App;
using SA.Android.Content.Pm;
...
AN_PackageManager pm = AN_MainActivity.Instance.GetPackageManager();
Then you can retrieve information about any installed application, including your own. If you need to get the information about your own app, simply set a value of the packageName variable to your current application bundle name. See the example below:
using SA.Android.App;
using SA.Android.Content.Pm;
...
string packageName = "any.app.package.name";
var pm = AN_MainActivity.Instance.GetPackageManager();
AN_PackageInfo packageInfo = pm.GetPackageInfo(packageName, 0);
Debug.Log("packageInfo.VersionName: " + packageInfo.VersionName);
Debug.Log("packageInfo.PackageName: " + packageInfo.PackageName);
Debug.Log("packageInfo.SharedUserId: " + packageInfo.SharedUserId);
You can learn more about how the Package manager may be used with the PackageManager Guide.
Reliable and high-quality Unity Development service. Let's Talk!
Website | AssetStore | LinkedIn | Youtube | Scripting Reference
- Build Info
- Dark Mode
- Package Info
- Runtime Permissions
- Run External App
- Immersive Mode
- PackageManager
- Popups & Preloaders
- Rate Us Dialog
- Activity
- Intent
- Settings Page
- Media Player
- Date Picker Dialog
- Time Picker Dialog
- Locale
- Wheel Picker Dialog
- Developer Console Setup
- Connecting to The Service
- Purchase Flow
- Transactions Validation
- Subscriptions
- Licensing
- Getting Started
- Games Sing-in
- Server-side API Access
- Leaderboards
- Achievements
- Saved Games
- Image Manager
- Settings Intent