Programmatically check for the minimum required version of an App for Android and upgrade it -
i have use case in wish selectively disable android , until user upgrades minimum required version. question design inputs , best practices similar cases.
typically flow follows:-
upon starting app, main activity thread check presence of current installed version. (i looking pointers google api/tpl achieve programmatically).
then app checks minimum required version. (this can done maintaining minimum required version on rest service). possible maintain minimum required version on play store?
force user upgrade if current version < min required version. (redirecting user app store , not letting them app till upgrade - looking code pointers case)
note different push notifications app store upgrades. unlike push notifications, logic allow app stay @ min version across user base.
you can check current version of app using following code if using android studio.
int versioncode = buildconfig.version_code; string versionname = buildconfig.version_name;
i don't think maintaining installed version on play store possible using rest api option.
to force user update app, check current version version api, , if conditions not met show them alert dialog 2 options:- either exit or update. launch update intent can this
intent updateintent= new intent(intent.action_view, uri.parse("market://details?id=" + app package name));
update: can use third party libraries check updates. 1 have used gpversionchecker
Comments
Post a Comment