Android In Code 获取应用程序版本? [英] Android In Code get the Version of App?
本文介绍了Android In Code 获取应用程序版本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在寻找获取应用版本的方法,以便我可以在我的 Android 应用的关于"屏幕中显示它.
I'm looking for the way to get the version of the app so I can display it in the About screen in my Android app.
在 iOS (MonoTouch.net) 中,我们会这样做:
In iOS (MonoTouch.net) we'd just do this:
NSBundle.MainBundle.ObjectForInfoDictionary ("CFBundleVersion").ToString ();
推荐答案
您可以使用 PackageManager.GetPackageInfo 方法来访问有关您的应用的各种信息,包括 VersionCode 和 VersionName一个>
You can use the PackageManager.GetPackageInfo method to get access to all sorts of information about your app, including VersionCode and VersionName
这篇关于Android In Code 获取应用程序版本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文