开发者

Creating wifi scanning as a android service

开发者 https://www.devze.com 2023-04-10 02:09 出处:网络
Currently writing a wifi positioning program an开发者_如何学God i need to scan the surrounding for active APs so as to calculate the current position of the user. However, user can set the time (0-10

Currently writing a wifi positioning program an开发者_如何学God i need to scan the surrounding for active APs so as to calculate the current position of the user. However, user can set the time (0-10 secs) at which the app initiate WiFi scanning (for example, 5 sec, the program would initiate WiFi scanning every 5 secs). And from what is stated in [here] (http://developer.android.com/reference/android/app/Service.html#WhatIsAService) and it says "application component representing either an application's desire to perform a longer-running operation while not interacting with the user or to supply functionality for other applications to use.". So was wondering whether it is best to create a Service in my program then running a TimerTask in this case?


In this case, i would use Service and TimerTask like here

0

精彩评论

暂无评论...
验证码 换一张
取 消