[SOLVED]Usign WifiManager

Problems with WiFi, SQLite ,Bluetooth, WiMax, Proxies, etc...

[SOLVED]Usign WifiManager

Postby fra86co » Fri Oct 24, 2008 9:51 pm

Hi,
i have a problem with the Android Emulator.
I tried to use WifiManger.getListScan() method but i obtain thi exception :

java.lang.SecurityException: WifiService: Neither user 10017 no currently process has andriod.permission.AccessWifiState

Can the Emulator access the wifi state of my pc?
Last edited by fra86co on Tue Oct 28, 2008 7:36 pm, edited 1 time in total.
fra86co
Freshman
Freshman
 
Posts: 3
Joined: Fri Oct 24, 2008 9:45 pm

Top

Postby MrSnowflake » Tue Oct 28, 2008 12:05 pm

The error is pretty clear: You should define that you use the 'andriod.permission.AccessWifiState' permission in you manifest.
User avatar
MrSnowflake
Moderator
Moderator
 
Posts: 1439
Joined: Sat Feb 16, 2008 3:11 pm
Location: Flanders, Belgium

WiFi Manager

Postby anirudha » Fri Nov 21, 2008 11:41 am

I am trying to use following:

WifiManager wm = (WifiManager) getSystemService(Context.WIFI_SERVICE);

but whenever i use following it throws an error

wm.setWifiEnabled(true);

I have added <uses-permission> for accessing wifi state into manifest file.

Can i use wifi of underlying machine using emulator as emulator dont have dedicated wifi adapter?
anirudha
Freshman
Freshman
 
Posts: 2
Joined: Fri Nov 21, 2008 10:56 am

Re: WiFi Manager

Postby avolovoy » Sun Dec 21, 2008 7:07 pm

anirudha wrote:I am trying to use following:

WifiManager wm = (WifiManager) getSystemService(Context.WIFI_SERVICE);

but whenever i use following it throws an error

wm.setWifiEnabled(true);

I have added <uses-permission> for accessing wifi state into manifest file.

Can i use wifi of underlying machine using emulator as emulator dont have dedicated wifi adapter?

you're still missing a permission- tutorial is posted take a look.
Alexey Volovoy
Bytesharp.NET
User avatar
avolovoy
Experienced Developer
Experienced Developer
 
Posts: 68
Joined: Mon Nov 03, 2008 10:32 pm
Location: kansas

Top

Return to Networking & Database Problems

Who is online

Users browsing this forum: Yahoo [Bot] and 4 guests