Created
April 24, 2012 16:18
-
-
Save jaydeepw/2481134 to your computer and use it in GitHub Desktop.
Getting a connection string while making a network connection in BlackBerry.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Get most appropriate connection method | |
private String getConnectionString() { | |
String suffix = null; | |
if (CoverageInfo.isCoverageSufficient(CoverageInfo.COVERAGE_MDS)) | |
{ | |
// BES is available | |
suffix = ";deviceside=false"; | |
} | |
else if (CoverageInfo.isCoverageSufficient(CoverageInfo.COVERAGE_BIS_B)) | |
{ | |
// BIS is available | |
suffix = ";deviceside=false;ConnectionType=mds-public"; | |
} | |
else if (RadioInfo.areWAFsSupported(RadioInfo.WAF_WLAN) && | |
CoverageInfo.isCoverageSufficient(CoverageInfo.COVERAGE_DIRECT, RadioInfo.WAF_WLAN, false)) | |
{ | |
// wifi is available | |
suffix = ";deviceside=true;interface=wifi"; | |
} | |
else if (CoverageInfo.isCoverageSufficient(CoverageInfo.COVERAGE_DIRECT)) { | |
// attempt to use direct tcp connection | |
suffix = ";deviceside=true"; | |
} | |
return suffix; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment