Is there a way for my app to know the android:versionCode from AndroidManifest.xml or do I have to create a separate constant in one of my classes?
You can get version code simply from .BuildConfig#VERSION_CODE reference. It is generated by ADT plugin/Intellij.
.BuildConfig#VERSION_CODE