List of all Iphone and Blackberry Development codes in a one click Iphone,objective C,xcode,blackberry Development,iOS Development
Showing posts with label IP Address. Show all posts
Showing posts with label IP Address. Show all posts

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