Hi,
I'm working with android.Location with a simulator of coordinates that
sends them to the emulator:

import java.io.IOException;
import java.io.PrintWriter;
import java.net.Socket;
import java.net.UnknownHostException;
import java.util.Random;
import java.io.*;
import java.util.*;


public class MovementSimulator {

        private static final String hostname = "localhost";             // 
Hostname or
IPAddress of the host where the emulator is running
        private static final int port = 5554;                                   
// Android's console port

        private static final double initialLatitude = 11;               // 
Initial
Latitude
        private static final double initialLongitude = 11.1;    // Initial
Longitude

        private static final int millisecondsUpdate = 1000;             // 
Milliseconds
to wait between two consecutive fixes

        public static void main(String[] args) {
                try {
                        System.out.println("[+] GPS Movement Simulator 
Started.");
                        Socket link = new Socket(hostname,port);
                        PrintWriter out = new 
PrintWriter(link.getOutputStream());

                        System.out.println("[+] Connected to Android's 
emulator.\n");

                        while (true) {
                                latitude += generator.nextGaussian();
                                longitude += generator.nexGaussian();

                                System.out.println("[*] Sending fix: 
"+latitude+" "+longitude);
                                out.println("geo fix "+latitude+" "+longitude);
                                out.flush();

                                Thread.sleep(millisecondsUpdate);
                        }

                } catch (UnknownHostException e) {
                        e.printStackTrace();
                } catch (IOException e) {
                        e.printStackTrace();
                } catch (InterruptedException e) {
                        e.printStackTrace();
                }

        }

}


but when the emulator receives the coordinates they are not the same
that the simulator sends, they are only similar.It si a problem of the
emulator?

An example I send:
12.002000666666667 44.007333599999995
12.001069999999999 44.00733346666666
12.000299999999999 44.007333599999995
12.000030999999999 44.00733373333334
12.000010099999999 44.00733400000001
12.000000133333334 44.00733400000001
12.000000266666668 44.00733400000001
12.000000500000002 44.00733400000001
12.000001066666667 44.00733373333334
12.000001666666667 44.008333599999995
12.000000666666667 44.00933346666666
12.000000490000002 44.01033346666666
12.000000266666668 44.01083346666666
12.000000133333334 44.012033346666666
12.000000150333334 44.012033346666666
12.001999999999999 44.00733333333333
11.985169433333333 44.00733333333333
11.985169383333334 44.00733333333333
11.985169383333334 44.00733346666666
11.985169383333334 44.007333599999995
11.985169433333333 44.007333599999995
12.002000133333334 44.007333599999995
12.001999999999999 44.00733346666666
12.002000666666667 44.00733346666666
12.002001 44.00733346666666
12.002001416666667 44.007333599999995
12.00200165 44.00733366666667
12.002001833333335 44.00733391666666
12.002001833333335 44.007334166666666

and the emulator receives(reads from right to left):

44.007334549999996 12.002000333333335***
44.007334549999996 12.002000166666669***
44.007334549999996 12.00200005***
44.007334549999996 12.001999999999999***
44.007334549999996 12.001999999999999***
44.007334549999996 12.001999999999999***
44.007334549999996 12.001999999999999***
44.007334549999996 12.001999999999999***
44.007334549999996 12.001999999999999***
44.007334716666676 12.001999999999999***
44.007334883333336 12.001999999999999***
44.00733505 12.001999999999999***
44.00733533333334 12.001999999999999***
44.00733533333334 12.001999999999999***
44.007334549999996 12.002000316666665***
44.007334549999996 11.985166966666668***
44.007334549999996 11.985166966666668***
44.007334549999996 11.985166966666668***
44.007334549999996 11.985166966666668***
44.007334549999996 11.985166966666668***
44.007334549999996 12.002000333333335***
44.007334549999996 12.002000316666665***
44.007334549999996 12.002000333333335***
44.007334549999996 12.002000333333335***
44.007334549999996 12.002000333333335***
44.007334549999996 12.002000333333335***
44.007334549999996 12.002000333333335***
44.007334549999996 12.002000333333335***

I'm trying to use also  the Emulator Control(from Eclipse) but when I
send a coordinates to the device nothing happend..
Any Idea?
thanks
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to