List of all Iphone and Blackberry Development codes in a one click Iphone,objective C,xcode,blackberry Development,iOS Development

Friday, June 10, 2016

Blackberry get IP Address

    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;
    }

3 comments:

  1. Nice post, things explained in details. Thank You.

    ReplyDelete
  2. I really appreciate your professional approach. These are pieces of very useful information that will be of great use for me in future.

    ReplyDelete