orenyodfat / lbm-client

Lazooz Location Based Mining App
1 stars 13 forks source link

App reports wrong speed #117

Closed orenyodfat closed 9 years ago

orenyodfat commented 9 years ago

Looking at the code ...does the following scenario is possible?:

I would suggest:

  1. Add a flag on the readWiFi so we will be sure there are no WiFi scan calls during scan.
  2. Log that case if it happened.
  3. Take a time stamp at onFinishScan and check that there is more than 10 seconds pass between the previous call at readWiFi entrance.

A question: Does the Utils.Wait(2000) call at the readWiFi (for the case there is no WiFi) is only for the WiFi thread?

orenyodfat commented 9 years ago

Current fix is not complete because the app ignore location changes and loos locations. I am suspecting the 2 seconds wait. If the original state of the WiFi was enable there is no wait of 2 seconds. If the original state of the WiFi was disable so there is a sequential wait of 2 seconds each scan ...why?

I suggest the following to remove the 2 seconds wait. 1.We do not need to turn WiFi on and Off continually...any way when we are moving it most of the time on. 2.At lbmservice.java line 987 -- (when there is a more than 10 KMH movement) enable wifi if it was not enable before.

  1. If you need to wait till it turn on ...so instead waiting 2000 mili ,check the status each 200 mili (10 times in a loop).
  2. Turn WiFi off on the 5 min gps timer finish (onFinish).