BlackBerry smartphones support many different transports that facilitate reliable data communication between third-party applications and the Internet. The transports available are direct Transmission Control Protocol (TCP), BlackBerry® Mobile Data System (BlackBerry MDS), BlackBerry® Internet Service Browsing (BIS-B
), BlackBerry® Unite!™ software, Wireless Access Protocol (WAP)1.0, WAP2.0 and Wi-Fi® technology. It is important to understand the differences between these transports and how and when to leverage each transport. It is also crucial to determine if a transport is available for use before trying to use it. The Network Diagnostic Tool is essentially a role model that answers all these questions and is a functional diagnostic tool for testing a URL over various transports supported by the BlackBerry solutions, as well as for displaying the values of many network attributes during the test period.
This article refers to the source code of the Network Diagnostic Tool, which can be downloadedhere.
To better understand how each transport works, see the video Network Transports found onblackberrydeveloper.com.
Determining transport availability
The first step to determining the availability of a transport is to check if the ServiceRecord
for that transport is available. This can be done programmatically as follows:
- Get the
ServiceBook
instance by calling the static method ServiceBook.getSB()
.
- Get the
ServiceRecords
from the ServiceBook
by calling the instance methodServiceBook.getRecords()
.
- Iterate through each
ServiceRecord
and determine if it is for the transport you are looking for.
This is demonstrated in the Network Diagnostic Tool'sIOThread.initializeTransportAvailability()
.
The next step is to determine if the BlackBerry smartphone has network coverage to communicate through the transport. This can be accomplished by calling the application programming interface (API) CoverageInfo.isCoverageSufficient(int coverageType)
.
Refer to the method IOThread.initializeTransportAvailability()
for a sample implementation of this.
Creating connections
Developer knowledge base article DB-00396 illustrates how to create an Hypertext Transfer Protocol (HTTP) or socket connection.
The IOThread.get*URL()
methods in the source code shows how to construct URLs for each transport.
Once you have the URL you need, you can create an HTTPConnection
instance using theConnector.open(String url)
static method and start communicating with that URL. See theIOThread.do*()
methods in the Network Diagnostic Tool source code to see a detailed implementation of this.
Note: The BIS-B
transport is available only to partners of the BlackBerry Alliance Program, and therefore is not implemented in the attached source code of the Network Diagnostic Tool. For more information on the BlackBerry Alliance Program, visithttp://na.blackberry.com/eng/partners/why_join.jsp.
Displaying network and radio information
Besides testing the different transports for a given URL, the Network Diagnostic Tool also displays network and radio information such as signal level, network name and type, and available network services. Refer to the method ReportScreen.displayNetworkInfo()
in the Network Diagnostic Tool source code for more information on how to display this information.
RadioStatusListener
It is also possible for an application to listen for changes in the radio such as signal level and available network services. To accomplish this, you must implement the interfaceRadioStatusListener
. The Network Diagnostic Tool implements this interface in the class namedIOThread
.
Automatically detecting wireless service providers
It is very useful to be able to detect wireless service providers, especially for applications using the Direct TCP transport for BlackBerry smartphones that operate using Global System for Mobile communications® (GSM®). For these BlackBerry smartphones, correct access point name (APN) information must be specified by the BlackBerry smartphone user before any application can leverage the Direct TCP transport.
APN information can also be set programmatically, which is demonstrated in the referenced Network Diagnostic Tool source code. The details are also explained in DB-00532. If the current wireless service provider for the BlackBerry smartphone can be determined, then the APN information can be set up programmatically from the application. This improves the BlackBerry smartphone user's experience because the APN does not need to be specified manually. To detect the wireless service provider, use a table that contains the name, mobile country code (MCC), mobile network code (MNC) and the APN details of each wireless service provider. Compare the MCC and MNC values returned by the BlackBerry smartphone against the values in the table. Once a match is found, set the corresponding APN information programmatically. For more information on how to read the MCC and MNC values from the BlackBerry smartphone, see DB-00688.
The complete process to automatically detect wireless service providers is also demonstrated by the Network Diagnostic Tool. The Network Diagnostic Tool stores the wireless service provider table in an Extensible Markup Language (XML) file that can be downloaded from here. This file must be stored on the BlackBerry smartphone in the following location:file:///store/netdiag/carrier_info.xml
unless this path is changed in the source code. You can add details for as many wireless service providers as you want to the XML file.
Changes required for earlier versions of the BlackBerry Java Development Environment
Although this article is targeted for BlackBerry® Java® Development Environment (BlackBerry JDE) 4.5 or later, the source code of the Network Diagnostic Tool can be easily modified and compiled using earlier versions of the BlackBerry JDE. Consider the following changes:
- Before BlackBerry JDE 4.3,
RadioStatusListener
had an additional method namedmobilityManagementEvent(int eventCode, int cause)
. This method must be implemented if you are using BlackBerry JDE 4.2 or earlier.
-
CoverageInfo.COVERAGE_DIRECT
is not supported until BlackBerry JDE 4.5. For BlackBerry JDE 4.3 or earlier, use CoverageInfo.COVERAGE_CARRIER
.
-
WLANInfo
class is not available until BlackBerry JDE 4.5. For BlackBerry JDE 4.3 or earlier, use the following logic:
if(CoverageInfo.isCoverageSufficient(CoverageInfo.COVERAGE_CARRIER,RadioInfo.WAF_WLAN, false)){
coverageWiFi = true;
wifiLog.addlog("Coverage Status: Online");
}
-
RadioInfo.NETWORK_SERVICE_GAN
is not supported in BlackBerry JDE 4.2.1 or earlier. Remove any references to this constant for those versions of the BlackBerry JDE.
-
RadioInfo.NETWORK_SERVICE_EVDO_ONLY
and RadioInfo.NETWORK_SERVICE_UMTS
are not supported in BlackBerry JDE 4.2.1 or earlier. Remove any references to these constants for those versions of the BlackBerry JDE.
- The
CoverageInfo
class is introduced in BlackBerry JDE 4.2.0. Remove any references to this class if you are using an earlier version of the BlackBerry JDE to compile this application. However, it is possible to do the following in versions of the BlackBerry JDE earlier than 4.2.0:
-
if(RadioInfo.getSignalLevel() != RadioInfo.LEVEL_NO_COVERAGE)
the BlackBerry smartphone has radio signal.
-
if(RadioInfo.getNetworkService() & RadioInfo.NETWORK_SERVICE_DATA)>0
the BlackBerry smartphone has data connectivity.
相关推荐
在信息技术领域,设备的调试与维护是不可或缺的一环,而台湾TSC公司推出的“Diagnostic Tool”工具正是为了解决这一问题而设计的。这款专业软件专为条码机的使用者提供了强大的诊断和配置功能,帮助用户更高效地理解...
Diagnostic Tool是一款简单好用的打印机设置工具,该软件是专门针对TSC型号的条码打印机精心设计的,目前分为四种功能分别是打印机设定、档案管理、点阵字工具、通讯工具,在这四项功能中,最实用的功能是打印机设定...
Diagnostic Tool是一款简单好用的打印机设置工具,该软件是专门针对TSC型号的条码打印机精心设计的,目前分为四种功能分别是打印机设定、档案管理、点阵字工具、通讯工具,在这四项功能中,最实用的功能是打印机设定...
本文档是关于SAE J1939-13-2016 Off-Board Diagnostic Connector的详细介绍,涵盖了其定义、rationale、foreword、 communications network、physical layer aspects、应用场景等方面的知识点。 定义 SAE J1939-13...
《Debug Diagnostic Tool v2 Update 3.1:深入解析与应用》 Debug Diagnostic Tool(调试诊断工具)是一款由微软开发的强大故障排查工具,主要用于解决Windows系统中的崩溃、挂起和性能问题。在“Debug Diagnostic ...
ODX(Open Diagnostic Data Exchange)是一种开放式的诊断数据格式标准,用于描述与诊断相关的ECU数据。 PDX(Packaged ODX)格式允许将多个ODX文件压缩到一个存档中(例如ZIP文件)。 压缩包包含3个文件: ISO 22901-...
182-ISO 14229-1-2013 Road vehicles -- Unified diagnostic services (UDS) --...188-ISO 14229-7 2015 Road vehicles -- Unified diagnostic services (UDS) -- Part 7 UDS on local interconnect network (UDSonLIN)
CANoe.DiVa_ Fully-automated diagnostic validation.mp4
1、ISO14229-2013 中文版 2、182-ISO 14229-1-2013 Road vehicles -- ...8、188-ISO 14229-7 2015 Road vehicles -- Unified diagnostic services (UDS) -- Part 7 UDS on local interconnect network (UDSonLIN)
2. **SDN(System Diagnostic Network)**:SDN可能指的是系统诊断网络,这是AB PLC中的一种功能,用于提供实时的设备健康状况信息。它帮助工程师识别潜在的故障,提前进行维护,从而避免生产中断。 3. **...
这个名为“CANoe.DiVa_ Fully-automated diagnostic validation”的压缩包文件,显然是一个包含详细教程或演示的资源,可能是一个视频文件(CANoe.DiVa_ Fully-automated diagnostic validation.mp4),用于指导用户...
你查看CD-R、CD-RW以及DVD光盘中的文件结构完整性与信息显示。对于读取不顺畅的CD-RW它也可以恢复资料的完整。支援ATAPI/IDE与SCSI界面。 注:此软件为多语言版,如发现安装简体中文版不能正常运行,请卸载后重新...
该标准是“Diagnostic communication over Controller Area Network (DoCAN)”系列的一部分,主要关注的是数据传输协议和网络层服务。 诊断通信在现代汽车行业中扮演着至关重要的角色,因为它允许对车辆的电子控制...
COBIT 2019-Management-Awareness-Diagnostic-v1.0.xls
Fujitsu ATA Diagnostic Tool(简称FJDT)是富士通公司开发的一款磁盘检测软件,其主要功能是让用户以最快的速度全面清晰了解硬盘是否运转正常。 FJDT的检测内容包括两部分: 1.通过检测S.M.A.R.T数据来检验硬盘...
J1939协议是汽车行业广泛使用的CAN(Controller Area Network)总线协议的一个变体,主要用于重型卡车、客车、工程车辆等。它定义了数据通信、报文传输、网络管理等多个方面的细节,旨在提高车辆的可互操作性和诊断...
“车载诊断系统(On-Board Diagnostic)” 数据采集,采用C++编写技术模块 LibEvent封装、log模块、线程CThread的封装、锁模块 “车载诊断系统(On-Board Diagnostic)” 数据采集,采用C++编写技术模块 LibEvent...
在"芯烨打印机设置工具Diagnostic Tool V1.017b"中,"V1.017b"可能表示这是该工具的版本号,通常软件开发者会定期发布更新来修复已知问题、增加新特性或提高性能。对于用户而言,保持软件版本的最新状态是确保兼容性...