Hi,
Hi,
>
> i had a similar problem using the geo fix command - only the first
> transmission of a newlocation worked.
> Look @ here:
>
> http://groups.google.com/group/android-developers/browse_frm/thread/3f4c9d83ddcf5815/afb76cb94ab3c217?hl=de#afb76cb94ab3c217
I saw this post, same day as mine ;-)
I "solved" the problem with a dirty hack:
@Override
public void onLocationChanged(Location loc) {
if (loc != null) {
String s = "";
s += loc.getLatitude();
s += " ";
s += loc.getLongitude();
Log.i("GPS", s);
}
else {
Log.i("Gps","loc_null");
}
* lm.removeUpdates(locationListener);
lm.requestLocationUpdates(
LocationManager.GPS_PROVIDER,
xxx,
xxx
locationListener); *
}
Crappy isn't it ?
Regards,
Olivier
>
> Problem occured on Windows Vista 64bit
>
> Greetings from Germany
>
> On 28 Apr., 11:09, olivier <[email protected]> wrote:
> > Hi all,
> >
> > I am currently trying to simulate GPS fixs with android emulator, but
> > I encountered some problems. I can run the app, clic on the send
> > button in the emulator control, but, only the first click provides a
> > position. I am running an ubuntu jaunty, eclipse and SDK 1.5, on a
> > french system with the locale EN_US
> > Here is my code :
> >
> > private class MyLocationListener implements LocationListener
> > {
> > @Override
> > public void onLocationChanged(Location loc) {
> > if (loc != null) {
> > String s = "";
> > s += loc.getLatitude();
> > s += " ";
> > s += loc.getLongitude();
> > Toast.makeText(getBaseContext(),
> > "Location changed : Lat: " +
> loc.getLatitude() +
> > " Lng: " + loc.getLongitude(),
> > Toast.LENGTH_SHORT).show();
> > Log.i("GPS", s);
> > }
> > else {
> > Log.i("Gps","loc_null");
> > }
> > }
> >
> > @Override
> > public void onProviderDisabled(String provider) {
> > // TODO Auto-generated method stub
> > Log.i("Gps","onProviderDisabled");
> > }
> >
> > @Override
> > public void onProviderEnabled(String provider) {
> > // TODO Auto-generated method stub
> > Log.i("Gps","onProviderEnabled");
> > }
> >
> > @Override
> > public void onStatusChanged(String provider, int status,
> > Bundle extras) {
> > // TODO Auto-generated method stub
> > Log.i("Gps","onStatusChanged : " + provider);
> > }
> > }
> >
> > public void onCreate(Bundle savedInstanceState) {
> > super.onCreate(savedInstanceState);
> > //---use the LocationManager class to obtain GPS locations---
> > lm = (LocationManager) getSystemService
> > (Context.LOCATION_SERVICE);
> >
> > locationListener = new MyLocationListener();
> >
> > lm.requestLocationUpdates(
> > LocationManager.GPS_PROVIDER,
> > 0,
> > 0,
> > locationListener);
> >
> > }
> >
> > Can you tell me what I am doing wrong ?
> >
> > Regards,
> >
> > Olivier
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
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
-~----------~----~----~----~------~----~------~--~---