Pregunta

When I run the App on android emulator and pass the longitude and latitude values from DDMS i get the proper values and also the city name but when I install the .apk file into real device the values of longitude and latitude is set to 0.0 and 0.0. I turned on the gps and every other settings required but still unable to get the co-ordinates.

Manifest file:

 <uses-sdk
    android:minSdkVersion="8"
    android:targetSdkVersion="17"        />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />

<application android:label="@string/app_name" android:icon="@drawable/ic_launcher">
    <activity android:name="MainActivity"
              android:label="@string/app_name">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
</application>
¿Fue útil?

Solución

Add <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"></uses-permission> too in manifest..

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top