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
syedshakeel2004
Posts: 29
Registered: ‎12-28-2009
My Device: Not Specified

WiFi hotspot availability

Hi to all,
          
i want to check that wifi hotspot are available or not at particular time using apis. according to that i have to take the action.In JDE 5.0 there are the HotSpot classes but i am not able to find the appropriate api to check the hotspot availability. can somebody help me to findout the api to check for wifi hotspot availability. all suggestions will be greatly  appreciated.

with thanx and regards
shakeel

Please use plain text.
Developer
syedshakeel2004
Posts: 29
Registered: ‎12-28-2009
My Device: Not Specified

Re: WiFi hotspot availability

hi to all,

 i have tried to implement in my code and tried to run my application on simulator. but the method

 

CoverageInfo.isCoverageSufficient(CoverageInfo.COVERAGE_DIRECT, RadioInfo.WAF_WLAN, true);

 

is returning false on the simulator while the default wifi profile is active. i had also tried with the CoverageInfo.COVERAGE_MDS arguement in the above api and MDS is also running.with that arguement also that api is returning false. Is it the correct way? or is there any other way to check the wifi hotspot/network availability.

plz reply.

 

any other suggestions?

 

with thanx and regards shakeel

Please use plain text.
New Developer
emlomar
Posts: 6
Registered: ‎02-02-2010
My Device: Blackberry Storm
My Carrier: Vodafone

Re: WiFi hotspot availability

In BB 5.0 component pack there is this Hotspot class...

 

http://www.blackberry.com/developers/docs/5.0.0api/net/rim/device/api/wlan/hotspot/HotspotClientRegi...

 

Maybe with this...

Please use plain text.
Contributor
kims
Posts: 10
Registered: ‎05-31-2010
My Device: Bold
My Carrier: vodafone

Re: WiFi hotspot availability

Hi,

 The hotpsot API returns you all the available network info by following below steps

1) Create Hotspot client by providing "HotspotCredentialsAgent", HotspotAuthAgent and network type (Manual/Automatic) to it's super class.

write implementation for below abstract methods, in HotspotClient

 

getClientName() and getSupportedNetworks(WLANInfo.WLANAPInfo[] networks)

 

-->  In getClientName() return default name which you want to assign to the network. 

-->  getSupportedNetworks(...) set all different properties like PROPERTY_BSSID, PROPERTY_CHANNEL, PROPERTY_HOTSPOT_PASSWORD, PROPERTY_HOTSPOT_USERNAME etc for the HotspotInfo while parsing "WLANInfo.WLANAPInfo[]",  

 

2) You can use HotspotCredentialsAgent.getSystemHotspotCredentialsAgent(), or your own implementation of this class.

 

3) Register Hotspot Client with registry by provideing application descriptor.

 

HotspotClientRegistry.add(hotspotClientObject,
                    ApplicationDescriptor.currentApplicationDescriptor());

 

This will register and once registration is done, you can connect to any of the list networks (Open) in

 

getSupportedNetworks(...) by returning hotspotInfo  array, as per your prority.

 

Unfortunatly this works only with Open security(Symbian has got support for all way back..),, so we are waiting for RIM's support on other security types.

 

 

Please use plain text.
Developer
laliux
Posts: 73
Registered: ‎07-16-2009
My Device: Bold

Re: WiFi hotspot availability

 

 

Try with this,

 

 

  if ((RadioInfo.getActiveWAFs() & RadioInfo.WAF_WLAN) != 0) {
        if (WLANInfo.getWLANState() == WLANInfo.WLAN_STATE_CONNECTED) {
             //WIFI ok , connected
//Here the code for getting the network name
//and other characteristics
 } else { //WIFI not connected
} } else { //Seems WIFI is off
 }

 

 

Greetings



 

Please use plain text.
New Developer
estebanuri
Posts: 28
Registered: ‎11-04-2009
My Device: Not Specified

Re: WiFi hotspot availability

Hi!
I've implemented all that this post suggests.
On the simulator, It works perfectly (I can retrieve the list of WLANs)

But on the real device is not working. 

The method getSupportedNetworks is never invoked on the HotspotClient class

 

Why might this be happening? 

Thanks!

 

Esteban.

I tried to change the world, but I couldn't find the source code
Please use plain text.
Regular Contributor
mohdfarhanakram
Posts: 73
Registered: ‎12-30-2011
My Device: All devices
My Carrier: RIM

Re: WiFi hotspot availability

Hi,

 

    Please help me i have also same problem, it is not working with real device but at simulator it is working fine

Thanks

Mohd Farhan
Please use plain text.
New Developer
estebanuri
Posts: 28
Registered: ‎11-04-2009
My Device: Not Specified

Re: WiFi hotspot availability

[ Edited ]

It was actually working, but I didn't realize that you have to put application on background and go to Configuration \ WiFi, there you'll find a wizard to configure the Hotspot profile.

 

pp.jpg

 

pp2.jpg

 

when you finish the wizard, you'll start receinving the callbacks on HotspotClient.

But, I have to do this manual registration every time I want to receive notifications. And in that way it doesn't serve too much in a real application.

I tried to change the world, but I couldn't find the source code
Please use plain text.
Regular Contributor
mohdfarhanakram
Posts: 73
Registered: ‎12-30-2011
My Device: All devices
My Carrier: RIM

Re: WiFi hotspot availability

Hi Estabnuri,

 

                   Thanks to reply me , i did this realy working good, but please tell me, can i do setup without going wifi seeting and click ok to install HotSpot client.

Thanks

Mohd Farhan
Please use plain text.