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
BB_shi
Posts: 91
Registered: ‎03-15-2011
My Device: Blackberry 9800

How to get that SIM is BIS enabled or not

Hi,

 

I searched but didn't find any API to get that SIM is BIS enabled or not.

Is there any way?

 

I want to send a server request when data services and mobile network are available(programmatically )on a button click. There is some delay in network switching. Will it be handled by thread with a condition?

 

Please suggest.

 

Developer
developer_aman_arora
Posts: 354
Registered: ‎06-05-2013
My Device: Blackberry Z10

Re: How to get that SIM is BIS enabled or not

Use This:

 

if (CoverageInfo.isCoverageSufficient(CoverageInfo.COVERAGE_BIS_B)) 
{
System.out.println("Network BIS");
}
else
{
System.out.println("Error: Not a BIS");
}

 

Developer
peter_strange
Posts: 19,610
Registered: ‎07-14-2008
My Device: Not Specified

Re: How to get that SIM is BIS enabled or not

The code provided by developer_aman_arora will help you determine if the BIS Service is active.  It does not actually determine if the device should have a BIS Service,  To do this you can review the Service records.  The code in this KB article does this to determine if the default Browser will be the BIS browser or not.  I don't think this approach (selecting the Browser) is applicable any more but I think the code in createBISBrowserSession() can be used to check if the device has a BIS Service Book and so should be BIS enabled.

 

To make sure the code doesn't disappear should a link change, I have cut/pasted the code below, but please refer to the original link in case it has been updated. 

 

http://supportforums.blackberry.com/t5/Java-Development/Invoke-the-browser/ta-p/445362

 

Code:

 

    /* 
     * BIS: This forces the browser to go through the RIM-hosted
     * BIS gateway to access the Internet. Use the BIS Browser
     * if...
     * - The BIS browser offers a consistent experience across all 
     * networks and does not limit which sites can be accessed, 
     * therefore it should be used whenever possible
     * - You MUST use the BIS Browser if you are taking the user 
     * to a web page where they may subscribe to special services 
     * that are only available using BIS, such as "Web Signals"
     *
     * @returns BIS BrowserSession
     */
    public static BrowserSession createBISBrowserSession()
    {
        // If there are browser services found - search for the
        // Service Record for the given browserType 
        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_BIS ) 
            {
                uid = myRecord.getUid();
                break;
            }
        }
        return null == uid ? null : Browser.getSession(uid);
    }

 

Developer
BB_shi
Posts: 91
Registered: ‎03-15-2011
My Device: Blackberry 9800

Re: How to get that SIM is BIS enabled or not

Thanks peter. I will try it.