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: 26
Registered: ‎07-13-2009
My Device: Not Specified

browsercontentmanager problem on storm/curve actual device with local content

I'm using a Verizon Storm (and now a Curve as well), and I have downloaded the appropriate simulators

Everything works like a dream on the simulators; I use ksoap to connect up and download the html content to be stored locally, and then invoke my own httpconnectionwrapper to pass the local content to the browsercontentmanager and the html renders fine.

However, on the device it does not render; it steps through the same code and looks to me like it should render but nothing happens.

When stepping through the code in the thread that sets the browsercontent manager's content I see it try to set the content, throw no errors but afterwards when doing a watch on the browsercontentmanager's browsercontent it is always null.  I can see the html in the buffer of the connection, for some reason it is not getting set.

try {
synchronized (Application.getEventLock())
{
fs._browserContentManager.setContent(connection, this, e);
System.out.println("The content of the web page has been set.");
}

} catch(Exception ex) {
System.out.println("problem setting the content of the web page!");
} finally {
SecondaryResourceFetchThread.doneAddingImages();
}

No errors are thrown.

I've wiped the blackberry Storm completely clean, restored to a vanilla verizon storm 4.7.0.148 os, and still when i set the browsercontent it is null.  I then went out and purchased a Curve and I've had the same experience.  The wierd thing is it works perfectly on my 2 year old pearl.  

 

And again, it works perfectly on the simulators.

 

Anyone have any ideas?  Anyone at RIM care to chime in?

New Developer
Posts: 26
Registered: ‎07-13-2009
My Device: Not Specified

Re: browsercontentmanager problem on storm/curve actual device with local content

Hasn't someone else used a browsercontentmanager object to display local html instead of a remote URL? 

 

Anyone at RIM care to chime in as to why this works on the simulators but not on the devices?  This is a major blocking problem for my company.

Highlighted
Developer
Posts: 905
Registered: ‎02-07-2009
My Device: BlackBerry Torch 9800
My Carrier: Globe Telecom

Re: browsercontentmanager problem on storm/curve actual device with local content

try invoking browserContent.finishLoading(); after you set the content.
New Developer
Posts: 26
Registered: ‎07-13-2009
My Device: Not Specified

Re: browsercontentmanager problem on storm/curve actual device with local content

I just checked and I don't see a finishLoading() method in the browsercontentmanager object, and the browsercontent property of it is only available when debugging as a watch; it's not an object you can act on. 

 

Can you please be more specific?  I really appreciate the help.

New Developer
Posts: 26
Registered: ‎07-13-2009
My Device: Not Specified

Re: browsercontentmanager problem on storm/curve actual device with local content

Stupid me, I found it:

 

                 fs._browserContentManager.setContent(connection, this, e);
                RenderingSession rs = fs._browserContentManager.getRenderingSession();
                BrowserContent bc = rs.getBrowserContent(connection, this, e);
                bc.finishLoading();

 

I'll try it out and post the results.

New Developer
Posts: 26
Registered: ‎07-13-2009
My Device: Not Specified

Re: browsercontentmanager problem on storm/curve actual device with local content

This ends up throwing an IOException in connection error.

 

I think this is because the setContent() method of browsercontentmanager actually is supposed to do all the work including the call to its browsercontent.finishLoading()

 

So, any other ideas?  I'm completely stuck here.  Anyone at RIM have any ideas why this works on every simulator but so far not on the curve or storm?

Developer
Posts: 4,764
Registered: ‎07-21-2008
My Device: Not Specified

Re: browsercontentmanager problem on storm/curve actual device with local content

"Works on simulator" != "works on device", especially when it comes to connections.

 

The simulator uses MDS-CS to simulator a device connected to a BES network. On the device, the network connection options must be detected, and the specific connection type requested using connection parameters attached to your URL. These parameters will vary depending on the type of connection and the carrier.

You can get a bunch of info on this subject by reading Peter's "Connections" sticky thread at the top of this forum.

 

 

 

 

 

 

 

New Developer
Posts: 26
Registered: ‎07-13-2009
My Device: Not Specified

Re: browsercontentmanager problem on storm/curve actual device with local content

The connectivity is fine.  My ksoap webservices call is working great, I can see it download the xml and properly grab the HTML from the result. 

 

My problem is not a connectivity problem.   To be absolutely clear again, I am wrapping the httpconnection object in order to load LOCAL content into my browsercontentmanager.    My httpconnection is not connecting to any external url, I am fudging the url and passing in my own inputstream of html.

 

In fact, I can probably write an article about how to do all these things that everyone seems to have trouble doing including navigating the complexity of connections on the device on various carriers, ksoap, and even using a browsercontentmanager object to load local content in, if i can get over this hurdle.

 

 

New Developer
Posts: 26
Registered: ‎07-13-2009
My Device: Not Specified

Re: browsercontentmanager problem on storm/curve actual device with local content

I beg anyone who has used a browsercontentmanager to display local html and seen it work on an actual device to help.  I'll gladly pay for a solution.
Developer
Posts: 905
Registered: ‎02-07-2009
My Device: BlackBerry Torch 9800
My Carrier: Globe Telecom

Re: browsercontentmanager problem on storm/curve actual device with local content