Effortless way of Releasing new Android App Update on Play Store.
Background
Software/Application development is the process of designing, programming, documenting, testing, and bug fixing involved in creating and maintaining applications or software components. As a Developer it is necessary to roll out new features and bug fixes for current application users are enjoying to use. Keeping your app up-to-date on your users’ devices enables them to try new features, as well as benefit from performance improvements and bug fixes.
Lot many Developers have their own way of thinking to roll out new updates for Android Applications. Possible ways Developers use are :
- Maintain a Server Api call to check is there a new update for app, if yes redirect to play store for app update
- Maintain a Firebase Database call for checking Latest version and lot more…
Solution
For this above problem, Starting from Android 5 (API 21), In-App Update is the solution.
What is this ?
- In-app updates is a Play Core library feature that introduces a new request flow to prompt active users to update your app.
- In-app updates works only with devices running Android 5.0 (API level 21) or higher, and requires you to use Play Core library 1.5.0 or higher.
- After meeting these requirements, your app can support the following for in-app updates:
Flexible : A user experience that provides background download and installation with graceful state monitoring. This UX is appropriate when it’s acceptable for the user to use the app while downloading the update. For example, you want to urge users to try a new feature that’s not critical to the core functionality of your app.
Immediate : A full screen user experience that requires the user to update and restart the app in order to continue using the app. This UX is best for cases where an update is critical for continued use of the app. After a user accepts an immediate update, Google Play handles the update installation and app restart.
Note : We will only go through Immediate explanation & demo.
Steps to Follow :
Import Google’s Play Core library (version 1.5.0 and above) to our project with latest version (Latest release 1.7.2, March 2020)
Later, we need to have some mechanism to check whether update is available from Play Store or not. This is helper classes we need to use, AppUpdateManager
To request an update again we need to use helper class AppUpdateInfo. This result in downloading & updating task of our application
Make sure you add some REQUEST_CODE in for appUpdateInfoTask success Listener
Lastly, we need to override onActivityResult() to handle what user has preferred to do with update or what if something went wrong during update
Problems Faced & Solutions
- To make this in app update work, app should be first release on Play Store
- To test, generate signed Apk with less version code than actually available on Play Store
- When you open the app the UX for Immediate App Update will pop up
- You will receive this kind of UX
Thanks for reading. Do give a free Claps if you find it useful. Enjoy Learning.