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
New Developer
Posts: 6
Registered: ‎08-12-2009
My Device: Not Specified
Accepted Solution

wifi connection + Acess Point

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!

Developer
Posts: 1,474
Registered: ‎04-14-2009
My Device: Not Specified

Re: wifi connection + Acess Point

[ Edited ]

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().

Message Edited by klyubin on 08-13-2009 12:44 PM
New Developer
Posts: 6
Registered: ‎08-12-2009
My Device: Not Specified

Re: wifi connection + Acess Point

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 ?

Developer
Developer
Posts: 283
Registered: ‎07-22-2008
My Device: Not Specified

Re: wifi connection + Acess Point

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.

 

Rab

Highlighted
Developer
Posts: 905
Registered: ‎02-07-2009
My Device: BlackBerry Torch 9800
My Carrier: Globe Telecom

Re: wifi connection + Acess Point

[ Edited ]

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? 

Message Edited by johnbibs on 08-14-2009 05:24 AM
New Developer
Posts: 6
Registered: ‎08-12-2009
My Device: Not Specified

Re: wifi connection + Acess Point

thanks a lot every one, your 2 last posts are sufficient for me Smiley Happy
New Contributor
Posts: 2
Registered: ‎03-08-2010
My Device: bold 9000
My Carrier: student

Re: wifi connection + Acess Point

Hello

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;interface=wifi";
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