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
behrk2
Posts: 367
Registered: ‎11-25-2009
Accepted Solution

BrowserPlugin works on simulator, but device does not recognize mime type

Hi everyone,

 

Using the BrowserPlugin class in the JDE samples, I was able to register a custom mime type with my BlackBerry. When the browser redirects to a certain page with the mime type, the browser will recognize it and I use getBrowserContent() to move my application to the foreground, above the BlackBerry browser.

 

I have this working on the simulator, but on the device I receive the message: "The item you selected cannot be displayed. Do you wish to save the item?"

 

When I click "No", I receive the message: "Unsupported media type: application/x-vnd.rim.xxxtest"

 

Like I said before, this is working on the simulator. I have the mime type supported by the web server, and I created a Library project that will run on startup which will register the mime type with the device.

 

I have debugged on my actual device and confirmed that my Library project is in fact launching...

 

Does anyone know why this might work on the simulator but not on the device?

Please use plain text.
Developer
behrk2
Posts: 367
Registered: ‎11-25-2009

Re: BrowserPlugin works on simulator, but device does not recognize mime type

[ Edited ]

I want to make a correction to what I wrote above. It seems that my Library project (set to auto-run on startup and set as a project reference in for my main application) is not starting on my device, as it does on the simulator. When I run my application in the simulator, I receive the following:

 

 

ON THE SIMULATOR:

 

Starting Library
Started Library(126)
CONVERTER REGISTRY IS NOT NULL!

 

...And I do not see this when I run the debugger on my device.

 

Here is my code for my Library project, with the libMain() method:

 

 

import net.rim.device.api.browser.plugin.BrowserContentProviderRegistry;

final class LoaderApp {
public static void libMain(String[] args) {
BrowserContentProviderRegistry converterRegistry = BrowserContentProviderRegistry
.getInstance();
if (converterRegistry != null) {
System.out.println("CONVERTER REGISTRY IS NOT NULL!");
converterRegistry.register(new BrowserPlugin());
}else{
System.out.println("CONVERTER REGISTRY IS NULL!");
}

}

 

Any thoughts? Thanks!

 

Please use plain text.
Developer
behrk2
Posts: 367
Registered: ‎11-25-2009

Re: BrowserPlugin works on simulator, but device does not recognize mime type

Ah,

 

I am embarrassed. I had subconciously assumed that when I used Javaloader to load my application to my device that it would also include any referenced library projects....I was wrong!

 

I loaded the Library project separetely and it works just fine.

Please use plain text.