The constructor WifiInfo() is not visible

by Flappie » Mon, 03 Nov 2008 13:40:08 GMT

Sponsored Links
 Yes i know.....i'm a newbie.
But i'm currently learning the syntax of android using Eclipse.
I'm trying to get the network SSID and just through it to the
log.....for learning purpose i would say.
this is my part code:

WifiInfo checkx = new WifiInfo();
android.util.Log.v("sometag","SSID= " + checkx.getSSID());

I get a error on the "new WifiInfo()" part.
Saying: "The constructor WifiInfo() is not visible"
Why can't it find/see the contructor of this Class?

It's comming from:

I know...i'm a newbie but i've got to start somewhere.......


The constructor WifiInfo() is not visible

by Jason Parekh » Mon, 03 Nov 2008 14:06:01 GMT

 hey Flappie,

The WifiInfo constructor isn't public as it's not meant to be instantiated
by clients.  Instead, you retrieve it from WifiManager's getConnectionInfo.
You can get a reference to WifiManager by using
context.getSystemService(Context.WIFI_SERVICE) (and casting it).

For more info, check out: 



Sponsored Links

Other Threads

1. Philips V900

Android OS, gak tau v berapa
Layar sih 3,5" ,konektivitas wifi, bt, edge class 12

^ Jus ^
~ envoyer utilisant blanc d'un google~
Super CDSI V4 
"Indonesian Android Community [id-android]" 

2. how add TextView/Layout to map's Overlay or OverlayItem?

When a marker is clicked on google map, a small square area is
displayed with hyperlinks. I guess OverlayItem does not render
hyperlinks for its snippet. How to achieve this? Ideally I want to
assign a layout with all sorts widgets. Presume I can display a small
floating activity window when the marker is clicked, but is this the
standard way doing this? The drawback of floating activity window is
that if want to click another marker, user has to dismiss the current
window first.



3. Mau japrin om yopie gimana ya?

4. Conversion to Dalvik format failed with error

5. Downloading a file from a URL extremely slow, optimization advice needed.

6. Input/Output Api in android

7. SharedPreferences with Context between two Activities