Blackberry webview can not connect to internet and

2019-03-01 07:02发布

问题:

I am creating a simple app using Eclipse and Blackberry JRE 7.0 as per the example given at: http://docs.blackberry.com/en/developers/deliverables/11958/Configure_a_browser_field_825671_11.jsp

I am trying to load a simple HTML page hosted on a remote server inside browser field in the app.

When running the app on 9930 Simulator I always get the error 'Local connection timeout after 120000 on simulator'. The same remote page shows up fine on the web browser of the same simulator..

I am making sure to start the MDS simulator.

The same link shows up fine in simulator browser. Its only when using browserfield, I am having the problem.

I get the folling error when clicking the icon to launch the app:

Error displaying content for: http://yahoo.com
Error message: java.lang.runtimeException:ApplicationRegistry:wai​tFor
(0xd0fe7d7338fourd7f0d) timeout
....

On waiting further I get the 'Local connection timeout error..

I know that in Android one has to enable internet connection when using the webview in the manifest file - is there any similar setting one has to do in blackberry?

回答1:

I tried to run the BrowserField demo app on 9930 (JRE 7.0.0) and encounter the same issues as you did. On the other hand, the demo worked fine on 9800 (JRE 6.0.0). I tried again on 9930 and noticed that though I definitely enabled MDS (enabled the 'Launch Mobile Data System Connection Service (MDS-CS) with simulator' in the Run/Debug Configurations in Eclipse), the MDS window didn't appear which seemed very strange.

I googled a little and found this post on BlackBerry's forums. According to this post:

An incorrect version of MDS-CS simulator was included in 7.0. To correct it you can delete it and copy the version from 6.0.

Well done, RIM!

Then, I deleted the MDS folder from JRE 7.0.0 and copied the one from JRE 6.0.0 as described in the aforementioned post. Closed and rerun simulator and voilà, the MDS window appeared. Rerun application, and everything worked like a charm!