1. Check out our app, Forums for Android! Download and leave feedback here!

Unable to simulate GPS track with the Emulator

Discussion in 'Application Development' started by MrRalphMan, Nov 24, 2010.

  1. MrRalphMan

    MrRalphMan Member
    Thread Starter
    15

    Aug 1, 2010
    17
    0
    15
    Computer Operator and Incident Manager
    Billericay, UK
    I am having issues trying to debug an GPS application as I cannot get a mock GPS signal working within the emulator.

    I have tried loading GPX and KML files, to no avail. These have been created by either online apps converting nmea files or saving the KMX file in Google Earth and converting to KML.

    I attempted to push a KML file to the emulator in the /data/misc/location/gps location, but the emulator would not turn off hanging on shutdown. When I restarted it the file and the location directory, which I had to create, did not exist.

    How can I get a GPS stream emulated so I can track down an annoying little bug?

    Many Thanks,

    Paul.
     

    Advertisement

  2. miXer

    miXer Well-Known Member
    53

    Aug 12, 2010
    313
    51
    53
    Norway
    GPS and sensors are noe emulator friendly. You should debug those things on a real device.
     
  3. MrRalphMan

    MrRalphMan Member
    Thread Starter
    15

    Aug 1, 2010
    17
    0
    15
    Computer Operator and Incident Manager
    Billericay, UK
    I'd love to debug this on a real device, but I need to emulate the device moving. Unless I take the laptop onto the train or something.

    Basically I have an activity that works fine and I get the Unit's speed, but if the screen rotates I no longer get the speed. The locationchanged event is still fired as the distance is calculated correctly, just the speed stops.

    I have another activity with a google maps display on it, with an overlayed speed textbox, this one works fine.

    It has the same code to create the locationchanged event, just has a time param of 10 seconds instead of the 1 sec of the activity does not work.

    I've tried several example of the net, but nothing seems to work.

    Cheers

    Paul
     
  4. miXer

    miXer Well-Known Member
    53

    Aug 12, 2010
    313
    51
    53
    Norway
    What if you add this to the activity in androidmanifest.xml: android:configChanges="keyboardHidden|orientation"
     
    MrRalphMan likes this.
  5. MrRalphMan

    MrRalphMan Member
    Thread Starter
    15

    Aug 1, 2010
    17
    0
    15
    Computer Operator and Incident Manager
    Billericay, UK

    Thanks, initial reading looks like this could solve my issue. Gonna do a little reading up on this and then give it a go.

    Cheers,

    Paul.
     
  6. MrRalphMan

    MrRalphMan Member
    Thread Starter
    15

    Aug 1, 2010
    17
    0
    15
    Computer Operator and Incident Manager
    Billericay, UK
    I know it's a bit late, but this did solve my issues, although I now suspect that it was one of my variables not being recreated properly when the Activity was destroyed and recreated.

    I would dearly love to get the track emulation working in the emulator though.

    Anyone had anyjoy getting this to work?

    Paul.
     
  7. JamTheMan

    JamTheMan Well-Known Member
    38

    For starters, does the normal single-point position emulation work?
     

Share This Page

Loading...