【发布时间】:2010-12-17 03:00:45
【问题描述】:
在尝试确定是否支持特定连接时,我对 CoverageInfo.getCoverageStatus() 和 CoverageInfo.isCoverageSufficient() 之间的区别感到困惑。例如:
// check mds with getCoverageStatus() and bitwise check
boolean hasMdsCoverage1 = (CoverageInfo.getCoverageStatus() & CoverageInfo.COVERAGE_MDS) == CoverageInfo.COVERAGE_MDS;
// check mds with isCoverageSufficient()
boolean hasMdsCoverage2 = CoverageInfo.isCoverageSufficient(CoverageInfo.COVERAGE_MDS);
hasMdsCoverage1 和 hasMdsCoverage2 似乎都返回相同的结果,但为什么会有两种不同的方法呢?是否有过它们会返回不同结果的情况?
理想情况下,我想使用 CoverageInfo.isCoverageSufficent(),因为这在代码中看起来更简洁,但在我这样做之前,我想确保我不会错过任何 getCoverageStatus() 会提供。
注意:我使用它来检查通过 BIS、MDS、WAP 和 WAP2 协议的有效连接。
【问题讨论】:
标签: http blackberry connection connection-string httpconnection