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
New Developer
Posts: 8
Registered: ‎10-30-2008
My Device: Not Specified

From BB Browser, how to launch my application when a custom mime type is encountered

Say a user is browsing a web site and at some point clicks on a link which downloads a file (with a custom Mime type sent by the web server). At this point, I want to launch my application (and automatically exit the browser) which will consume the file and the user will then start using my application. I have seen examples of providing custom renderers for user defined mime types, but the data I have is not meant for rendering - I want to launch my own application.

 

This is somewhat like launching Acrobat when on mime type of application/pdf.

 

How would I register my application with the BB browser so that the application is launched when the browsre encounters a cutom mime type.

 

Thanks

BlackBerry Development Advisor
Posts: 15,753
Registered: ‎07-09-2008
My Device: BlackBerry PRIV
My Carrier: Bell

Re: From BB Browser, how to launch my application when a custom mime type is encountered

You can create a custom Java application that uses the JSR 211 Content Handler APIs to register a specific file and mime type.  When a user opens a file of this type in the BlackBerry Browser they should be prompted to download the file and open it within your application.

 

Please have a look at the chapidemo included with the BlackBerry JDE for an example on the use of these APIs.  However, note that you are not able to override support for types already supported by the browser.

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
New Developer
Posts: 8
Registered: ‎10-30-2008
My Device: Not Specified

Re: From BB Browser, how to launch my application when a custom mime type is encountered

I did look at the chapi demo. I modified it to register the mime type "application/teams-mobile". I configured my web-server to send the correct mime type for the extension ".tmsz" (I verified that the web server is sending in the correct mime type). When I download a file of this type, the browser is prompting me to save the file - it does not ask me to open it in the application (chapi) which is registered to handle that mime type.
BlackBerry Development Advisor
Posts: 15,753
Registered: ‎07-09-2008
My Device: BlackBerry PRIV
My Carrier: Bell

Re: From BB Browser, how to launch my application when a custom mime type is encountered

What BlackBerry model and handheld software version are you testing with?  You can find this under Options, About on the BlackBerry handheld.
Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Highlighted
New Developer
Posts: 8
Registered: ‎10-30-2008
My Device: Not Specified

Re: From BB Browser, how to launch my application when a custom mime type is encountered

This is with the BB emulator 9000, included with JDE 4.6.0.
Retired
Posts: 179
Registered: ‎07-14-2008
My Device: Not Specified

Re: From BB Browser, how to launch my application when a custom mime type is encountered

There are some sublte nuances to the behavior here that you need to better understand with the CHAPI integration in the browser.  Unlike the email application, the browser will not prompt the user when they select "Get Link" if they want to view the attachment using the attachment handler (in BES or BIS) or download the file to use the native attachment handler (CHAPI).

 

As such, if the user selects "Get Link" it will always use the attachment handler and there is no clean way for your application to handle that attachment data.  If the user wants to leverage the native attachment handlers on the device they will need to select "Download Attachment" from the menu.

 

Mike Kirkup
Director, Developer Relations
Developer
Posts: 77
Registered: ‎11-20-2008
My Device: Not Specified

Re: From BB Browser, how to launch my application when a custom mime type is encountered

I just found a page that has a custom extension of bbaw (BlackBerry App World), that when clicked, opens the BlackBerry App World application automatically without downloading.  

 

http://mobile.blackberry.com/MBC/homepage?book=facebook_overview&helpdocdetail=/resources/static/fac...

 

Is the bbaw extension handling an example of CHAPI?  If it is, according to Mike's response, it would require the user to download the file before opening it up, which is doesn't.  Is it a special extension?

Developer
Posts: 16,999
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: From BB Browser, how to launch my application when a custom mime type is encountered

every file that is opened is downloaded. maybe you just get no notification about it.
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Developer
Posts: 77
Registered: ‎11-20-2008
My Device: Not Specified

Re: From BB Browser, how to launch my application when a custom mime type is encountered

The download of the file may be occuring and I may just not be able to find it.  However, the result is that BlackBerry App World is invoked automatically without any additional input from the user.  According to Mike's response, it would be required to be saved, and then opened separately.  There seems to be a disconnect, am I missing anything?
Developer
Posts: 241
Registered: ‎11-20-2008
My Device: Not Specified

Re: From BB Browser, how to launch my application when a custom mime type is encountered

[ Edited ]

I am trying to answer a similar question.

 

Is it possible to tell user to go to a link in the browser, or click a link in an email or sms such as 

 

http://myserver.com/1234.abcde

 

so that this will result in the launch of my application which has registered to handle .abcde MIME type?

 

 

 

Message Edited by cagdasgerede on 06-30-2009 05:35 PM
Message Edited by cagdasgerede on 06-30-2009 05:36 PM
Message Edited by cagdasgerede on 06-30-2009 05:36 PM