I’ve developed an android app and it is having an issue while the user upgrading the app from market.
Fresh installation is having no issues but on upgrading the current app to the new version, produces some issues.
So is it possible to know whether the user is installing the app for the first time or he is upgrading the app?
Please share your thoughts..
Thanks in advance!!
Not directly.
However, on first run of your app, you can write your
versionCodeto internal storage (e.g., in aSharedPreferences), and on subsequent runs of your app, compare yourversionCodeto the saved one.If there is no saved value, your app was just installed, or the user clicked on “Clear data” in Settings
If there is a saved value, and the
versionCodein your app is newer than the saved one, then the app was updatedIf there is a saved value, and the
versionCodein your app is the same as the saved one, then nothing happened in terms of install/upgrade