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

Posts: 112
Registered: ‎05-29-2009
My Device: Not Specified

Retrive Device Ip Programatically

Hi All,

     I want to retrieve the IP address of my BB device programatically. I need to pass that IP later to some URL for the further use. 


     Can it be possible programatically?...please give me proper solution..


Thanks & Regards

Posts: 5,339
Registered: ‎09-20-2008
My Device: ***
My Carrier: ***

Re: Retrive Device Ip Programatically

[ Edited ]

As far as I know a BlackBerry device does not have an IP-address assigned.


Use device PIN (via DeviceInfo class). It is a unique identifier for the device.

Message Edited by tbilisoft on 18-07-2009 08:52 PM
Posts: 12
Registered: ‎06-16-2011
My Device: 9000
My Carrier: Vodafone

Re: Retrive Device Ip Programatically


You can get to IP app programetically....
int cni = RadioInfo.getCurrentNetworkIndex();
int apnId = cni + 1; // cni is zero based
byte[] ipaddr = RadioInfo.getIPAddress(apnId);
It will give you the ip address of both case Wifi and TCP itself if you connected with both then it gives the priority to Wifi.