Android 版本代码以编程方式

标签 android android-version

有什么方法可以动态地以编程方式了解 Android 应用程序的版本代码?

我不知道……也许是这样

 getApplicationContext.getVersionCode();

非常感谢。

最佳答案

如果您使用的是 gradle(AndroidStudio 中的默认设置),您可以:

BuildConfig.VERSION_CODE

关于Android 版本代码以编程方式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28425946/

相关文章:

android - Android 如何处理未知的 XML 标签?

Android Library 目标编译和后续 Android 版本中的对象

android - 在软键盘上显示 'Done' 键

android - Activity 不在 android 4.4 kitkat 上显示 fab 图标

android - 如何让你的安卓应用自动更新

android - iOS 相当于 Android 的 SharedPreferences

android - 以编程方式添加左侧边框颜色

android - SimpleDateFormat 在 Android Kitkat 中不起作用

android - Google Analytics 为我的 Android 应用选择了错误的版本号

android - Eclipse Android gen 已经存在但不是源文件夹