I highly recommend checking out Firebase's Remote Config functionality for this. Default for the parameter is "true", but Disabled Android Versions has a value of false. Then I just check if the configuration says the version is enabled or not -- I have an activity that I launch that forces the user to upgrade. I check in the only two places the app can be launched from externally my default launcher activity and an intent-handling activity.
Since Remote Config works on a cache basis, it won't immediately capture "disabled" versions of the app if the requisite time hasn't passed for the cache to be invalidated, but that is at most 12 hours if you're going by their recommended cache expiration value.
You can use the Play Core Library In-app updates to tackle this. You can check for update availability and install them if available seamlessly. In-app updates are not compatible with apps that use APK expansion files. You can either go for flexible downloads or immediate updates which Google Play takes care of downloading and installing the update for you. Before Upgrade process please make sure that you handled proper db migration process if there is any db schema change.
For forcing the app user to update if an update is available in the market, you should first check the app version on the market and compare it with the version of the app on the device. If they are different, it may be an update available.
In this post I wrote down the code for getting the current version of market and current version on the device and compare them together. I also showed how to show the update dialog and redirect the user to the update page. In this case he will be forced to update, before he can use the app. You'll have two options with this API; the first is a full-screen experience for critical updates when you expect the user to wait for the update to be applied immediately.
The second option is a flexible update, which means the user can keep using the app while the update is downloaded. You can completely customize the update flow so it feels like part of your app. It is good idea to use remote config for app version and always check in launch activity is current app version is same as remote version or not if not force for update from app store..
I implemented a lightweight library to easily implement in-app updates. You can find to the following link an example about how to force the user to perform the update. You can notify your users that there is a new version of the current app available to update. Also, if this condition is true, you can block login in the app. Please see if this provides you the solution. Well, there could be many solutions to this problem like scraping the version code from App Page Google Play App page , etc.
But I am going to show you the ultimate solution that won't cost a penny and will work like magic. If the fetched version code is greater than the current version, show an AlertDialog asking to update the app. Otherwise, the app is already updated. So, whenever you roll out the new version, you need to put that new version code in Firebase Remote config panel. You can read the whole tutorial on how to force users to update the app using Firebase Remote Config. Stack Overflow for Teams — Collaborate and share knowledge with a private group.
Create a free Team What is Teams? Collectives on Stack Overflow. Learn more. Force update of an Android app when a new version is available Ask Question. Asked 8 years, 1 month ago.
Active 3 months ago. Viewed k times. Dunedan 6, 6 6 gold badges 33 33 silver badges 43 43 bronze badges. Try it, Very simple. The best practice is to support old versions - especially for Android devices, because a forced update block on an Android app sends users to Google Play app, which is notorious for caching the old version of app pages for hours with no refresh capability except to force quit the app - a big problem most don't know about unless you have to answer 1, phone calls related to this on release day.
Version your APIs. Add a comment. Active Oldest Votes. Michael Michael 3, 4 4 gold badges 24 24 silver badges 27 27 bronze badges. Would you show popup everytime the app starts and recommendUpgrade is true? For recommended upgrade, I think you shouldn't show again if user declined.
You could also show it "once every n times that the user opened the app". You could decide the n value yourself and implement that. RaphaelC This really depends on your server side implementation. Its also not perfect to add a filter that checks the version on all API's in some situations. SepGH things have changed since, and Android now offers an API which you can use to force the user to upgrade and block him from continuing using the app if he doesn't upgrade to a minimum version: developer.
Builder this ; builder. I guess this would require the use to the add the external library JSoup? Yes, but that would be for getting the html div page. I meant to say, that you may not need to use any third party library to achieve this functionality, if you can scrape that html element without JSoup, still it would work — AshuKingSharma.
If they change the itemprop value, then it'd affect my apps too, I'd edit my answer to support that immediately, so no worry till then : — AshuKingSharma. Nice setCancelable false — Kai Wang. Show 9 more comments. Scott Helme Scott Helme 4, 2 2 gold badges 21 21 silver badges 34 34 bronze badges.
This indicates to the wider community that you've found a solution and gives some reputation to both the answerer and yourself. There is no obligation to do this. Can you quantify that? Is it possible to get current app version from app store or play store? Because right now I have service call in my server to return latest app version, but difficulty is each time need to update the server while publishing the app.
Hence is it possible to get current version number from respective stores? Supercell only supports the latest version of their games. After they've pushed a new version to Google Play, any older client trying to connect will get a "need to update" response from the server and see the connection closed. They're doing this multiple times every year. So unless you don't want to count a "game company" as "software vendor", now you know one : Considering they're still making a couple of million dollars every day, apparently this terrible user experience is not a show stopper.
Subha Yes, that's possible. But there's no official API for it, so you'd need to scrape the web pages. Which also means that it may break if the web page changes. I did it in a third party app that I wrote and posted the rather simple code as answer here. Currently, the code will work for both Play and iTunes pages. In a production environment though, it may be better to look for a solution that'd automatigally update the latest app version on the server, instead of having to rely on the format of pages at Google or Apple?
Show 3 more comments. Solution from Google team Starting from Android 5. The library provides you 2 different ways to notify the users about the update: Flexible, when users can continue using the app while it is being updated in the background. Immediate - blocking screen that doesn't allow a user to enter the app until they update it. Gaket Gaket 5, 2 2 gold badges 31 31 silver badges 60 60 bronze badges. Kirill Karmazin Kirill Karmazin 4, 1 1 gold badge 39 39 silver badges 32 32 bronze badges.
I am going to upload the app to Google Play and to Amazon Appstore for android , so a link to Google Play or something similar is maybe not the best solution. I was thinking - a toast message "please update the app". What do you think? It take few hours to publish update. This is not a feasible option, I guess. What is KeyStore? Keep your keystore in a secure location. If you lose your keystore, you'll need to publish the app with a new package name and a new key.
If you need to do this, you should also unpublish the original app and update its description. Please check out this library, actually it provides what you want with simple approach. When you publish a new version of your app to the Play Store, you will not lose any of the prior ratings for that app.
You can't force users to update your app. It is fully under their control. Some people may have automatic updates turned on, but for those who do not, they have to choose to receive the update. Google added this new feature you can add to your app to force in-app update based on if you want the update immediate or flexible.
Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Collectives on Stack Overflow. Learn more. How to update app with Google Play and force download Ask Question. Asked 5 years, 8 months ago. Active 6 days ago. Viewed 9k times.
Like how WhatsApp does it — Bhargav. I'm using it. Thanks — UFC Insider. Add a comment. Active Oldest Votes. Forcing users to update: There are three things 1 It is not possible in Google Play Store, unless user have set automatic update on.
This is not a feasible option, I guess What is KeyStore? It is used to build singed apk. Community Bot 1 1 1 silver badge. Omkar Omkar 1, 3 3 gold badges 16 16 silver badges 35 35 bronze badges. Thanks you very much! Doug Stevenson Doug Stevenson k 30 30 gold badges silver badges bronze badges.
0コメント