Last active
October 15, 2018 14:09
-
-
Save arifNislam/494f7ae5cadf12ceac5e8e0a5241b01d to your computer and use it in GitHub Desktop.
Application information in multi-module android project
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class AppInfoActivity : AppCompatActivity() { | |
private val tag = javaClass.simpleName | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
Log.d(tag, "Application Id: ${applicationInfo.packageName}") | |
val packageInfo = packageManager.getPackageInfo(applicationInfo.packageName, 0) | |
Log.d(tag, "Version name: ${packageInfo.versionName}") | |
Log.d(tag, "Version code: ${packageInfo.versionCode}") | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment