1

I put my app to Google Play, now I do something like adding new function, new UI, etc then re-upload app into Google Play.

So I want, when user launch app, if there is a new update, one dialog show to remind the user, allow them to update the latest version.

Google seems not provide any API to get app version, so is there any solution to do?

enter image description here

2 Answers 2

1

Try to store current version in their mobile and store newest version in your server.

When user launch app, check if it different, app will display dialog to remind use download newest application.


EDIT:

Check it comment: https://stackoverflow.com/a/14512102/4531387

Sign up to request clarification or add additional context in comments.

4 Comments

You mean I must have own server and store version on it. When app launched,app will compare current version and version in my server?
Yep. Try to do it ;)
Thank you :) but there is no way to get app version from google play?
stackoverflow.com/a/14512102/4531387 Did you read it before. I cant test it now.
0

Use Jsoup library and follow these steps:

1.add the dependency in your app level build.gradle

compile 'org.jsoup:jsoup:1.10.2' 

2. Add this class in your src

public class VersionChecker extends AsyncTask<String, String, String> { private String newVersion; @Override protected String doInBackground(String... params) { try { newVersion = Jsoup.connect("https://play.google.com/store/apps/details?id=" + BuildConfig.APPLICATION_ID + "&hl=en") .timeout(30000) .userAgent("Mozilla/5.0 (Windows; U; WindowsNT 5.1; en-US; rv1.8.1.6) Gecko/20070725 Firefox/2.0.0.6") .referrer("http://www.google.com") .get() .select("div[itemprop=softwareVersion]") .first() .ownText(); } catch (IOException e) { e.printStackTrace(); } return newVersion; }}// add following lines to your code where you want to get live app version VersionChecker versionChecker = new VersionChecker();try { mLatestVersionName = versionChecker.execute().get();} catch (InterruptedException | ExecutionException e) { e.printStackTrace();} 

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.