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;
}
Nice post, things explained in details. Thank You.
ReplyDeleteNice posting
ReplyDeleteMobile App Development Company Indore
I really appreciate your professional approach. These are pieces of very useful information that will be of great use for me in future.
ReplyDelete