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: 140
Registered: ‎02-08-2010
My Device: Torch 9800, Storm 9530, Curve 8330
My Carrier: AT&T, Verizon

Invoke the Browser on OS 6

This article describes how to invoke the browser for BIS, BES, WAP, WiFi, or Default connections: http://supportforums.blackberry.com/t5/Java-Development/Invoke-the-browser/ta-p/445362

 

However, based on beta feedback, it's not working on OS 6.  Is there a different procedure on OS 6 to invoke the native browser to use a specific connection?

 

The BIS, BES, WAP options in the BrowserSessionFactory are not returning sessions, and the WiFi sometimes returns a session but trying to launch it results in a crash apparently in the browser itself:

 

 

Name: IllegalArgumentException
GUID: 9c3cd62e3320b498
Time: Oct 18, 2010 23:07:24
No detail message
net_rim_cldc-17(4C9A75E5)
BitmapBackground
draw
0x67C
net_rim_cldc-14(4C9A75E5)
ChoiceField$ChoiceBox
draw
0x6943
net_rim_cldc-14(4C9A75E5)
ChoiceField
paint
0x5A7A
net_rim_cldc-11(4C9A75E5)
Field
paintSelf
0x2102
net_rim_cldc-12(4C9A75E5)
Manager
paintChild
0x10E9
net_rim_cldc-12(4C9A75E5)
Manager
subpaint
0x1365
net_rim_cldc-12(4C9A75E5)
Manager
<private>
0x314E
net_rim_cldc-12(4C9A75E5)
Manager
paint
0x10CA
net_rim_cldc-11(4C9A75E5)
Field
paintSelf
0x2102
net_rim_cldc-12(4C9A75E5)
Manager
paintSelf
0x1107
net_rim_cldc-12(4C9A75E5)
Manager
paintChild
0x10E9
net_rim_cldc-17(4C9A75E5)
VerticalFieldManager
subpaint
0xC5D0
net_rim_cldc-12(4C9A75E5)
Manager
<private>
0x314E
net_rim_cldc-12(4C9A75E5)
Manager
paint
0x10CA
net_rim_cldc-11(4C9A75E5)
Field
paintSelf
0x2102
net_rim_cldc-12(4C9A75E5)
Manager
paintSelf
0x1107
net_rim_cldc-12(4C9A75E5)
Manager
paintChild
0x10E9
net_rim_cldc-12(4C9A75E5)
Manager
subpaint
0x1365
net_rim_cldc-12(4C9A75E5)
Manager
<private>
0x314E
net_rim_cldc-12(4C9A75E5)
Manager
paint
0x10CA
net_rim_cldc-11(4C9A75E5)
Field
paintSelf
0x2102
net_rim_cldc-12(4C9A75E5)
Manager
paintSelf
0x1107
net_rim_cldc-12(4C9A75E5)
Manager
paintChild
0x10E9
net_rim_cldc-17(4C9A75E5)
VerticalFieldManager
subpaint
0xC5D0
net_rim_cldc-12(4C9A75E5)
Manager
<private>
0x314E
net_rim_cldc-12(4C9A75E5)
Manager
paint
0x10CA
net_rim_cldc-11(4C9A75E5)
Field
paintSelf
0x2102
net_rim_cldc-12(4C9A75E5)
Manager
paintSelf
0x1107
net_rim_cldc-12(4C9A75E5)
Manager
paintChild
0x10E9
net_rim_cldc-12(4C9A75E5)
Manager
subpaint
0x1365
net_rim_cldc-12(4C9A75E5)
Manager
<private>
0x314E
net_rim_cldc-12(4C9A75E5)
Manager
paint
0x10CA
net_rim_cldc-11(4C9A75E5)
Field
paintSelf
0x2102
net_rim_cldc-12(4C9A75E5)
Manager
paintSelf
0x1107
net_rim_cldc-12(4C9A75E5)
Manager
paintChild
0x10E9
net_rim_cldc-12(4C9A75E5)
Screen
paint
0x9E9C
net_rim_cldc-11(4C9A75E5)
Field
paintSelf
0x2102
net_rim_cldc-12(4C9A75E5)
Manager
paintSelf
0x1107
net_rim_cldc-12(4C9A75E5)
Screen
doPaint0
0x77DC
net_rim_cldc-13(4C9A75E5)
UiEngineImpl
<private>
0x96F6
net_rim_cldc-13(4C9A75E5)
UiEngineImpl
doPainting
0x6547
net_rim_cldc-13(4C9A75E5)
UiEngineImpl
repaint
0x7C4B
net_rim_cldc-13(4C9A75E5)
UiEngineImpl
processMessage
0x77BC
net_rim_cldc-8(4C9A75E5)
Application
<private>
0x2944
net_rim_cldc-8(4C9A75E5)
Application
processNextMessage
0x1B2F
net_rim_cldc-8(4C9A75E5)
Application
enterEventDispatcher
0x1A6C
net_rim_bb_browser_daemon(4C9A7E0A)
BrowserLoader
main
0x8D0

 

 

 

Thank you

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

Re: Invoke the Browser on OS 6

I haven't been able to reproduce this.  Have you tried running the sample as is, using the same URL?  Do you see the same behaviour?  What BlackBerry device software version are you testing on?  You can find this under Options, About on the BlackBerry Smartphone.

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
Developer
Posts: 140
Registered: ‎02-08-2010
My Device: Torch 9800, Storm 9530, Curve 8330
My Carrier: AT&T, Verizon

Re: Invoke the Browser on OS 6

[ Edited ]

Hello Mark,

 

This is based on feedback from users, neither of my devices has WiFi or OS 6.

 

The app in question is UniBrowse, which tries to present all available browsers and BlackBerry Browser sessions to the user for selection.  Users with 6.0 report that it's showing BIS, BES, WAP, and WiFi all as unavailable, which occurs because it tried to create sessions for those using the BrowserSessionFactory and they all failed.  Any connection type that returns a valid session from the Factory shows as available.

 

My original post was slightly inaccurate, I mistook the WiFi launch error to be an issue under OS6, but that problem was actually on a T-Mobile 9700 with pre-release 5.0.0.979.  On that user's device, the correct connections did show as available.  Doing a BrowserSessionFactory.createWiFiBrowserSession().showBrowser() resulted in the exception, but user says after the error the browser does come up, and WAP is launching correctly.

 

Thank you!

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

Re: Invoke the Browser on OS 6

Can you find out if any of these users have any browsers blocked by an IT Policy setting on their BlackBerry Enterprise Server?  They'd need to speak to their BES Admin to confirm this.

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
Developer
Posts: 178
Registered: ‎11-19-2008
My Device: Not Specified

Re: Invoke the Browser on OS 6

I'm also being reported of errors opening WAP browser sessions on 6.0 devices (this one was a Torch using BIS).

The app works fine for OS versions lower than 6.0. My code is based on BrowserSessionFactory as well.

 

Developer
Posts: 140
Registered: ‎02-08-2010
My Device: Torch 9800, Storm 9530, Curve 8330
My Carrier: AT&T, Verizon

Re: Invoke the Browser on OS 6

Just to chime in an update, in 4 months of distribution including OS 6 there have been no more reports of errors from what I'm doing with it.

 

Developer
Posts: 178
Registered: ‎11-19-2008
My Device: Not Specified

Re: Invoke the Browser on OS 6

[ Edited ]

I've traced the error. My code for opening a WAP browser session is based on RIM's:

 

public static BrowserSession createWAPBrowserSession()
    {
        // If there are browser services found - search for the WAP2 
        // Service Record 
        String uid = null; 
        int numRecords = records.length;
        for( int i = 0; i < numRecords; i++ ) 
        {
            ServiceRecord myRecord = records[i];
            ServiceRecordHelper myRecordHelper = 
                new ServiceRecordHelper(myRecord);
            if( myRecord.isValid() && 
                !myRecord.isDisabled() &&
                (myRecordHelper.getConfigType() == 
                ServiceRecordHelper.SERVICE_RECORD_CONFIG_TYPE_WAP2) && 
                (myRecordHelper.getNavigationType() != -1)) 
            {
                uid = myRecord.getUid();
                break;
            }
        }
        // If there was no WAP2 Service Record found - search for the
        // WAP Record
        if (uid == null) 
        {
            for( int i = 0; i < numRecords; i++ ) 
            {
                ServiceRecord myRecord = records[i];
                ServiceRecordHelper myRecordHelper = 
                    new ServiceRecordHelper(myRecord);
                if( myRecord.isValid() && 
                    !myRecord.isDisabled() && 
                    (myRecordHelper.getConfigType() == 
                    ServiceRecordHelper.SERVICE_RECORD_CONFIG_TYPE_WAP) && 
                    (myRecordHelper.getNavigationType() != -1)) 
                {
                    uid = myRecord.getUid();
                    break;
                }
            }
        }
        return null == uid ? null : Browser.getSession(uid);
    }

 

 

This snippet shows how the ServiceRecord must satisfy 4 conditions in order to open a WAP browser session:

-Must be valid.

-Must not be disabled

-Its navigation type should not be -1

-ConfigType should be either WAP or WAP2.

 

So I've inspected the related ServiceRecord present on device, and it fails at the third point: navigationType is -1. According to the documentation, this "indicates whether or not the user can navigate to other web pages from within the browser instance". As the device OS is 6.0, it has the new WebKit browser, this is the only difference I find between 6.0 and prvious (working) versions.

 

This is the complete inspection of the ServiceRecord. It was the only WAP type ServiceRecord present on the device:

 

[5]: WAP BrowserConfig
   valid: true
   disabled: false
   encrypted: false
   invisible: false
   protected: false
   restored from backup: false
   restore enabled: false
   service is secure: false
   service is weakly secure: false
   TYPE: WAP2
   navigation type: -1
   uid: WAP BrowserConfig

 

What I'd like to know is if this is a carrier issue (Vodafone) or is happening to all 6.0 enabled devices. So if some guy from RIM can answer me I'd be very grateful.

 

 

New Contributor
Posts: 5
Registered: ‎01-27-2011
My Device: Not Specified

Re: Invoke the Browser on OS 6

Hi, 

 

Any clue about this issue ? I'm struggling with this, with no much more piece of info....

Trusted Contributor
Posts: 224
Registered: ‎08-11-2010
My Device: Not Specified

Re: Invoke the Browser on OS 6

Just for the record - it seems that there was a bug in the article: 

 

see this issue for more info:

 

http://supportforums.blackberry.com/t5/Java-Development/Invoking-WAP-browser-on-OS-7-via-BrowserSess...