hey
im trying to use a kml file as a location provider and my lat and long
is always 0 ,
the code is:

LocationManager locationManager =
(LocationManager)getSystemService(Context.LOCATION_SERVICE);
Location myLocation = locationManager.getCurrentLocation("gps");
TextView eText = (TextView) findViewById(R.id.txt);
eText.setText("Current location is: lat: " + myLocation.getLatitude()
+ " long: " + myLocation.getLongitude());


the kml file is:
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://earth.google.com/kml/2.2";>
<Document>
<name>1065 Brea Mall, Brea, CA 92821.kml</name>
<StyleMap id="default_copy0+nicon=http://maps.google.com/mapfiles/kml/
pal3/icon60.png+hicon=http://maps.google.com/mapfiles/kml/pal3/
icon52.png">
<Pair>
<key>normal</key>
<styleUrl>#default_copy0+icon=http://maps.google.com/mapfiles/kml/pal3/
icon60.png</styleUrl>
</Pair>
<Pair>
<key>highlight</key>
<styleUrl>#default_copy0+icon=http://maps.google.com/mapfiles/kml/pal3/
icon52.png</styleUrl>
</Pair>
</StyleMap>
<Style id="default_copy0+icon=http://maps.google.com/mapfiles/kml/pal3/
icon52.png">
<IconStyle>
<scale>1.1</scale>
<Icon>
<href>http://maps.google.com/mapfiles/kml/pal3/icon52.png</href>
</Icon>
</IconStyle>
<LabelStyle>
<scale>1.1</scale>
</LabelStyle>
</Style>
<Style id="default_copy0+icon=http://maps.google.com/mapfiles/kml/pal3/
icon60.png">
<IconStyle>
<Icon>
<href>http://maps.google.com/mapfiles/kml/pal3/icon60.png</href>
</Icon>
</IconStyle>
</Style>
<Placemark>
<name>1065 Brea Mall, Brea, CA 92821</name>
<address>1065 Brea Mall, Brea, CA 92821</address>
<LookAt>
<longitude>-117.883593</longitude>
<latitude>33.916991</latitude>
<altitude>0</altitude>
<range>1000</range>
<tilt>0</tilt>
<heading>0</heading>
</LookAt>
<styleUrl>#default_copy0+nicon=http://maps.google.com/mapfiles/kml/
pal3/icon60.png+hicon=http://maps.google.com/mapfiles/kml/pal3/
icon52.png</styleUrl>
<Point>
<coordinates>-117.883593,33.916991,0</coordinates>
</Point>
</Placemark>
</Document>
</kml>

my properties file is:

requiresNetwork false
requiresSatellite false
requiresCell false
hasMonetaryCost false
supportsAltitude true
supportsBearing true
supportsSpeed false
repeat true
accuracy 100
powerRequirement 1

and i put the permission in the AndroidManifest.xml file are:
<uses-permission android:name="android.permission.ACCESS_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_GPS" />

and i dont have any other file in that directory beside the "kml" file
and "properties" file
and i tryed to stop the adb.exe and start the emulator again.
does someone know what is the problem ?
Thanks !
--~--~---------~--~----~------------~-------~--~----~
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]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to