Appworld market link in Android runtime

不打扰是莪最后的温柔 提交于 2019-12-12 09:11:30

问题


I have an app on the appworld and I would like to add a link to it in my app so that people can more easily rate it. Normally on the android market I would do something like:

Uri uri = Uri.parse("market://details?id=com.example.test");
Intent intent = new Intent(Intent.ACTION_VIEW, uri);
startActivity(intent);

Or on Amazon I would do:

Uri uri = Uri.parse("http://www.amazon.com/gp/mas/dl/android?p=com.example.test");
Intent intent = new Intent(Intent.ACTION_VIEW, uri);
startActivity(intent);

But when I try the following it does not work:

Uri uri = Uri.parse("appworld://content=000000");
Intent intent = new Intent(Intent.ACTION_VIEW, uri);
startActivity(intent);

It pops up a browser and then I get a message about not being able to do it or something. I also tried to launch to the appworld website page but appworld isn't grabbing it. What would be to correct way to handle this link?


回答1:


The normal market:// link should actually work.




回答2:


The normal market:// URI didn't work for me. The BlackBerry World app would always show the error:

There was a problem loading this Page due to a network error.

The fix was to detect when my app was running on a BlackBerry device then to use a different URI:

if (java.lang.System.getProperty("os.name").equals("qnx")){
    marketUri = "appworld://content/1234567"
} else {
    //normal Google Play URI
}

You can get your content ID from the BlackBerry World Vendor Portal by clicking on the 'edit' link next to your app. The ID is shown in the first field.



来源:https://stackoverflow.com/questions/13291002/appworld-market-link-in-android-runtime

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!