5

I want to test my app on an emulated device that does not have a GPS, and just have network location. I have created the hardware profile for a device without GPS.

How can I send a LAT/LONG location to this emulator using network location? The only option I see on the emulator is to send the location as GPS data point.

background

There are some platform changes affecting API 21 coming on 15 Oct 2016, and I would like to test the user experience for my app due to the changes. This include testing on emulated devices

  • with network location without GPS
  • with GPS without network location

According to https://developer.android.com/guide/topics/location/strategies.html#Permission, we now need to include either of the following uses-feature into the manifest

android.hardware.location.network or android.hardware.location.gps

my app requires either one of the two, so I included the following

<uses-feature
    android:name="android.hardware.location"  />
<uses-feature
    android:name="android.hardware.location.gps"
    android:required="false" />
<uses-feature
    android:name="android.hardware.location.network"
    android:required="false" />

The following questions contains some information regarding the changes:

When do I need android.hardware.location.gps and android.hardware.location.network? and

Android : create simulator without GPS hardware

Community
  • 1
  • 1
Angel Koh
  • 12,479
  • 7
  • 64
  • 91
  • 1
    @yong.k different question. I do not want to emulate a GPS location. I want to emulate a network location. They are different location providers. – Angel Koh Sep 22 '16 at 01:34
  • Also network delivers lot/lan, thus it's a duplicate. See also http://stackoverflow.com/questions/6775257/android-location-providers-gps-or-network-provider – tuergeist Sep 22 '16 at 03:09
  • 1
    @tuergeist, unfortunately, the question you list did not say how to emulate the positions with network location. GPS_PROVIDER and NETWORK_PROVIDER triggers different part of my codes (basically some visual cues on the UI). I want to test the parts relating to NETWORK_PROVIDER. – Angel Koh Sep 22 '16 at 03:17
  • 2
    @AngelKoh, I'm not an expert, but for me it looks like that what you want is impossible. http://stackoverflow.com/questions/2424564/activating-network-location-provider-in-the-android-emulator – tuergeist Sep 22 '16 at 03:24
  • 2
    Any update on this question? – LonsomeHell Apr 09 '18 at 08:57

0 Answers0