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
Posts: 70
Registered: ‎11-24-2009
My Device: Not Specified

How to check active network connection n Blackberry

Hi,

 

I am working on 8300 simulator (does not have Wi-Fi)

 

I want my application to check whether the phone as active network connection or not.

 

I tried to implement this and for testing I turned off the Wi-Fi of my laptop (to simulate no connection)

 

Following are the results with different approaches:

 

1. CoverageInfo.isOutOfCoverage() - returns false -> meaning we have the connection

2. RadioInfo.isDataServiceOperational - returns true

3. WLANInfo.getWLANState() - returns WLAN_STATE_DISCONNECTED for both network on or off

 

The approach that worked for me is when I try to open a HttpConnection with no internet connectivity , it returns Bad DNS Address and IO Exception.

 

I am not happy with this approach because of 2 reasons:

1. I will have to pass a URL - don't know what URL can be passed and this means that we are relying on the URL!!

2. I think there should be some API that can tell whether our phone (WiFi enabled or disabled both) is connected to internet or not.

 

Could anyone please help me with this?

 

Thanks,

Lovish

Developer
Posts: 66
Registered: ‎01-14-2010
My Device: 8700
My Carrier: Airtel

Re: How to check active network connection n Blackberry

Check if this helps for you

 

 

initializeTransportAvailability();
if (coverageTCP) {
doHTTPDirectTCP();
connected = true;
} if (!connected && srMDS != null && coverageMDS) {
doHTTPMDS();
/** MDS using HTTP */
connected = true;
} if (!connected && srUnite != null && coverageUnite) {
doHTTPUnite();
/** Unite using HTTP */
connected = true;
} if (!connected && srBIS != null && coverageBIS) {
doHTTPBIS();
/** BIS-B using HTTP */
connected = true;
} if (!connected && srWAP != null && coverageWAP) {
getWAPURL();
if (!wapParametersUnavailable) {
doHTTPWAP();
/** WAP1.0 usign HTTP */
connected = true;
}
} if (!connected && srWAP2 != null && coverageWAP2) {
doHTTPWAP2();
/** WAP2.0 using HTTP */
connected = true;
}

 

 

 

 

public void initializeTransportAvailability() {
ServiceBook sb = ServiceBook.getSB();
ServiceRecord[] records = sb.getRecords();

for (int i = 0; i < records.length; i++) {
ServiceRecord myRecord = records[i];
String cid, uid;

if (myRecord.isValid() && !myRecord.isDisabled()) {
cid = myRecord.getCid().toLowerCase();
uid = myRecord.getUid().toLowerCase();
// BIS
if (cid.indexOf("ippp") != -1 && uid.indexOf("gpmds") != -1) {
srBIS = myRecord;
}

// BES
if (cid.indexOf("ippp") != -1 && uid.indexOf("gpmds") == -1) {
srMDS = myRecord;
}
// WiFi
if (cid.indexOf("wptcp") != -1 && uid.indexOf("wifi") != -1) {
srWiFi = myRecord;
}
// Wap1.0
if (getConfigType(myRecord) == CONFIG_TYPE_WAP
&& cid.equalsIgnoreCase("wap")) {
srWAP = myRecord;
}
// Wap2.0
if (cid.indexOf("wptcp") != -1 && uid.indexOf("wifi") == -1
&& uid.indexOf("mms") == -1) {
srWAP2 = myRecord;
}
// Unite
if (getConfigType(myRecord) == CONFIG_TYPE_BES
&& myRecord.getName().equals(UNITE_NAME)) {
srUnite = myRecord;
}
}
}
if (CoverageInfo.isCoverageSufficient(CoverageInfo.COVERAGE_BIS_B)) {
coverageBIS = true;
}
if (CoverageInfo.isCoverageSufficient(CoverageInfo.COVERAGE_DIRECT)) {
coverageTCP = true;
coverageWAP = true;
coverageWAP2 = true;
}
if (CoverageInfo.isCoverageSufficient(CoverageInfo.COVERAGE_MDS)) {
coverageMDS = true;
coverageUnite = true;
}

if (WLANInfo.getWLANState() == WLANInfo.WLAN_STATE_CONNECTED) {
coverageWiFi = true;
}

}

 

 

 

 

 

public void populateCarrierInfo() {
final String carrierName = RadioInfo.getCurrentNetworkName();
;
int mcc = -1, mnc = -1;
CarrierInfo cinfo = null;
CarrierInfoParser cparser = null;
try {
if (RadioInfo.getNetworkType() == RadioInfo.NETWORK_CDMA) {
String imsi = GPRSInfo.imeiToString(CDMAInfo.getIMSI());
mcc = Integer.parseInt(imsi.substring(0, 3));
mnc = Integer.parseInt(imsi.substring(3, 6));
} else if (RadioInfo.getNetworkType() == RadioInfo.NETWORK_UMTS
|| RadioInfo.getNetworkType() == RadioInfo.NETWORK_GPRS) {
mcc = Integer.parseInt(Integer.toHexString(GPRSInfo
.getHomeMCC()));
mnc = Integer.parseInt(Integer.toHexString(GPRSInfo
.getHomeMNC()));
}
}
catch(NullPointerException npe)
{

}
catch(NumberFormatException ne)
{

}
catch (Throwable t) {
}

InputStream xmlis = null;
try {
FileConnection fconn = (FileConnection) Connector.open(
"file:///store/netdiag/carrier_info.xml", Connector.READ);
if (null != fconn)
xmlis = fconn.openInputStream();
} catch (Exception e) {
}

if (xmlis != null) {
cparser = new CarrierInfoParser(xmlis);

if (mcc != -1 && mnc != -1)
cinfo = cparser.getCarrierInfo(mcc, mnc);
else if (mcc != -1 && mnc == -1)
cinfo = cparser.getCarrierInfo(mcc, carrierName);
if (cinfo == null && mcc != -1)
cinfo = cparser.getCarrierInfo(mcc, carrierName.substring(0,
carrierName.indexOf(" ")));
}
if (cinfo != null) {
cinfo.setCarrierName(carrierName);

tcpAPN = cinfo.getTcpAPN();
tcpAPNUser = cinfo.getTcpAPNUserName();
tcpAPNPassword = cinfo.getTcpAPNPassword();
wapGatewayAPN = cinfo.getWapAPN();
wapGatewayIP = cinfo.getWapIP();
wapGatewayPort = cinfo.getWapPort();
wapSourceIP = cinfo.getWapSourceIP();
wapSourcePort = cinfo.getWapSourcePort();
wapUser = cinfo.getWapUserName();
wapPassword = cinfo.getWapPassword();
isWapEnableWTLS = cinfo.isEnabaleWTLS();
}
}

 



Developer
Posts: 66
Registered: ‎01-14-2010
My Device: 8700
My Carrier: Airtel

Re: How to check active network connection n Blackberry

 

import net.rim.device.api.xml.parsers.*;

import org.w3c.dom.*;

import java.io.*;

public class CarrierInfoParser {	
	private DocumentBuilderFactory factory;
	private DocumentBuilder builder;
	private InputStream inputStream;
	private Document document;	

	public CarrierInfoParser(InputStream is) {
		
		try {
			factory = DocumentBuilderFactory.newInstance();
			builder = factory.newDocumentBuilder();
			inputStream = is;
			document = builder.parse(inputStream);
		} catch (Throwable t) {

		}
	}
	
	/**
	 * Returns a CarrierInfo object if a <carrier> is found that matches the search keys, 'mcc' and 'carrierName'
	 * @param mcc	MCC search key
	 * @param carrierName	Carrier name to search for 
	 * @return	A CarrierInfo object if the search has a result. null otherwise.
	 */
	public CarrierInfo getCarrierInfo(int mcc, String carrierName) {
		CarrierInfo cinfo = new CarrierInfo();
		// parse root
		Element rootNode = document.getDocumentElement();
		rootNode.normalize();	
		
		// parse <country>'s
		NodeList countryList = rootNode.getChildNodes();


		for (int i=0; i<countryList.getLength(); i++) {
			Node curCountry = countryList.item(i);
			if(curCountry.getNodeType()==Node.ELEMENT_NODE && curCountry.getNodeName().equals("country")){
				// parse <country> attributes								
				NamedNodeMap countryAtts = curCountry.getAttributes();
				for(int j=0; j<countryAtts.getLength(); j++){
					String countryAttName = countryAtts.item(j).getNodeName();
					String countryAttValue = countryAtts.item(j).getNodeValue();	
					if(countryAttName.equals("name"))
						cinfo.setCountry(countryAttValue);
					if(countryAttName.equals("mcc"))
						cinfo.setMcc(countryAttValue);
					if(countryAttName.equals("mcc") && countryAttValue.equals(Integer.toString(mcc))){
						// parse this <country>
						NodeList carrierList = curCountry.getChildNodes();
						for(int k=0; k<carrierList.getLength(); k++){
							Node curCarrier = carrierList.item(k);
							if(curCarrier.getNodeType()==Node.ELEMENT_NODE && curCarrier.getNodeName().equals("carrier")){
								// parse carrier attributes
								NamedNodeMap carrierAtts = curCarrier.getAttributes();								
								for(int l=0; l<carrierAtts.getLength(); l++){
									String carrierAttName = carrierAtts.item(l).getNodeName();
									String carrierAttValue = carrierAtts.item(l).getNodeValue();
									if(carrierAttName.equals("name")){
										cinfo.setCarrierName(carrierAttValue);									
										cinfo.setMnc(carrierAtts.item(l+1).getNodeValue());
									}									
									if(carrierAttName.equals("name") && carrierAttValue.toLowerCase().indexOf(carrierName.toLowerCase())!=-1){
										// parse this carrier
										NodeList carrierData = curCarrier.getChildNodes();
										for(int m=0; m<carrierData.getLength(); m++){
											Node curDataNode = carrierData.item(m);
											if(curDataNode.getNodeType()==Node.ELEMENT_NODE && curDataNode.getNodeName().equals("tcpAPN")){
												if(curDataNode.hasChildNodes())
													cinfo.setTcpAPN(curDataNode.getFirstChild().getNodeValue()!=null?curDataNode.getFirstChild().getNodeValue():"");												
											}else if(curDataNode.getNodeType()==Node.ELEMENT_NODE && curDataNode.getNodeName().equals("tcpAPNUserName")){
												if(curDataNode.hasChildNodes())
													cinfo.setTcpAPNUserName(curDataNode.getFirstChild().getNodeValue()!=null?curDataNode.getFirstChild().getNodeValue():"");												
											}else if(curDataNode.getNodeType()==Node.ELEMENT_NODE && curDataNode.getNodeName().equals("tcpAPNPassword")){
												if(curDataNode.hasChildNodes())
													cinfo.setTcpAPNPassword(curDataNode.getFirstChild().getNodeValue()!=null?curDataNode.getFirstChild().getNodeValue():"");												
											}else if(curDataNode.getNodeType()==Node.ELEMENT_NODE && curDataNode.getNodeName().equals("wapAPN")){
												if(curDataNode.hasChildNodes())
													cinfo.setWapAPN(curDataNode.getFirstChild().getNodeValue()!=null?curDataNode.getFirstChild().getNodeValue():"");												
											}else if(curDataNode.getNodeType()==Node.ELEMENT_NODE && curDataNode.getNodeName().equals("wapIP")){
												if(curDataNode.hasChildNodes())
													cinfo.setWapIP(curDataNode.getFirstChild().getNodeValue()!=null?curDataNode.getFirstChild().getNodeValue():"");												
											}else if(curDataNode.getNodeType()==Node.ELEMENT_NODE && curDataNode.getNodeName().equals("wapPort")){
												if(curDataNode.hasChildNodes())
													cinfo.setWapPort(curDataNode.getFirstChild().getNodeValue()!=null?curDataNode.getFirstChild().getNodeValue():"");												
											}else if(curDataNode.getNodeType()==Node.ELEMENT_NODE && curDataNode.getNodeName().equals("wapUserName")){
												if(curDataNode.hasChildNodes())
													cinfo.setWapUserName(curDataNode.getFirstChild().getNodeValue()!=null?curDataNode.getFirstChild().getNodeValue():"");												
											}else if(curDataNode.getNodeType()==Node.ELEMENT_NODE && curDataNode.getNodeName().equals("wapPassword")){
												if(curDataNode.hasChildNodes())
													cinfo.setWapPassword(curDataNode.getFirstChild().getNodeValue()!=null?curDataNode.getFirstChild().getNodeValue():"");												
											}else if(curDataNode.getNodeType()==Node.ELEMENT_NODE && curDataNode.getNodeName().equals("wapSourceIP")){
												if(curDataNode.hasChildNodes())
													cinfo.setWapSourceIP(curDataNode.getFirstChild().getNodeValue()!=null?curDataNode.getFirstChild().getNodeValue():"");												
											}else if(curDataNode.getNodeType()==Node.ELEMENT_NODE && curDataNode.getNodeName().equals("wapSourcePort")){
												if(curDataNode.hasChildNodes())
													cinfo.setWapSourcePort(curDataNode.getFirstChild().getNodeValue()!=null?curDataNode.getFirstChild().getNodeValue():"");												
											}else if(curDataNode.getNodeType()==Node.ELEMENT_NODE && curDataNode.getNodeName().equals("isEnabaleWTLS")){
												if(curDataNode.hasChildNodes())
													cinfo.setEnabaleWTLS(curDataNode.getFirstChild().getNodeValue()!=null && curDataNode.getFirstChild().getNodeValue().equals("true")?true:false);												
											}
										}
										return cinfo;
									}
								}
							}
						}
					}					
				}
			}	
		}
		return null;
	}

	/**
	 * Returns a CarrierInfo object if a <carrier> is found that matches the search keys, 'mcc' and 'carrierName'
	 * @param mcc	MCC search key
	 * @param carrierName	Carrier name to search for 
	 * @return	A CarrierInfo object if the search has a result. null otherwise.
	 */
	public CarrierInfo getCarrierInfo(int mcc, int mnc) {
		CarrierInfo cinfo = new CarrierInfo();
		// parse root
		Element rootNode = document.getDocumentElement();
		rootNode.normalize();
		
		String rootNodeName = rootNode.getNodeName();		
		
		// parse <country>'s
		NodeList countryList = rootNode.getChildNodes();

		for (int i=0; i<countryList.getLength(); i++) {
			Node curCountry = countryList.item(i);
			if(curCountry.getNodeType()==Node.ELEMENT_NODE && curCountry.getNodeName().equals("country")){
				// parse <country> attributes								
				NamedNodeMap countryAtts = curCountry.getAttributes();
				for(int j=0; j<countryAtts.getLength(); j++){
					String countryAttName = countryAtts.item(j).getNodeName();
					String countryAttValue = countryAtts.item(j).getNodeValue();	
					if(countryAttName.equals("name"))
						cinfo.setCountry(countryAttValue);
					if(countryAttName.equals("mcc"))
						cinfo.setMcc(countryAttValue);
					if(countryAttName.equals("mcc") && countryAttValue.equals(Integer.toString(mcc))){
						// parse this <country>
						NodeList carrierList = curCountry.getChildNodes();
						for(int k=0; k<carrierList.getLength(); k++){
							Node curCarrier = carrierList.item(k);
							if(curCarrier.getNodeType()==Node.ELEMENT_NODE && curCarrier.getNodeName().equals("carrier")){
								// parse carrier attributes
								NamedNodeMap carrierAtts = curCarrier.getAttributes();								
								for(int l=0; l<carrierAtts.getLength(); l++){
									String carrierAttName = carrierAtts.item(l).getNodeName();
									String carrierAttValue = carrierAtts.item(l).getNodeValue();
									if(carrierAttName.equals("name")){
										cinfo.setCarrierName(carrierAttValue);									
									}	
									if(carrierAttName.equals("mnc")){																			
										cinfo.setMnc(carrierAttValue);
									}	
									if(carrierAttName.equals("mnc") && carrierAttValue.equals(Integer.toString(mnc))){
										// parse this carrier
										NodeList carrierData = curCarrier.getChildNodes();
										for(int m=0; m<carrierData.getLength(); m++){
											Node curDataNode = carrierData.item(m);
											if(curDataNode.getNodeType()==Node.ELEMENT_NODE && curDataNode.getNodeName().equals("tcpAPN")){
												if(curDataNode.hasChildNodes())
													cinfo.setTcpAPN(curDataNode.getFirstChild().getNodeValue()!=null?curDataNode.getFirstChild().getNodeValue():"");												
											}else if(curDataNode.getNodeType()==Node.ELEMENT_NODE && curDataNode.getNodeName().equals("tcpAPNUserName")){
												if(curDataNode.hasChildNodes())
													cinfo.setTcpAPNUserName(curDataNode.getFirstChild().getNodeValue()!=null?curDataNode.getFirstChild().getNodeValue():"");												
											}else if(curDataNode.getNodeType()==Node.ELEMENT_NODE && curDataNode.getNodeName().equals("tcpAPNPassword")){
												if(curDataNode.hasChildNodes())
													cinfo.setTcpAPNPassword(curDataNode.getFirstChild().getNodeValue()!=null?curDataNode.getFirstChild().getNodeValue():"");												
											}else if(curDataNode.getNodeType()==Node.ELEMENT_NODE && curDataNode.getNodeName().equals("wapAPN")){
												if(curDataNode.hasChildNodes())
													cinfo.setWapAPN(curDataNode.getFirstChild().getNodeValue()!=null?curDataNode.getFirstChild().getNodeValue():"");												
											}else if(curDataNode.getNodeType()==Node.ELEMENT_NODE && curDataNode.getNodeName().equals("wapIP")){
												if(curDataNode.hasChildNodes())
													cinfo.setWapIP(curDataNode.getFirstChild().getNodeValue()!=null?curDataNode.getFirstChild().getNodeValue():"");												
											}else if(curDataNode.getNodeType()==Node.ELEMENT_NODE && curDataNode.getNodeName().equals("wapPort")){
												if(curDataNode.hasChildNodes())
													cinfo.setWapPort(curDataNode.getFirstChild().getNodeValue()!=null?curDataNode.getFirstChild().getNodeValue():"");												
											}else if(curDataNode.getNodeType()==Node.ELEMENT_NODE && curDataNode.getNodeName().equals("wapUserName")){
												if(curDataNode.hasChildNodes())
													cinfo.setWapUserName(curDataNode.getFirstChild().getNodeValue()!=null?curDataNode.getFirstChild().getNodeValue():"");												
											}else if(curDataNode.getNodeType()==Node.ELEMENT_NODE && curDataNode.getNodeName().equals("wapPassword")){
												if(curDataNode.hasChildNodes())
													cinfo.setWapPassword(curDataNode.getFirstChild().getNodeValue()!=null?curDataNode.getFirstChild().getNodeValue():"");												
											}else if(curDataNode.getNodeType()==Node.ELEMENT_NODE && curDataNode.getNodeName().equals("wapSourceIP")){
												if(curDataNode.hasChildNodes())
													cinfo.setWapSourceIP(curDataNode.getFirstChild().getNodeValue()!=null?curDataNode.getFirstChild().getNodeValue():"");												
											}else if(curDataNode.getNodeType()==Node.ELEMENT_NODE && curDataNode.getNodeName().equals("wapSourcePort")){
												if(curDataNode.hasChildNodes())
													cinfo.setWapSourcePort(curDataNode.getFirstChild().getNodeValue()!=null?curDataNode.getFirstChild().getNodeValue():"");												
											}else if(curDataNode.getNodeType()==Node.ELEMENT_NODE && curDataNode.getNodeName().equals("isEnabaleWTLS")){
												if(curDataNode.hasChildNodes())
													cinfo.setEnabaleWTLS(curDataNode.getFirstChild().getNodeValue()!=null && curDataNode.getFirstChild().getNodeValue().equals("true")?true:false);												
											}
										}
										return cinfo;
									}
								}
							}
						}
					}					
				}
			}	
		}
		return null;
	}

}



 

 

Developer
Posts: 66
Registered: ‎01-14-2010
My Device: 8700
My Carrier: Airtel

Re: How to check active network connection n Blackberry

 

public class CarrierInfo {
	private String carrierName;
	private String country;
	private String mcc;
	private String mnc;
	
	private String tcpAPN;
	private String tcpAPNUserName;
	private String tcpAPNPassword;
	
	private String wapAPN;
	private String wapIP;
	private String wapPort;
	private String wapUserName;
	private String wapPassword;
	private String wapSourceIP;
	private String wapSourcePort;
	private boolean isEnabaleWTLS;
	
	
	
	public CarrierInfo() {
		this.carrierName="";
		this.country="";
		this.mcc="";
		this.mnc="";
		
		this.tcpAPN = "";
		this.tcpAPNUserName = "";
		this.tcpAPNPassword = "";
		this.wapAPN = "";
		this.wapIP = "";
		this.wapPort = "";
		this.wapUserName = "";
		this.wapPassword = "";
		this.wapSourceIP = "";
		this.wapSourcePort = "";
		this.isEnabaleWTLS = false;
		
	}
	public String getTcpAPN() {
		return tcpAPN;
	}
	public void setTcpAPN(String tcpAPN) {
		this.tcpAPN = tcpAPN;
	}
	public String getTcpAPNUserName() {
		return tcpAPNUserName;
	}
	public void setTcpAPNUserName(String tcpAPNUserName) {
		this.tcpAPNUserName = tcpAPNUserName;
	}
	public String getTcpAPNPassword() {
		return tcpAPNPassword;
	}
	public void setTcpAPNPassword(String tcpAPNPassword) {
		this.tcpAPNPassword = tcpAPNPassword;
	}
	public String getWapAPN() {
		return wapAPN;
	}
	public void setWapAPN(String wapAPN) {
		this.wapAPN = wapAPN;
	}
	public String getWapIP() {
		return wapIP;
	}
	public void setWapIP(String wapIP) {
		this.wapIP = wapIP;
	}
	public String getWapPort() {
		return wapPort;
	}
	public void setWapPort(String wapPort) {
		this.wapPort = wapPort;
	}
	public String getWapUserName() {
		return wapUserName;
	}
	public void setWapUserName(String wapUserName) {
		this.wapUserName = wapUserName;
	}
	public String getWapPassword() {
		return wapPassword;
	}
	public void setWapPassword(String wapPassword) {
		this.wapPassword = wapPassword;
	}
	public String getWapSourceIP() {
		return wapSourceIP;
	}
	public void setWapSourceIP(String wapSourceIP) {
		this.wapSourceIP = wapSourceIP;
	}
	public String getWapSourcePort() {
		return wapSourcePort;
	}
	public void setWapSourcePort(String wapSourcePort) {
		this.wapSourcePort = wapSourcePort;
	}
	public boolean isEnabaleWTLS() {
		return isEnabaleWTLS;
	}
	public void setEnabaleWTLS(boolean isEnabaleWTLS) {
		this.isEnabaleWTLS = isEnabaleWTLS;
	}
	
	public String toString(){
		StringBuffer sb = new StringBuffer();
		sb.append("\nCountry: "+country);
		sb.append("\nMCC: "+mcc);
		sb.append("\nCarrier: "+carrierName);
		sb.append("\nMNC: "+mnc);
		sb.append("\ntcpAPN: "+tcpAPN);
		sb.append("\ntcpAPNUserName: "+tcpAPNUserName);
		sb.append("\ntcpAPNPassword: "+tcpAPNPassword);
		sb.append("\nwapAPN: "+wapAPN);
		sb.append("\nwapIP: "+wapIP);
		sb.append("\nwapPort: "+wapPort);
		sb.append("\nwapUserName: "+wapUserName);
		sb.append("\nwapPassword: "+wapPassword);
		sb.append("\nwapSourceIP: "+wapSourceIP);
		sb.append("\nwapSourcePort: "+wapSourcePort);
		sb.append("\nisEnabaleWTLS: "+isEnabaleWTLS);
		
		
		return sb.toString();
	}
	public String getCarrierName() {
		return carrierName;
	}
	public void setCarrierName(String carrierName) {
		this.carrierName = carrierName;
	}
	public String getCountry() {
		return country;
	}
	public void setCountry(String country) {
		this.country = country;
	}
	public String getMcc() {
		return mcc;
	}
	public void setMcc(String mcc) {
		this.mcc = mcc;
	}
	public String getMnc() {
		return mnc;
	}
	public void setMnc(String mnc) {
		this.mnc = mnc;
	}
	
	
}




 

 

Developer
Posts: 192
Registered: ‎01-12-2010
My Device: Bold
My Carrier: ZAIN

Re: How to check active network connection n Blackberry

for wifi connection try to append the

url=url.concat(

";interface=wifi");

Developer
Posts: 1,474
Registered: ‎04-14-2009
My Device: Not Specified

Re: How to check active network connection n Blackberry

CoverageInfo and WLANInfo are the ways to go. The exact usage depends on which connection methods/routes (MDS, BIS-B, Carrier, WAP 2.0, WAP 1.0, WiFi) you'd like to use.

 

What you've missed in your test on the simulator is that the simulator's connectivity status does not depend on whether the PC on which it is running has Internet connectivity or not. To simulate the cellular and WiFi network connectivity, you need to activate/deactivate the cellular and WiFi radios in the simulator (for WiFi, you  also need to connect to a simulated WiFi network).

Developer
Posts: 70
Registered: ‎11-24-2009
My Device: Not Specified

Re: How to check active network connection n Blackberry

I'll try with the devices then.

 

Thanks all for your help.

Just want to keep this thread open and will respond with my observation with devices.

 

Thanks again

Lovish

Developer
Posts: 193
Registered: ‎04-27-2009
My Device: Not Specified

Re: How to check active network connection n Blackberry

hi Sudhakar,

can you please provide code for :-

doHttpDirectTCP()

doHttpMDS()

doHttpUnits()

doHttpBIS()

doHttpWAP1()

doHttpWAP2()