Search code examples
javablackberrywifiblackberry-jde

Blackberry: how to find subnet mask of connected network


How can I find the subnet mask of connected wifi network in Blackberry jde 4.5+ ?


Solution

  • Unfortunately, I believe there is no reliable way to do this in BlackBerry Java.

    You can get the Wi-Fi IP address, but not the subnet mask.

    I was hoping that maybe you could reverse engineer the subnet mask by attempting a UDP broadcast connection, but it looks like that's not supported either.

    Certainly, if you're on a Wi-Fi network where you have access to a web interface for the Wi-Fi router, you could try to scrape subnet mask values off the router. But, that's only likely to be useful for your home network, and I assume you'd like this code to work anywhere.

    So, I don't think there's a good solution :(