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
Developer
rab
Posts: 283
Registered: ‎07-22-2008
My Device: Not Specified
Accepted Solution

How to detect BES/MDS

I have been using the coverageInfo class to check if I have MDS so that I put the right parameter in the http connection request as follows:

 

 int coverage = CoverageInfo.getCoverageStatus(CoverageInfo.COVERAGE_MDS,false);
 if((coverage & 0x02) == CoverageInfo.COVERAGE_MDS )

   _MDS_ON = true;

 

But I have noticed that the function:

 

   int allcoverages = CoverageInfo.getCoverageStatus();

sometimes returns different status. ( allcoverage returns 7  while coverage returns 5) 

 

First question: is this the efficient/best way to test if the phone is BES enabled with MDS?

Second question: Why is there a discrepency between the two APIs?

 

Thanks

BlackBerry Development Advisor
MSohm
Posts: 14,752
Registered: ‎07-09-2008
My Device: BlackBerry Passport

Re: How to detect BES/MDS

As a starting point, I recommend having a look at this thread and the code samples within it:

 

http://supportforums.blackberry.com/rim/board/message?board.id=java_dev&message.id=898&query.id=3725...

 

Can you elaborate on this further:

 


rab wrote:

 

   int allcoverages = CoverageInfo.getCoverageStatus();

sometimes returns different status. ( allcoverage returns 7  while coverage returns 5) 

 


 

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
Developer
rab
Posts: 283
Registered: ‎07-22-2008
My Device: Not Specified

Re: How to detect BES/MDS

According to the documentation ( and my understanding)

 

 CoverageInfo.getCoverageStatus(CoverageInfo.COVERAGE_MDS,false) returns 7 which means there is MDS coverage

while

 CoverageInfo.getCoverageStatus(); returns 5 which means there is no MDS coverage.

 

So the 2 getCoverageStatus() are reporting conflicting results.

 

Thanks

BlackBerry Development Advisor
MSohm
Posts: 14,752
Registered: ‎07-09-2008
My Device: BlackBerry Passport

Re: How to detect BES/MDS

the getCoverageStatus(int, boolean) method accepts the RadioInfo.WAF* constants, not the constants from CoverageInfo..  This allows you to check for coverage over a specific network route.
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
Developer
rab
Posts: 283
Registered: ‎07-22-2008
My Device: Not Specified

Re: How to detect BES/MDS

Thanks for the clarification.

 

Can I rely on CoverageInfo.getCoverageStatus() result alone to confirm that there is MDS or

should I check also the serviceBooks ( findRecordsByCid("IPPP") and  encryptionMode == ServiceRecord.ENCRYPT_RIM) ?

 

or just the later.

 

Thanks

 

BlackBerry Development Advisor
MSohm
Posts: 14,752
Registered: ‎07-09-2008
My Device: BlackBerry Passport

Re: How to detect BES/MDS

CoverageInfo can be used to determine if the BlackBerry is able to make a connection through the MDS Connection Service at a given time.

 

It does not indicate that the user potentially has the ability to do so.

 

So it depends on what type of check you want to do.

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
Developer
rab
Posts: 283
Registered: ‎07-22-2008
My Device: Not Specified

Re: How to detect BES/MDS

The check I am making is to find out if the phone is BES enabled, and hence can use MDS service.

If so, I append the "deviceid=false" to the http url to force the connection to use MDS service.

 

Thanks

BlackBerry Development Advisor
MSohm
Posts: 14,752
Registered: ‎07-09-2008
My Device: BlackBerry Passport

Re: How to detect BES/MDS

CoverageInfo will let you know if the user is able to connect through MDS at that given time.

 

If you want to see if they have the potential to connect through MDS, you can look at the service records in the service book to see if they have the Desktop IPPP service book.

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