如何从我的应用程序打开Goog​​le Play商店应用程序,以便在Play商店中安装我的应用程序的最新版本 [英] How to open Google Play Store App from my app to install the latest version of my app available on play store

查看:591
本文介绍了如何从我的应用程序打开Goog​​le Play商店应用程序,以便在Play商店中安装我的应用程序的最新版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个关于应用程序升级场景的问题。基本上我是从应用程序发送应用程序版本到应用程序服务器,然后决定是否显示应用程序升级提醒屏幕。应用程序升级提醒屏幕有2个选项立即更新或忽略。

要求是更新现在应该打开Play商店应用程序,我的应用程序已经搜索了它。



我执行了以下代码:

  try {
startActivity(new Intent(Intent.ACTION_VIEW,Uri.parse(market:// details?id =+ appName)));
} catch(android.content.ActivityNotFoundException anfe){
startActivity(new Intent(Intent.ACTION_VIEW,Uri.parse(http://play.google.com/store/apps/details?id =+ appName)));
}

有两个问题:

<1>它会在我的应用程序之上打开Play商店。
我需要玩商店应用程序来单独打开,我的应用程序应该仍然活着。


$ b 2)Play商店只显示2个选项(卸载和打开)。它不提供更新应用程序的选项。



有人可以向它发出一些指示。

解决方案

我会推荐你​​想要做的事。是否有理由需要通知应用程序中的用户进行更新? Play商店会通知他们,甚至会在后台自动更新您的应用。



请记住,Play商店会推出应用更新。您可能会将用户重定向到Play商店以更新您的应用,并且该更新尚未提供给他们。这通常不是一个很长的时间框架,但它存在。



如果您必须这样做,那么要完成第一个请求,您可以添加新任务标志的意图。这将使新活动成为历史上的新任务。

 尝试{
意向i =新意向(Intent.ACTION_VIEW,Uri.parse(market:// details?id =+ appName));
i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(i);
} catch(android.content.ActivityNotFoundException anfe){
...
}

您遇到的第二个问题是因为您安装了最新版本。如果实际上有可用的更新,那么你会得到按钮说更新和卸载。


I have a question regarding the app upgrade scenario from the app. Basically I am sending the app version from app to application server and then deciding whether to show the app upgrade reminder screen or not. App upgrade reminder screen has 2 options "update now" or "ignore".

Requirement is Update Now should open play store app with my app already searched on it.

I implemented following code :

try {
    startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=" + appName)));
} catch (android.content.ActivityNotFoundException anfe) {
    startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("http://play.google.com/store/apps/details?id=" + appName)));
}

There are 2 problems with it :

1) It opens play store on top of my App. I need play store app to open separately and my app should still be alive.

2) Play store shows only 2 options (Uninstall and Open). It doesn;t give option to update the app.

Can someone please throw some direction to it.

解决方案

I would recommend against what you are trying to do. Is there a reason you need to notify users in app to update? The Play Store will notify them, and even automatically update your app in the background if there is an update.

Keep in mind that the Play Store rolls out your app updates. It's possible that you could redirect the user to the Play Store to update your app, and the update isn't yet available for them. This isn't usually a huge time frame, but it exists.

If you must do it, then to accomplish your first request you could add the new task flag to the intent. This will make the new activity launch as a new task in the history.

try {
    Intent i = new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=" + appName));
    i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    startActivity(i);
} catch (android.content.ActivityNotFoundException anfe) {
    ...
}

The second issue you're having is because you have the latest version installed. If there is, in fact, an update available then you will get buttons saying "Update" and "Uninstall".

这篇关于如何从我的应用程序打开Goog​​le Play商店应用程序,以便在Play商店中安装我的应用程序的最新版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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