Go Back   Android Forums > Android Development > Application Development
Application Development Dev lounge for our application developers.

test: Reply
 
LinkBack Thread Tools
Old July 9th, 2010, 06:36 PM   #1 (permalink)
New Member
Thread Author (OP)
 
Join Date: Feb 2010
Posts: 4
 
Device(s):
Carrier: Not Provided

Thanks: 0
Thanked 0 Times in 0 Posts
Default Android Froyo 2.2 and Wifi

Hi,

By default, Wifi sleep policy is "Sleep on screen idle".

With this policy, is it possible for a Background Service at a later time to wake up Wifi using some API?

Am trying the following, but does not work:
When my Background Service wakes up, it calls "ConnectivityManager.getActiveNetworkInfo()" to get active network.
Since, the wireless is off on idle, I tried waking it up using "WifiManager.startScan" on a previously used Wifi connection.
But still dont get Wifi connectivity.

Any ideas?
I preferably do not want to change my sleep policy to "Never".

Thanks
Hemant

Advertisements
hemant_puri is offline  
Reply With Quote
sponsored links
Old July 12th, 2010, 08:40 AM   #2 (permalink)
Junior Member
 
Join Date: Apr 2010
Posts: 85
 
Device(s):
Carrier: Not Provided

Thanks: 0
Thanked 16 Times in 15 Posts
Default

You're looking for the WifiLock in the Wifi Manager class. Take a look at this.
Boogs is offline  
Reply With Quote
Old July 12th, 2010, 11:44 AM   #3 (permalink)
New Member
Thread Author (OP)
 
Join Date: Feb 2010
Posts: 4
 
Device(s):
Carrier: Not Provided

Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by Boogs View Post
You're looking for the WifiLock in the Wifi Manager class. Take a look at this.
Looks like WifiLock works only if you have an Active Wifi Connection. Then when you acquire the lock, it ensures that Wifi will be active until the lock is released.

In my case, looking at something to activate the wifi from a background service (which wakes up periodically)
hemant_puri is offline  
Reply With Quote
Old July 12th, 2010, 12:00 PM   #4 (permalink)
Junior Member
 
Join Date: Apr 2010
Posts: 85
 
Device(s):
Carrier: Not Provided

Thanks: 0
Thanked 16 Times in 15 Posts
Default

Ah... in that case, I don't know how to acquire a Wifi signal when the phone is idle. If you find out, then let us know!

--Boogs
Boogs is offline  
Reply With Quote
Old December 1st, 2010, 12:00 AM   #5 (permalink)
New Member
 
Join Date: Nov 2010
Posts: 1
 
Device(s):
Carrier: Not Provided

Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi hemant_puri,
I have the same problem, do you know how to solve it?
Thank you!
robinvane is offline  
Reply With Quote
Reply


Go Back   Android Forums > Android Development > Application Development
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 03:06 AM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.