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
Contributor
newton53
Posts: 43
Registered: ‎11-30-2011
My Device: Dev Alpha, 8520
Accepted Solution

Obtaining IP Addresses Of Devices Connected To WiFi Network

Hello guys,

 

I've been looking around and trying to figure this out, but I haven't come across a solution. The problem is to obtain the local IP addresses of all devices connected to the WiFi access point/router that my BlackBerry is connected to. Kind of similar to how in J2SE you can obtain the device IP address using InetAddress.getLocalAddress() and then iterate through ip addresses and call InetAddress.getByAddress(ip) to check whether device is reachable or not. Is something similar possible in BlackBerry or not?



I've got 99 problems and eclipse is all of them


Twitter

Developer
simon_hain
Posts: 16,282
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport

Re: Obtaining IP Addresses Of Devices Connected To WiFi Network

its a bit tricky, as there is no direct API for it.
you can open a socket and get its address, or use a workaround described here:
http://supportforums.blackberry.com/t5/Java-Development/wifi-ip-address/m-p/374272#M70943

there are numerous threads about this, if you enter 'wifi ip' in the search field you should get a good overview.
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Contributor
newton53
Posts: 43
Registered: ‎11-30-2011
My Device: Dev Alpha, 8520

Re: Obtaining IP Addresses Of Devices Connected To WiFi Network

Let me restate.

 

I don't want my BB's IP address, I want the IP addresses of all devices connected to the WiFi access point or router that the BB is connected to. For example my laptop, or my friend's PS3, or my other friend's WiFi hard disk, all of which are on the same WiFi access point as my BB.

 

That should clear up what I want. I apologise if I said something confusing in the OP.



I've got 99 problems and eclipse is all of them


Twitter

Developer
simon_hain
Posts: 16,282
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport

Re: Obtaining IP Addresses Of Devices Connected To WiFi Network

no, the fault was entirely mine, i misread your post.
no clue how to do that, there is no low-level access to the network interface and the API is really limited.
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Contributor
newton53
Posts: 43
Registered: ‎11-30-2011
My Device: Dev Alpha, 8520

Re: Obtaining IP Addresses Of Devices Connected To WiFi Network

pfsh, I had an omnious feeling about this.

 

oh well, back to the drawing board. Thanks for the help though!



I've got 99 problems and eclipse is all of them


Twitter