Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>In my experience, Android won't acquire a location just because your Wi-Fi will inherit that to the Emulator.</p> <p>You need to follow some steps:</p> <ol> <li><p>Be sure to have the following permissions in your Android Manifest:</p> <p>android.permission.INTERNET</p> <p>android.permission.ACCESS_NETWORK_STATE</p> <p>android.permission.ACCESS_COARSE_LOCATION</p> <p>android.permission.ACCESS_FINE_LOCATION</p> <p>android.permission.ACCESS_LOCATION_EXTRA_COMMANDS</p> <p>android.permission.ACCESS_MOCK_LOCATION</p> <p>android.permission.CHANGE_WIFI_STATE</p> <p>android.permission.ACCESS_WIFI_STATE</p></li> <li><p>Be sure to have the maps library in your Application tag:</p> <pre><code>&lt;application android:icon="@drawable/ic_launcher" &gt; &lt;uses-library android:name="com.google.android.maps" /&gt; &lt;/application&gt; </code></pre></li> <li><p>Be sure to have a valid Maps API Key in your MapView in your /layout/map.xml file.</p></li> <li><p>Because you are not running your App on an actual device, the only way to send different locations to your App is to push a MOCK LOCATION. To do so, simply Launch your App in the Emulator, go to the DDMS perspective in Eclipse IDE, and look for the options on the left (reset the DDMS perspective if you can't find them). It should look like this:</p></li> </ol> <p><img src="https://i.stack.imgur.com/A45TY.png" alt="enter image description here"></p> <p>Select the Emulator Name under the "Devices" Tab, then you can send Latitude and Longitude coordinates using the "Location Controls".</p> <p>When you are done developing and testing, be sure to remove the ACCESS_MOCK_LOCATION permission and to test the location detection on an actual phone or tablet with either GPS, aGPS chip or Cellular/Wifi Network.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload