I have downloaded some gpx files from this web
http://tramper.co.nz/?view=browsegpxFiles

So. DDMS location tool loads them ok..I am able to se both the points
and the track...and when I pressed the button "play" it seems that is
processing the file...but my test application does not receive
anything.

Ludwig, can you please write in this thread a brief example of a GPX
file that works for you? Maybe the problem is related with the gpx I
have downloaded

I include also some of my test code, maybe there is somthing I have
misssed

By the way, I am running on Windows XP SP2 ...

Thanks in advance

public class LocationTest extends MapActivity implements
LocationListener {

        private LocationManager mLocationManager= null;
        private LocationProvider mLocationProvider = null;
        private MapView mMapView = null;

    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        mLocationManager =
(LocationManager)getSystemService(Context.LOCATION_SERVICE);
        Criteria criteria = new Criteria ();
        criteria.setAccuracy(Criteria.ACCURACY_FINE);
        List<String> providerIds
=mLocationManager.getProviders(criteria, true);
        if (!providerIds.isEmpty()) {
                mLocationProvider =
mLocationManager.getProvider(providerIds.get(0));
        }

        mMapView = new MapView(this, "tid");
        mMapView.getController().setZoom(20);
        setContentView(mMapView);

        MyLocationOverlay myLocationOverlay = new MyLocationOverlay
(this, mMapView);
        mMapView.getOverlays().add (myLocationOverlay);
        myLocationOverlay.enableMyLocation();

        // Para que si me muevo mire constantemente la localizacion
 
mLocationManager.requestLocationUpdates(mLocationProvider.getName(),
0, 0, this);
    }

     @Override
    protected boolean isRouteDisplayed() {
           return false;
    }

     public void  onLocationChanged(Location location) {
            updateView(location);
     }

     public void  onProviderDisabled(String provider) {
     }
     public void  onProviderEnabled(String provider) {
     }
     public void  onStatusChanged(String provider, int status, Bundle
extras) {
     }
     private void updateView (Location location) {
          Double lat = location.getLatitude()*1E6;
          Double lng = location.getLongitude()*1E6;
          GeoPoint point = new GeoPoint(lat.intValue(),
lng.intValue());
          mMapView.getController().setCenter(point);
    }
}




On 24 sep, 18:06, Ludwig <[EMAIL PROTECTED]> wrote:
> I do not have a problem playing GPX files from DDMS and my code continues to
> work ok with 1.0.
> The only change required was to remove the calls to the two methods you
> mention when subscribing to location updates.
>
> (I am running on Vista, just in case this is a platform issue)
>
> Ludwig
>
> 2008/9/24 Cristina <[EMAIL PROTECTED]>
>
>
>
>
>
> > Hi!
>
> > I have downloaded SDK 1.0 this morning, so I have tried to migrate
> > some code I have to this version.
> > When trying to migrate MockLocationProvider I found that some methods
> > have dissapeared from LocationManager:
> > setTestProviderEnabled
> > addTestProvider
>
> > It seems that it not possible to create a Mock Provider by code any
> > more...
>
> > I have also checked DDMS Location controls, but they seem to not be
> > working either in this version.
> > Maybe I am doing something wrong, but I have tried kml and gpx. In
> > both cases my kml/gpx files loads ok, but when I click on "play"
> > button, my application does not receive the locations.
>
> > I have test the geo command, and it works...so by the moment I am
> > using this, although it is a little hard to write every point in order
> > to do tests...
>
> > Has anybody managed to make DDMS locations tools to work in 1.0? Is it
> > possible to create a mock location provider by code in this version?
> > Is there any other way to automate this? maybe an script that calls
> > geo utility?
>
> > Thanks in advance- Ocultar texto de la cita -
>
> - Mostrar texto de la cita -
--~--~---------~--~----~------------~-------~--~----~
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
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to