4

This might be a easy question but i couldn't find solution. I want to open AppWorld by clicking a button in my BB application. For example when user clicks this button Appworld will show "Facebook Application" page. Can i do this?

In Android platform this line launches GooglePlay for Facebook App. Does BlackBerry supports this kind of method?

startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=com.facebook.katana")));
KAPLANDROID
  • 1,099
  • 1
  • 12
  • 23
  • I think this could be interesting for you: http://supportforums.blackberry.com/t5/Java-Development/Programatically-invoking-App-World-client/td-p/710767 – Vit Khudenko Oct 01 '12 at 19:16

2 Answers2

6

Here is a simple way to do this:

Browser.getDefaultSession().displayPage("http://appworld.blackberry.com/webstore/content/2360/?lang=en");

Above code will invoke the browser in the application and open the BlackBerry App World, I tested it in device and it's perfectly working. For now I put a Whats App messenger link, but you can customize the link according to your requirement.

Rupak
  • 3,674
  • 15
  • 23
AK Joshi
  • 877
  • 6
  • 20
  • The only down side of this is that when the user clicks on a app link it will open the browser and redirects to the link provided, and if the user presses back it will then take the user back to the browser and then presses back again to go back to the application. is there a way to bypass that? – N Jay Jul 15 '13 at 11:20
  • Hi, I'm porting an android app to BB and getting problem while redirecting to appworld from the application. So ,I used this code but I'm getting error `Browser cannot be resolved`. So, I import `android.provider.browser`, but then it's saying `The method getDefaultSession() is undefined in Browser`. Pls help. – Sahil Mittal Sep 05 '13 at 07:55
5

You can open App World from your BB application directly using the following code. This code avoids opening the browser first.

Registry registry = Registry.getRegistry(this.getClass().getName());
Invocation invocation = new Invocation(null, null, 
                                       "net.rim.bb.appworld.Content", 
                                       false, ContentHandler.ACTION_OPEN);
invocation.setArgs(new String[] { /* app id in appworld */ });
registry.invoke(invocation);
Nate
  • 31,017
  • 13
  • 83
  • 207
rfsk2010
  • 8,571
  • 4
  • 32
  • 46