1

I'm developing a WIFI positioning system. Location of a user is determined based on signal strength value (RSSI) from each access point.

My application should collect WIFI signal strength from each access point periodically and update marker on a map.

My application is able to collect wifi signal strength from each access point. However, I face problem in collecting signal strength periodically (eg: 2 seconds). I also face problem in updating marker on a map periodically. FYI, I successfully overlay marker on top of a custom map.

Solution: Timer? Handler?

I need your suggestion and help. Thanks in advance.

alvin8866
  • 65
  • 2
  • 9

2 Answers2

1

You should use a Handler for this. See this topic: Repeat a task with a time delay?

To actually update your 'markers' depends on how you implemented them. Are they items in an ItemizedOverlay? If so you can change the drawable you use to display them by calling overlayItem.setMarker(drawableMarker).

Community
  • 1
  • 1
skynet
  • 9,898
  • 5
  • 43
  • 52
  • I saw the topic before posting my problem. My Eclipse prompts me an error in Runnable. – alvin8866 Nov 15 '11 at 02:44
  • The topic: repeat a task with a time delay My eclipse prompts me an error during compilation instead of runtime. I think the code (Runnable) is not correct. – alvin8866 Nov 15 '11 at 03:05
  • Yes, clearly. But if you don't show us what code you are using it is impossible to help you – skynet Nov 15 '11 at 03:12
  • Here is the screenshot of Eclipse. Error 1: The method UpdateStatus() is underfined for the type new Runnable() Error 2: m_interval cannot be resolved to a variable http://forum.lowyat.net/index.php?act=Attach&type=post&id=2536852 – alvin8866 Nov 15 '11 at 06:42
  • my problem is solved. I use Handler and Runnable. Thank you for your help. If you have better solution, please let me know. Thank you very much – alvin8866 Nov 15 '11 at 11:56
-1

Is this a browser based app? If so you can do a call a method which calls itself using setTimeout. Thats the easiest way.

In between if you had to get something off the server you could use ajax which means you dont need to refrest the page.

Sid Malani
  • 2,078
  • 1
  • 13
  • 13