Hi,

I'm trying to use directly the GPS Location Manager (without a
MapActivtiy) in the emulator.

LocationManager locationManager = (LocationManager)
getSystemService(Context.LOCATION_SERVICE);
Location location =
locationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER);
if (location != null){
   System.out.println("not null");
} else {
    System.out.println("null");
   }

If I try to access the GPS provider I receive "null" unless I start a
MapActvity before. After using a MapActivity the GPS provider is
running in the emulator and I can use it.

 My App used the following three permissions:

<uses-permission
android:name="android.permission.ACCESS_FINE_LOCATION"></uses-
permission>
<uses-permission android:name="android.permission.INTERNET"></uses-
permission>
<uses-permission
android:name="android.permission.ACCESS_MOCK_LOCATION"></uses-
permission>

I'm also sending geo data to the emulator:

geo fix 13.24 52.31

On the emulated device GPS is also activated.

Am I'm missing something?

Best regards, Lars



-- 
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

Reply via email to