Welcome!

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

Reply
Developer
madiha
Posts: 107
Registered: ‎05-26-2011
My Device: Torch

Obtain public ip address of the BB device

Hi,

I want to obtain public ip address of a blackberry device ?

any there who can help me ?

thanks

Please use plain text.
Developer
peter_strange
Posts: 19,608
Registered: ‎07-14-2008
My Device: Not Specified

Re: Obtain public IP address of the BB device

If it is on WiFi it does have an IP address - that will be determined by the WIFi network it is associated with.  On wireless, it does not have a public WiFi address. 

 

If you tell us what you are trying to do with this information, we might be able to help you further.  But before responding, please search (see Search box near top right hand side) for similar questions and their answers.

Please use plain text.
Developer
madiha
Posts: 107
Registered: ‎05-26-2011
My Device: Torch

Re: Obtain public IP address of the BB device

How can i get wifi ip address...?

i ve searched the forum and found this

			int apnId = 0;
			try {
				apnId = RadioInfo.getAccessPointNumber("MagicRudyAPN.rim");
			} catch (RadioException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			byte[] ipByte = RadioInfo.getIPAddress(apnId);
			String ip = "";
			for (int i = 0; i < ipByte.length; i++) {
				int temp = (ipByte[i] & 0xff);
				if (i < 3)
					ip = ip.concat("" + temp + ".");
				else {
					ip = ip.concat("" + temp);					
				}
			}

 

 but it is giviing me local ip address of the device ..

I am using a an adds service where i need to append the ip-address of the deivce to make the query string @ https://tools.mmedia.co

thnks

Please use plain text.
Developer
madiha
Posts: 107
Registered: ‎05-26-2011
My Device: Torch

Re: Obtain public IP address of the BB device

any one there ????

Please use plain text.