mardi 8 avril 2014

magasin jeu ouvert Eclipse - Android - mise à jour ne demande pas de mettre à jour - Stack Overflow


I have inserted some code in my app to check if there is a new version avaliable.


In case there is one, the user get a dialog asking if he want to update.


Everything is working fine, but the problem is that even if the play store is showing that the current version avaliable is 1.1, and the users has the version 1.0, it still ask to "launch" or "uninstall" the app, and doesn t show any update button.


This is problematic because the user will keep recieving the update dialog and will be redirected to a page that isn t showing any updated version.


here is my code:


if (!lastVersion.equals(actualVersion)){

DialogInterface.OnClickListener dialogClickListener = new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
switch (which){
case DialogInterface.BUTTON_POSITIVE:
//Yes button clicked
try {
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse("market://details?id=com.xxx.yyy"));
startActivity(intent);
} catch (android.content.ActivityNotFoundException anfe) {
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("http://play.google.com/store/apps/details?id=com.xxx.yyy")));
}
break;

case DialogInterface.BUTTON_NEGATIVE:
//No button clicked
if (force_update){
android.os.Process.killProcess(android.os.Process.myPid());
}
break;
}
}
};



I have fixed my own problem.


In fact, as I had modified my app and tested it on the phone I was trying to get the update proposal on, I guess something, maybe an apk signature, was irrevelant for the apk published on the play store.


I tried to then install the apk version 1.0 from the store, and then, the play store shown me the update button.



I have inserted some code in my app to check if there is a new version avaliable.


In case there is one, the user get a dialog asking if he want to update.


Everything is working fine, but the problem is that even if the play store is showing that the current version avaliable is 1.1, and the users has the version 1.0, it still ask to "launch" or "uninstall" the app, and doesn t show any update button.


This is problematic because the user will keep recieving the update dialog and will be redirected to a page that isn t showing any updated version.


here is my code:


if (!lastVersion.equals(actualVersion)){

DialogInterface.OnClickListener dialogClickListener = new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
switch (which){
case DialogInterface.BUTTON_POSITIVE:
//Yes button clicked
try {
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse("market://details?id=com.xxx.yyy"));
startActivity(intent);
} catch (android.content.ActivityNotFoundException anfe) {
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("http://play.google.com/store/apps/details?id=com.xxx.yyy")));
}
break;

case DialogInterface.BUTTON_NEGATIVE:
//No button clicked
if (force_update){
android.os.Process.killProcess(android.os.Process.myPid());
}
break;
}
}
};


I have fixed my own problem.


In fact, as I had modified my app and tested it on the phone I was trying to get the update proposal on, I guess something, maybe an apk signature, was irrevelant for the apk published on the play store.


I tried to then install the apk version 1.0 from the store, and then, the play store shown me the update button.


0 commentaires:

Enregistrer un commentaire