You can save your current version code in shared preferences and on upgrade, cross check the new version with the previously stored one.
if (savedVersionCode < currentVersionCode) {
.
.
//PERFORM CERTAIN TASKS...
.
.
}
You can do this in your application's onCreate()
or simply in you launcher activity's onCreate()
if you have only one entry point.