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
Developer
Posts: 86
Registered: ‎09-01-2009
My Device: Not Specified

Lanching an app from my browser?

I'd like to know if it's possible to associate a protocol (for example: 'myapp') to a native application installed on a Blackberry  so that if a user types in 'myapp://xxx' in a web browser it calls the native application. In this case, how is it possible to achieve it ?

As far as I understood, it's possible to do it with iphone but I don't know if it's possible with blackberry?

 

 

 

 

Jitendra.Balla

Developer
Posts: 212
Registered: ‎07-18-2008
My Device: Storm 9550

Re: Lanching an app from my browser?

[ Edited ]

I think won't work for protocols.

 

You could use CHAPI (Content Handling API) for calling native applications. This is based on mime types.

 

There is an example in the JDE how to do it: "chapidemo" or search the API doc for javax.microedition.content"

If your problem was solved, please mark answer as "Accepted solution"
If your want to thank, click the "kudo" symbol
___________
visit me: http://mobilejavadevelopment.blogspot.com/
visit the Berlin BlackBerry Developer Group: http://berlinblackberrydevelopers.blogspot.com/
Developer
Posts: 86
Registered: ‎09-01-2009
My Device: Not Specified

Re: Lanching an app from my browser?

Thanks for quick reply,

Please send me the sample code for doing this task.

Developer
Posts: 212
Registered: ‎07-18-2008
My Device: Storm 9550

Re: Lanching an app from my browser?

As I said just check the CHAPI demo in the JDE:

 

Just copied the following from it, it opens a native app for a url (local file)

 

   
    /**
     * Creates an Invocation object and passes it to the Registry.
     * Called by 'Invoke' menu item.
     */
    private void doInvoke()
    {
        try
        {            
            // Create the Invocation with the hard-coded URL
            Invocation invoc = new Invocation(URL);
            invoc.setResponseRequired(false);  // We don't require a response
            
            // We want to invoke a handler that has registered with ACTION_OPEN
            invoc.setAction(ContentHandler.ACTION_OPEN);
            
            // Get access to the Registry and pass it the Invocation
            Registry registry = Registry.getRegistry(CLASSNAME);            
            registry.invoke(invoc);                
        }
        catch (IOException ioe)
        {                
            System.out.print(ioe.toString());                                
        }

 

 

 

 

Which application do you exaclty want to invoke?

If your problem was solved, please mark answer as "Accepted solution"
If your want to thank, click the "kudo" symbol
___________
visit me: http://mobilejavadevelopment.blogspot.com/
visit the Berlin BlackBerry Developer Group: http://berlinblackberrydevelopers.blogspot.com/