How can I get the application version information from google play store for prompting the user for force/recommended an update of the application when play store applicatio
You can call the following WebService: http://carreto.pt/tools/android-store-version/?package=[YOUR_APP_PACKAGE_NAME]
Example Using Volley:
String packageName = "com.google.android.apps.plus";
String url = "http://carreto.pt/tools/android-store-version/?package=";
JsonObjectRequest jsObjRequest = new JsonObjectRequest
(Request.Method.GET, url+packageName, null, new Response.Listener() {
@Override
public void onResponse(JSONObject response) {
/*
here you have access to:
package_name, - the app package name
status - success (true) of the request or not (false)
author - the app author
app_name - the app name on the store
locale - the locale defined by default for the app
publish_date - the date when the update was published
version - the version on the store
last_version_description - the update text description
*/
try{
if(response != null && response.has("status") && response.getBoolean("status") && response.has("version")){
Toast.makeText(getApplicationContext(), response.getString("version").toString(), Toast.LENGTH_LONG).show();
}
else{
//TODO handling error
}
}
catch (Exception e){
//TODO handling error
}
}
}, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
//TODO handling error
}
});