Motorola

From OpenStreetMap Wiki
(Redirected from Motorola A780)
Jump to: navigation, search

A780

A780

GPS unit: Motorola A780

  • 70€
  • PDA (Navigation: )
  • CPU: (OS: ), Flash:48MB (external: sd)
  • GPS: channels, ( , )
  • Display: , Connectivity: usb; bluetooth
  • Internal: Batteries:
Addresses POIs
Mass Storage mode ? Waterproof


The Motorola A780 Linux mobile phone with build-in GPS receiver can be used with the BikeAtor-Software to track GPS. New versions of BikeAtor directly store tracklogs in GPX format compatible with JOSM.


The original battery only lasts about 2 hours, but of course it could be replaced with one of a higher capacity to easily double the time. Other devices might give more exact results, but keep in mind: It's a cellphone with full navigation on board! No need for thinking about if you will or won't need your GPS - it's there, because you won't leave your cellphone at home, will you?


Tracking

This Mobile does GPS tracking - but its format needs conversion. I will publish some conversion tool soon. This is just a sample from a log file:

StDate     StTime   EndDate    EndTime       StLat     EndLat      StLong     EndLong Fix Total     Total #OfObs
(UTC)      (UTC)    (UTC)      (UTC)                                                      Miles     Hours
----------------------------------------------------------------------------------------------------------------
08/23/2008 09:11:15 08/23/2008 09:15:50  52.029861  52.039635    8.555399    8.598636 1 -3649860701231198131961668199318255273253704759060934360615150772018946839312983390068665767128059356237740002978924188506914396338678317267284591053595745998525189226233856.00     0.000 768152
08/23/2008 09:15:53 08/23/2008 09:17:04  52.039892  52.037446    8.599602    8.614022 1 -78118279941557931703363451455652206793696749610332198789022918111496705774753948327901293097707913114779364083391770081968424685419280192230328808432059202942449336286932111339638257750450957502640494359747686692974231552.00     0.000 768152
08/23/2008 09:17:09 08/23/2008 09:17:28  52.037435  52.037543    8.613871    8.613807 1   -0.00     0.000 768152
08/23/2008 09:17:46 08/23/2008 09:18:12  52.037328  52.039549    8.614043    8.617584 1   -0.00     0.000 768152
08/23/2008 09:18:15 08/23/2008 09:19:43  52.040010  52.047724    8.618184    8.635565 1 -344646659481965599028466738922047546765953134524746744268617381020796015676674827437106811168638611102639620443121993900825615697463858624748128071954920622070466913444633264051453952.00     0.000 768152
08/23/2008 09:19:46 08/23/2008 09:25:32  52.048389  52.066178    8.635329    8.662022 1 -438278375512559217652056156777336964928373076093870088506703880101717226850843193135491371767624957503494869835647695687123337567729156216808571666432.00     0.000 768152
08/23/2008 09:25:36 08/23/2008 09:28:46  52.067304  52.101261    8.662473    8.718177 1 30068130744005489155484081831838965166576489273498100822888867340749494086281791865200369474663529612734774394515077434054123978752.00     0.000 768152

Trackpoint.java (preliminary class to store trackpoints)

public class Trackpoint{
	public java.util.Date date;
	public java.util.Date enddate;
	public double stLat, endLat, stLong, endLong;
	public int fix;
	public String totMiles;
	public double totHours;
	public long ofObs;
	
	public Trackpoint()
	{
		date=new java.util.Date();
		enddate=new java.util.Date();
		
	}
}

trackA780.java (Main Class)

import java.io.*;


public class trackA780 {
  /**
   * 
   */
  private static String trackfile="/var/misc/A780-uflash/copilot/save/Aug08Trip.log";
  private  static java.util.Vector<Trackpoint> pts;
    /**
     * @param args
     */
    
    public static void main(String[] args) {
      // TODO Auto-generated method stub
      int nol = -3; // number of lines
        StringBuilder contents = new StringBuilder();
       
        int state = 0;
        pts = new java.util.Vector<Trackpoint>();
        System.out.println("Args: "+args[0]+", "+args[1]);
        try {
          //use buffering, reading one line at a time
          //FileReader always assumes default encoding is OK!
            File inFile = new File(trackfile);
            File outFile = new File("/tmp/trackA780.csv");
      
          BufferedReader input =  new BufferedReader(new FileReader(inFile));
          BufferedWriter output = new BufferedWriter(new FileWriter(outFile));

          try {
            String line = null; //not declared within while loop
            /*
            * readLine is a bit quirky :
            * it returns the content of a line MINUS the newline.
            * it returns null only for the END of the stream.
            * it returns an empty String if two newlines appear in a row.
            */
          
            

            while (( line = input.readLine()) != null)
            {
             
              contents.append(line);
              contents.append(System.getProperty("line.separator"));
              if (nol>=0)
              {
                Trackpoint pt = new Trackpoint();
                java.util.StringTokenizer tok = new java.util.StringTokenizer(line);
            //    System.out.println("Tokens: "+tok.countTokens());
                pt.fix=0;
                java.util.Date d0 = parseDate(tok.nextToken(),tok.nextToken());
                pt.date = d0;
                pt.enddate=parseDate(tok.nextToken(),tok.nextToken());
                pt.stLat = (double) Double.parseDouble(tok.nextToken());
                pt.endLat = (double) Double.parseDouble(tok.nextToken());
                pt.stLong = (double) Double.parseDouble(tok.nextToken());
                pt.endLong = (double) Double.parseDouble(tok.nextToken());
                pts.add(pt);
              }   
              nol++;
            }
            System.out.println("Eingelesen: "+nol+" Zeilen...");
            for (Trackpoint e : pts)
            {   
              output.write(e.stLat+","+e.stLong+",s "+e.date.toString()+"\n");
              output.write(e.endLat+","+e.endLong+",e "+e.enddate.toString()+"\n");
              
            }
                
            
          }
          finally {
            input.close();
            output.close();
          }
        }
        catch (IOException ex){
          ex.printStackTrace();
        }
        

    }
    private static java.util.Date parseDate(String datum,String zeit)
    {
      java.util.StringTokenizer tok = new java.util.StringTokenizer(datum,"/",false);
      
      int m = Integer.parseInt(tok.nextToken());
      int d = Integer.parseInt(tok.nextToken());
      int y = Integer.parseInt(tok.nextToken());
      tok = new java.util.StringTokenizer(zeit,":",false);
      int hh = Integer.parseInt(tok.nextToken());
      int mm = Integer.parseInt(tok.nextToken());
      int ss = Integer.parseInt(tok.nextToken());
      
      java.util.Date dat = new java.util.Date(y-1900,m-1,d,hh,mm,ss);
      System.out.println("Umwandeln von "+datum+zeit+" in "+d+"."+m+"."+y+" -> "+dat);
      return dat;
      
      
    }
  }