Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android versionCode programmatically

Is there any way to know dynamically and programmatically the versionCode of an Android application??

I don´t know... maybe something like

 getApplicationContext.getVersionCode();

Thank you very much.

like image 579
Eloy Fernández Franco Avatar asked Feb 10 '15 07:02

Eloy Fernández Franco


1 Answers

If you're using gradle (default in AndroidStudio) you can:

BuildConfig.VERSION_CODE
like image 170
Simas Avatar answered Oct 04 '22 00:10

Simas