Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Highlighted
Contributor
Posts: 25
Registered: ‎04-16-2010
My Device: Not Specified

Invoke App World from third party app

Hi,

 

I would like to have a button in my application that on click, it opens the Blackberry App World storefront on my application's page in order to give the possibility to the user to rate it.

 

Is it also possible to make it work on Simulator on it is only on device?

Thank you.

Developer
Developer
Posts: 1,123
Registered: ‎02-10-2009
My Device: 8130 / 8350 / 9530 / 9550 / 9850 / PlayBook
My Carrier: Verizon
Contributor
Posts: 25
Registered: ‎04-16-2010
My Device: Not Specified

Re: Invoke App World from third party app

[ Edited ]

I just did this for now:

 

rateAppButton.setChangeListener(new FieldChangeListener() {
            public void fieldChanged(Field field, int context) {
            	// Action when button clicked
            	try {
            		int modHandle = CodeModuleManager.getModuleHandle("net_rim_bb_appworld");
                	ApplicationDescriptor[] apDes = CodeModuleManager.getApplicationDescriptors(modHandle);
					ApplicationManager.getApplicationManager().runApplication(apDes[0]);
				} catch (ApplicationManagerException e) {
					// TODO Auto-generated catch block
					Dialog.alert("Problem opening App World: " + e.getMessage());
				}
            }
        });

It is working, but only starting the App World, not going straight on my application page.

 

I have seen your links before, and try the one "Interface...". It was not working, I had a problem with the registry and the class I gave it.

 

Instead of using:

Registry registry = Registry.getRegistry( SampleApplication.class.getName() );

 

I am using:

Registry registry = Registry.getRegistry( UiApplication.class.getName() );

And I have an error about the classname not found in the package...

Developer
Developer
Posts: 1,123
Registered: ‎02-10-2009
My Device: 8130 / 8350 / 9530 / 9550 / 9850 / PlayBook
My Carrier: Verizon

Re: Invoke App World from third party app

I don't know if it would make a difference but you may want to get the current UiApplication instance. I would check to make sure the way you have it coded does not return UiApplication as the class name.

Contributor
Posts: 25
Registered: ‎04-16-2010
My Device: Not Specified

Re: Invoke App World from third party app

[ Edited ]

I tried putting:

 

Registry registry = Registry.getRegistry( "com.mycompany.blackberry.MyMainClass" );

 

And I have an Exception "Error code 7"... The App World is launching but not displaying my App page...

 

I have used these links:

http://supportforums.blackberry.com/t5/Java-Development/Problem-invoking-media-application/m-p/14166...

http://www.blackberry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800332/800429/Support...

Contributor
Posts: 25
Registered: ‎04-16-2010
My Device: Not Specified

Re: Invoke App World from third party app

[ Edited ]

I found where the problem come from:

 

// If you are targeting 4.3+, use this:
CodeModuleGroup group = CodeModuleGroupManager.load( myAppName );
                
// Pull out the App World data from the CodeModuleGroup
String myContentId = group == null ? "" : group.getProperty( RIM_APP_WORLD_ID );
                
// Code for the non-free app
myContentId = "0000";

 

 

So instead of "0000" I put the code of my application I found thanks to the URL on the webpage, and it is working great.

 

The problem is my myContentId is empty because groupe is null I does not load properly my app in order to get the code. What is exactly the String param to put in the CodeModuleGroupManager.load( String name) function? The module name or the application name?

 

Thank you!

Developer
Posts: 84
Registered: ‎01-10-2013
My Device: Bold 9900
My Carrier: China Unicom

Re: Invoke App World from third party app

hi dachmt, is there any news?