Print('Android version: ’ + _Android_version)Īs I had to get only the version code and check whether app was updated or not, if yes, I had to launch the playstore to get updated one. _Android_version = subprocess.check_output('grep -n "VERSION_NAME" ' + _BuildConfig, shell=True).split('"') VersionName "$ -name BuildConfig.java', shell=True).rstrip() VersionCode versionMajor * 10000 + versionMinor * 1000 + versionPatch * 100 + versionBuild File adle def versionMajor = 3ĭef versionBuild = 0 // Bump for dogfood builds, public betas, etc. So, here are instructions for ensuring you're setting your VERSION_NAME via Gradle. I kept getting an empty string for BuildConfig.VERSION_NAME, because I wasn't setting the versionName in my Grade build file (I migrated from Ant to Gradle). If you're getting an empty string for BuildConfig.VERSION_NAME then read on. Is it returning an empty string for VERSION_NAME? Using Gradle and BuildConfig Getting the VERSION_NAME from BuildConfig BuildConfig.VERSION_NAME + info.versionName + "\nPermissions = " + info.permissions, Toast.LENGTH_SHORT).show() "PackageName = " + info.packageName + "\nVersionCode = " PackageInfo info = manager.getPackageInfo(this.getPackageName(), PackageManager.GET_ACTIVITIES) Java: PackageManager manager = this.getPackageManager() + info.versionName + "\nPermissions = " + info.permissions) Toast("PackageName = " + info.packageName + "\nVersionCode = " Val info = manager.getPackageInfo(this.packageName, PackageManager.GET_ACTIVITIES) Kotlin: val manager = this.packageManager This is where you define your app as "1.0" or "2.5" or "2 Alpha EXTREME!" or whatever. It is barebones and cross-platform as it is a cloud app. Google Keep resembles Post-It notes and the utility is almost the same for your digital note-taking needs. Platforms: Web, Browser extensions, Android, iOS. VersionName is a string and can be anything you want it to be. The best note taking apps for Windows and macOS.
VersionCode is a number, and every version of the app you submit to the market needs to have a higher number than the last.