【发布时间】:2013-11-24 15:53:52
【问题描述】:
我想在我的 Android 应用中创建一个弹出窗口,以提供给去市场的用户为我的应用投票。情况是,要做到这一点,我实际上需要'id' play store 为我的应用程序提供给我......但如果我还没有上传它,我现在怎么知道我正在开发它?
有什么想法吗?谢谢!
【问题讨论】:
标签: android google-play publishing
我想在我的 Android 应用中创建一个弹出窗口,以提供给去市场的用户为我的应用投票。情况是,要做到这一点,我实际上需要'id' play store 为我的应用程序提供给我......但如果我还没有上传它,我现在怎么知道我正在开发它?
有什么想法吗?谢谢!
【问题讨论】:
标签: android google-play publishing
Google Play 不会为应用“分配”随机 ID。 id 是您应用的唯一包名,由您选择,因此您会知道。
例如:
https://play.google.com/store/apps/details?id=com.facebook.katana
您的应用将是:
https://play.google.com/store/apps/details?id=your.package.name
这将是您在应用的manifest.xml 中定义的包。
【讨论】:
使用包名,因为 Google Play 会根据您应用的包名生成 Play 商店链接。
Intent intent = new Intent(Intent.ACTION_VIEW);
//Try Google play
intent.setData(Uri.parse("market://details?id=[package]"));
if (MyStartActivity(intent) == false) {
//Market (Google play) app seems not installed, let's try to open a webbrowser
intent.setData(Uri.parse("https://play.google.com/store/apps/details?[package]"));
if (MyStartActivity(intent) == false) {
//Well if this also fails, we have run out of options, inform the user.
Toast.makeText(this, "Could not open Android market, please install the market app.", Toast.LENGTH_SHORT).show();
}
}
【讨论】: