Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3783240
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T11:11:47+00:00 2026-05-19T11:11:47+00:00

Is it a way to test GPS in emulator? I know how to send

  • 0

Is it a way to test GPS in emulator?

I know how to send a single coordinate, I saw also possibility to load GPX- oder KML-files (haven’t try it really), but what I mean, it would be nice to have some component, which would send coordinates periodically emulating normal human motion 🙂

Maybe there are possibilities to do it programmatically?

Thank you very much for any advice or link.

Mur

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T11:11:48+00:00Added an answer on May 19, 2026 at 11:11 am

    I wrote a rough and ready java console app to implement a telnet client and read from a file of coordinates. It’s not the prettiest code, but it works:

    import org.apache.commons.net.telnet.TelnetClient;
    
    import java.io.BufferedReader;
    import java.io.FileNotFoundException;
    import java.io.FileReader;
    import java.io.IOException;
    import java.io.InputStream;
    import java.io.PrintStream;
    import java.text.DecimalFormat;
    import java.text.NumberFormat;
    
    public class AutomatedTelnetClient {
       private TelnetClient telnet = new TelnetClient();
       private InputStream in;
       private PrintStream out;
       private String prompt = "#";
    
       public AutomatedTelnetClient(String server, String user, String password) {
          try {
             // Connect to the specified server
             telnet.connect("127.0.0.1", 5554);
             // Get input and output stream references
             in = telnet.getInputStream();
             out = new PrintStream(telnet.getOutputStream());
    
             readUntil("OK");
             sendGeoFixes("c:\\junk\\esk.txt");
             System.out.println("Finished");
          } catch (Exception e) {
             e.printStackTrace();
          }
       }
    
       private void delay() {
          long t = System.currentTimeMillis();
          long finish = t + 15000;
          boolean loop = true;
          while (loop) {
             t = System.currentTimeMillis();
             if (t > finish)
                loop = false;
          }
       }
    
       private void sendGeoFixes(String fn) {
          boolean loop = true;
          String line;
          BufferedReader br = null;
          String lat, lon;
    
          String formatStr = "000.000000";
          NumberFormat formatter = new DecimalFormat(formatStr);
          String gf = "geo fix ";
          try {
             br = new BufferedReader(new FileReader(fn));
             do {
                try {
                   line = br.readLine();
                   if (line == null)
                      break;
                   String sa[] = line.split(",");
                   if (sa.length < 2)
                      break;
                   lat = sa[0];
                   String slat = formatter.format(Float.parseFloat(lat));
                   lon = sa[1];
                   String slon = formatter.format(Float.parseFloat(lon));
                   String sFix = slat + " " + slon;
                   write(gf + sFix);
                   String ans = readUntil("OK");
                   System.out.println(ans);
                   delay();
          } catch (IOException e) {
                   // TODO Auto-generated catch block
                   e.printStackTrace();
                }
             } while (loop);
          } catch (FileNotFoundException e) {
             // TODO Auto-generated catch block
             e.printStackTrace();
          }
       }
    
       public String readUntil(String pattern) {
          try {
             char lastChar = pattern.charAt(pattern.length() - 1);
             StringBuffer sb = new StringBuffer();
             char ch = (char) in.read();
             while (true) {
                System.out.print(ch);
                sb.append(ch);
                if (ch == lastChar) {
                   if (sb.toString().endsWith(pattern)) {
                      return sb.toString();
                   }
                }
                ch = (char) in.read();
             }
          } catch (Exception e) {
             e.printStackTrace();
          }
          return null;
       }
    
       public void write(String value) {
          try {
             out.println(value);
             out.flush();
             System.out.println(value);
          } catch (Exception e) {
             e.printStackTrace();
          }
       }
    
    
       public static void main(String[] args) {
          try {
             AutomatedTelnetClient telnet = new AutomatedTelnetClient(
                   "127.0.0.1", "username", "password");
          } catch (Exception e) {
             e.printStackTrace();
          }
       }
    }
    

    The “esk.txt” file has the following format:

    -1.059408,54.476764
    -1.056685,54.477731
    -1.048233,54.479462
    -1.044054,54.479968
    -1.038213,54.482259
    -1.034194,54.482496
    -1.027904,54.480873
    -1.01868,54.479361
    -1.017364,54.47953
    

    etc

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there a way to test the multitouch capability of an application using a
Is there a way to test if the current thread is holding a monitor
Is there a way to test to see if javascript is enabled to ensure
Is there a way to test, using Python, how long the system has been
Is there a canonical way to test to see if the process has administrative
Is there a good way to test whether I am logging into a text
What is the best way to test web service using NUnit. I want it
What is the best way to test an implementation of a mutex is indeed
Whats the best/easiest way to test for administrative rights in a PowerShell script? I
Is there an easy way to test if the current directory is inside a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.