Hi,

Use alarms

On May 26, 8:06 pm, Charly <carlos.per...@gmail.com> wrote:
> Hi,
>
> I'm developing sort of a wireless scanner, so I need to scan every X
> seconds.
>
> I know I should use WifiManager and startScan() to get the networks
> and then register a receiver to receive the event once the scan has
> finished. However I'm having problems when trying to figure out how to
> scan periodically. It's more like a design problem.
>
> My solution so far has been to create a Service which takes care of
> the scanning, besides the main Activity. I think this is correct. So
> how could I tell this Service to scan every X seconds? I've thought it
> may have a Thread object, call its Scan method during tart_services()
> and then take it to sleep. Also I thought I could just get rid of the
> Service and run the Thread from the main Activity, but then I guess it
> would die whenever the Activity is not visible. None of then seem like
> a really good solution to me, and I think there must be an easier way
> to do this.
>
> Could anyone help me please?
>
> Thanks in advance.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to