Android app not in Market: how to push updates?

I have an android app written for my company and since its a private app, it is not in the android market. I'd like to be able to have the app check periodically for an update and if there is one notify the user and start downloading / installing the update.

Is there an example of something like this out there?

15
задан Mike 18 August 2010 в 19:54
поделиться

1 ответ

в начале вашего приложения проверьте доступную версию, вы можете использовать AlertDialog, чтобы запросить обновление.

Прочтите: Есть ли способ автоматически обновлять приложение на Android?

и это пример AlertDialog ::

    if (ConfigXML_app_version> myapp_version){
        AlertDialog.Builder builder = new AlertDialog.Builder(this);
        builder.setTitle("Upgrade");
        builder.setMessage("Update available, ready to upgrade?");
        builder.setIcon(R.drawable.icon);
        builder.setCancelable(false);
        builder.setPositiveButton("Yes", new DialogInterface.OnClickListener() {
            public void onClick(DialogInterface dialog, int id) {
                Intent intent = new Intent(Intent.ACTION_VIEW ,Uri.parse(app_link));
                startActivity(intent);               
                finish();
            }
        });
        builder.setNegativeButton("Nop", new DialogInterface.OnClickListener() {
            public void onClick(DialogInterface dialog, int id) {
                dialog.cancel();
            }
        });
        AlertDialog alert = builder.create();
        alert.show();

    }
9
ответ дан 1 December 2019 в 05:02
поделиться
Другие вопросы по тегам:

Похожие вопросы: