08-13-2009 05:05 AM
I program with Bold (simulator and real) but I test on all OS 4.2 and above.
I would like to get the name of the Wifi Access Point when I connect my mobile to.
I tried and noticed that :
RadioInfo.getCurrentNetworkName(); => provide me the name of gprs/3g carrier but no wifi access point name (return null)
int cni = RadioInfo.getCurrentNetworkIndex();
int apnId = cni + 1;
String apnName = RadioInfo.getAccessPointName(apnId); => provide me the type of BB connection? I have noticed that the return string with a wifi connection with BES is : "MagicRudyAPN.rim" and for the mobile network : "blackberry.net"
My goal : to know if I connected to a specific wifi access point
how to do that? thanks!
Solved! Go to Solution.
08-13-2009 07:39 AM - edited 08-13-2009 07:44 AM
As far as I know, RadioInfo.getAccessPointName() has nothing to do with WiFi Access Points -- it's intended for querying mobile network APNs used by the handheld. Moreover, network index (returned by RadioInfo.getCurrentNetworkIndex()) has nothing to do with APN ID used by RadioInfo.getAccessPointName().
08-13-2009 09:40 AM
I understand that.
I need to retrieve the name of the Wifi SSID when the mobile is connected over wifi access point.
I need to do a http request over wifi, i have tried "interface=wifi" appended with the URL but I have an exception, someone know how to workaround ?
08-13-2009 03:08 PM
I do not think that there is a work around.
You need to make sure that the device is wifi-enabled and that the wifi is active by checking
(RadioInfo.getActiveWAFs() & RadioInfo.WAF_WLAN ) != 0;
If it is the case, it should work without exception.
08-13-2009 05:22 PM - edited 08-13-2009 05:24 PM
after checking if your device is connected to an AP, use WLANInfo.WLANAPInfo class to retrieve the ssid. this is available in 4.3OS and up.
btw, what's your exception? you're encountering and exception when you appendthe "interface=wifi"? can you elaborate more on this?
03-08-2010 10:51 AM
i have been trying for weeks to get signal Strength from an access point in my university.after many tries with the Service Book and RadioInfo.getAccessPointNumber with the MagicRudyAPN.rim .... i found out that the only and simple solution is to connect to the AP over wifi
i found the APi how to use a Streamconnection .
private static String URL = "socket://local_machine_IP:4444;deviceside=true;in
StreamConnection conn = null;
conn = (StreamConnection)Connector.open(URL);
now my problem is that i only know the IP adress of the AP ,port, login and password,how can i connect to my AP using these informations?
thx in advance