Android应用程序无法在市场:如何推送更新? [英] Android app not in Market: how to push updates?

查看:123
本文介绍了Android应用程序无法在市场:如何推送更新?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Android应用程序为我公司自成立一个私人的应用程序编写的,它不是在Android Market。我希望能有定期的检查应用程序的更新,如果有一个通知用户,并开始下载/安装更新。

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?

推荐答案

在你的应用程序开始检查可用的版本,你可以使用一个AlertDialog要求进行升级。

at the start of your app check the available version, the you can use an AlertDialog to ask for the upgrade.

阅读:: <一href="http://stackoverflow.com/questions/3057771/is-there-a-way-to-automatically-update-application-on-android/3057965#3057965">Is有没有办法在Android上自动更新的应用程序?

和这是一个AlertDialog例子::

and this is an AlertDialog example::

    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();

    }

这篇关于Android应用程序无法在市场:如何推送更新?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆