Tutorial by Examples

public String getAppVersion() throws PackageManager.NameNotFoundException { PackageManager manager = getApplicationContext().getPackageManager(); PackageInfo info = manager.getPackageInfo( getApplicationContext().getPackageName(), ...
To get versionName and versionCode of current build of your application you should query Android's package manager. try { // Reference to Android's package manager PackageManager packageManager = this.getPackageManager(); // Getting package info of this application PackageInfo...
To get the time at which your app was installed or updated, you should query Android's package manager. try { // Reference to Android's package manager PackageManager packageManager = this.getPackageManager(); // Getting package info of this application PackageInfo info = pack...
Here we can find some useful method using PackageManager, Below method will help to get the app name using package name private String getAppNameFromPackage(String packageName, Context context) { Intent mainIntent = new Intent(Intent.ACTION_MAIN, null); mainIntent.addCategory(Intent.CATE...

Page 1 of 1