Quick Snippet:Retrieve info from Manifest.xml
The class PackageInfo exposes all the information contained within the Manifest.xml.
We can easily get package name, version name,version code, last update time, permissions, services...
We can easily get package name, version name,version code, last update time, permissions, services...
try { PackageInfo mInfo = getPackageManager(). getPackageInfo(getPackageName(),PackageManager.GET_META_DATA); Log.i("packageInfo", "PackageName = " + mInfo.packageName); Log.i("packageInfo", "VersionName = " + mInfo.versionName); Log.i("packageInfo", "VersionCode = " + mInfo.versionCode); Log.i("packageInfo", "Last Update Time = " + new Date(mInfo.lastUpdateTime)); Log.i("packageInfo", "Permission = " + mInfo.permissions); } catch (NameNotFoundException e) { ...... }
Comments
Post a Comment