Does LocationProvider work?

Put your problem here if it does not fit any of the other categories.

Does LocationProvider work?

Postby xayide » Tue Mar 25, 2008 8:20 pm

Hello!

I´m trying to get my location with this code:

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. this.myLocationManager = (LocationManager)getSystemService(Context.LOCATION_SERVICE);
  2.  
  3.                             List<LocationProvider> providers = this.myLocationManager.getProviders();
  4.  
  5.                             LocationProvider provider = providers.get(0);
  6.  
  7.                              
  8.  
  9.                             this.myLocationManager.requestUpdates(provider, MINIMUM_TIME_BETWEEN_UPDATE, MINIMUM_DISTANCECHANGE_FOR_UPDATE, new Intent(MY_LOCATION_CHANGED_ACTION));
  10.  
  11.                             this.myLocation = myLocationManager.getCurrentLocation("gps");
  12.  
  13.                             Log.d( "myPosition", myLocation.toString() );
Parsed in 0.031 seconds, using GeSHi 1.0.8.4


But it gives me to me so many errors that i can´t write all of them here.

This code is into a try-catch method.
Does the emulator have any default position? do i have to give a location to it? does getProviders() method work?

In resume, does anything of this work?

thanks!!
regards!
xayide
Junior Developer
Junior Developer
 
Posts: 20
Joined: Tue Feb 05, 2008 1:23 pm

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: No registered users and 12 guests