Android In Code获取App的版本? [英] Android In Code get the Version of App?

查看:67
本文介绍了Android In Code获取App的版本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找获取应用程序版本的方法,以便可以在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 ();

推荐答案

您可以使用版本代码 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获取App的版本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆