How to Get Application Version for Android


How to Get Application Version for Android
If you are android phone user and you used to challenge yourself in terms of jailbreak or rooting, there is one more thing you can challenge which is How to Get Application Version for android. Some of you may have been found how to get but I am sure many of us did not know. Knowing application version for android is very critical especially for android user who wants to install application. You should be careful and indicate whether this application version is newer or compatible with your android version. Than How is to Get Application Version on your android phone?
You can get application version for android at two places on your android phone. First location is you can check on the “about the application” that usually available on each application. The second location is you can get it in the android market website. Please visit this website and check it on “About this App”. Usually android developer will put the latest version on application and will update the application with the new one if there are new updates. When you check application version on your android, there are two properties that you should considered which are android: versionCode and android: versionName
You should give a largernumber on versionCode when new application version coming. Meanwhile versionName indicated the application name. to get better understanding, following is sample code you will find on the application version
PackageManager manager = this.getPackageManager(); ==> indicate the package manager
PackageInfo info = manager.getPackageInfo(this.getPackageName(), 0); ==> indicate package info
Toast.makeText(     this,     ”PackageName = ” + info.packageName + “\nVersionCode = “       + info.versionCode + “\nVersionName = “       + info.versionName + “\nPermissions = “+info.permissions, Toast.LENGTH_SHORT).show(); ===>indicate the package name

Incoming search terms for the article:

  • monodroid PackageManager GetPackageInfo (1)