String ip = new String("");
try {
int cni = RadioInfo.getCurrentNetworkIndex();
int apnId = cni + 1;
byte[] ipaddr = RadioInfo.getIPAddress(apnId);
for (int i = 0; i < ipaddr.length; i++) {
int temp = (ipaddr[i] & 0xff);
if (i < 3) {
ip = ip.concat("" + temp + ".");
} else {
ip = ip.concat("" + temp);
}
}
System.out.println("ipaddress " + ip);
} catch (Exception e) {
ip = null;
}