nikhilvharamble / bus-stop-alarm

Automatically exported from code.google.com/p/bus-stop-alarm
MIT License
0 stars 0 forks source link

GPS location updater #33

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
 We  need one more class that updates gps location every given time. 
I implemented this class inside of MapPage.java at first and it worked 
fine. But when I try to put in separate file then code breaks. Please see 
code for class below.

//Separate class that updates gps location every given time

public class mapIt extends MapActivity {

        protected static class DispLocListener implements 
LocationListener {

        @Override
        public void onLocationChanged(Location location) {
        }

        @Override
        public void onProviderDisabled(String provider) {
        }

        @Override
        public void onProviderEnabled(String provider) {
        }

        @Override
        public void onStatusChanged(String provider, int status, 
Bundle extras) {
        }

    }

//need to add an extra field in MapPage.java:
private LocationListener locListenD;

//need to add these 3 lines of code at the end of onCreate method in 
//MapPage.java:
LocationManager lm = (LocationManager)
locListenD = new DispLocListener();
lm.requestLocationUpdates("gps", 6000L, 10.0f, locListenD);

Original issue reported on code.google.com by orkha...@gmail.com on 25 Feb 2010 at 8:46

GoogleCodeExporter commented 9 years ago
fixed in r161

Original comment by Da.Nu...@gmail.com on 1 Mar 2010 at 10:15

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Look in MapPage.java

What is the expected output? 
- GPS location has to be updated every given ms

What do you see instead?
- GPS searches for location only once

Original comment by orkha...@gmail.com on 12 Mar 2010 at 9:22