0

I have an android app that the features may keep updating from time to time. Those features are hard coded into the app and I feel that if like 100 users download the app and when some features of the app is updated and re-upload to the play store those users who have installed the app prior now may have lost out on some of the latest features uploaded to the play store.

To tackle this issue I arrived at this solution as described in the url but yet to implement it in the onCreate method

Intent intent = new Intent(Intent.ACTION_VIEW ,Uri.parse("market://details?id=com.package.name"));
startActivity(intent);

Is there a way to automatically update application on Android?

I want to be guided properly please, if this approach will solve my doubts. Kindly assist!

Community
  • 1
  • 1
Blaze
  • 2,269
  • 11
  • 40
  • 82

2 Answers2

0

The solution you are looking for is REACT NATIVE APPS. React Native apps allows you to change and add many features without uploading the app to play store.

https://facebook.github.io/react-native/showcase.html

UPDATE

But If you want to use android native development then. Make an API in your backend which will return the latest version of your app in its response like:

{
  appVersion: "4.2.1"
}

Then in your android app on the first activity make a call to this API and compare the version of your application with the API version.

String currentVersion = BuildConfig.VERSION_NAME;

If it doesn't match then show a message to the user to update the app from play store and give a button which will redirect to your app link on google play store.

Whenever you update your app in play store change the version in your API.

You can also maintain versions for major and minor update.

{
majorVersion:4
minorVersion:1
patchVersion:2
}

Then in your app:

String majorVersion = android.optString("majorVersion");
String minorVersion = android.optString("minorVersion");
String patchVersion = android.optString("patchVersion");
String[] ab = BuildConfig.VERSION_NAME.split("\\.", 3);
String appMajorVersion = ab[0];
String appMinorVersion = ab[1];

And use if else to check whether you need to force update or not.

Aayush Thakur
  • 634
  • 1
  • 10
  • 22
0

if you used web serivce then pass your app version to web team. and then getting first web service call one flag for app is old or not and you can manullay set dialog when app is open. and then redirect appp to playsotre.

Rony
  • 266
  • 1
  • 5