Click here to Skip to main content
Click here to Skip to main content

A GPS tracer application for Windows Mobile CE 5

By , 22 May 2007
 

Screenshot

Introduction

This is a simple GPS tracer developed for Window Mobile 2005/2003 on Compact Framework 2.0 SDK. So first of all, you need VisualStudio 2005 and Windows Mobile CE 5 SDK. You can develop it on emulator devices or on a real device. As you can see in that photo, I developed that application on a read device: the great Asus MyPal 636N.

Screenshot

How it works: background

The screenshot above shows that the map generated by this application is very simple. It's only your path, and the application is able to:

  • Read data from any NMEA GPS device
  • Read your position and print it to the screen
  • Load and save your path
  • Zoom in/out
  • Pan on your path
  • Center on the map
  • Run in demo mode with randomly generated data

You can save and load it, but for now you can't edit or add other text. About application setup, it's very simple: you have only to setup your COM port. This port must be that same port where your NMEA device is attached via Bluetooth, IrDA or Integrate. Personally, I have an Asus MyPal 636N device, so I have the GPS device built-in on COM5.

Using the code

It's basically composed of three main actors, similar to a simple MVC pattern:

Form (Control): It's the main form of the application, so it contains the Windows UI (menu, controls...)

Reader (Model): It's the class that works with the GPS device, so it allows reading from serial with a threaded method

Mapper (View): It's the actor that parses the GPS NMEA phrases and draws them on-screen; it also allows the user to zoom and pan the map that contains the path

Form

It initializes the application; as you can see it's able to run on 240px X 320px devices.

        public Form1()
        {
            InitializeComponent();
            m_graphics = this.CreateGraphics();
            m_mapper = new Mapper(m_graphics, 0, 30, 240, 300);
            m_rTh = new reader(m_port);
            m_rTh.dataReceived += new reader.DataReceivedEventHandler(parse);
        }

The event registered method is called on the DataReceived event. With m_isDemoMode==True, the application will generate a randoom coordinate.

        public void parse(String readed)
        {
            if (!m_isDemoMode)
            {
                m_mapper.parseAndDraw(readed);
            }
            else
            {
                Random r = new Random();
                String rSecond1 = (int)(r.NextDouble() * 10 - 1) + "" + 
                                  (int)(r.NextDouble() * 10 - 1) + "" + 
                                  (int)(r.NextDouble() * 10 - 1) + "" + 
                                  (int)(r.NextDouble() * 10 - 1);
                String rSecond2 = (int)(r.NextDouble() * 10 - 1) + "" + 
                                  (int)(r.NextDouble() * 10 - 1) + "" + 
                                  (int)(r.NextDouble() * 10 - 1) + "" + 
                                  (int)(r.NextDouble() * 10 - 1);
                String rPrime1 = (int)(r.NextDouble() * 1 - 1) + "";
                String rPrime2 = (int)(r.NextDouble() * 1 - 1) + "";

                m_mapper.drawLatLong("434" + rPrime1 + "." + rSecond1, 
                                     "0111" + rPrime2 + "." + rSecond2);
            }
        }

This is the method that starts and stops the Readed thread.

        private void menuItemRunStop_Click(object sender, EventArgs e)
        {
            if (m_isRunning)
            {
                m_rTh.stop();
            }
            else
            {
                m_rTh.start();
            }
            menuItemRunStop.Checked = !menuItemRunStop.Checked;
            m_isRunning = !m_isRunning;
        }

This is the region that solves problem of panning the map on your touchscreen device. You can enable m_mapper.clearAndDraw() and it will clear the screen before it redraws the moved map.

        #region Panning

        private Point touch;
        private void Form1_MouseMove(object sender, MouseEventArgs e)
        {
            if (m_mapper != null)
            {
                m_mapper.moveCenter(touch.X - e.X, touch.Y - e.Y);
                m_mapper.draw();//m_mapper.clearAndDraw();
            }
            touch.X = e.X;
            touch.Y = e.Y;
        }

        private void Form1_MouseDown(object sender, MouseEventArgs e)
        {
            touch.X = e.X;
            touch.Y = e.Y;
        }


        private void Form1_MouseUp(object sender, MouseEventArgs e)
        {
            Form1_MouseMove(sender, e);
            m_mapper.clearAndDraw();
        }

        #endregion

Reader

Event exposed to Form on data received:

        public delegate void DataReceivedEventHandler(string data);
        public event DataReceivedEventHandler dataReceived;

The thread method that reads on serial port:

        private void methodTh()
        {
            m_serialPort1.Open();
            byte[] buffer= new byte[100];
            while (m_run)
            {
                Thread.Sleep(500);
                m_readed = m_serialPort1.ReadLine();
                if (m_readed.Length > 0)
                {
                    dataReceived(m_readed);
                }
            }
        }

These methods allow the Form to start and stop the reader thread:

        public void start()
        {
            if (m_th == null)
            {
                m_th = new Thread(methodTh);
            }
            m_run = true;
            m_th.Start();
        }

        public void stop()
        {
            m_run = false;
            Thread.Sleep(500);
            m_serialPort1.Close();
            if (m_th != null)
            {
                m_th.Abort();
                m_th = null;
            }
        }

Mapper

Now follow me through the Mapper section. This is a simple method that parses the data read from the Reader. It's called by the Form on a DataReceivedEvent.

        public void parseAndDraw(string s)
        {
            string[] Words = s.Split(',');

            m_g.FillRectangle(m_bgBrush, new Rectangle(m_clip.X, 
                                         m_clip.Y + 5, m_clip.Width, 15));
            m_g.DrawString(s, m_font,m_fontBrush, new RectangleF(m_clip.X ,
                           m_clip.Y + 5, m_clip.Width, 15));

            switch (Words[0])
            {
                case "$GPRMC":
                // $GPRMC,170111,A,4338.5810,N,07015.1010,W,000.0,
                //        360.0,060199,017.5,W*73
                    // RMC - Recommended minimum specific GPS/Transit data

                    if (Words[3].Length > 0 && Words[5].Length > 0)
                    {
                        drawLatLong(Words[3], Words[5]);
                    }
                    break;
                case "$GPGSV":
                // $GPGSV,2,1,08,03,17,171,42,06,21,047,44,14,
                //        28,251,45,16,25,292,44*71
                    // GSV - Satellites in view
                    break;
                case "$GPGSA":
                // $GPGGA,170111,4338.581,N,07015.101,W,1,
                          00,2.0,1.1,M,-31.8,M,,*71
                    //GSA - GPS dilution of precision and active satellites
                    break;
                default:
                    break;
            }
        }

The drawLatLong() method allows conversion of the latitude and longitude data. In the example, latitude:43 38.5810 will be converted to 162710 using the formula 43*360+34*60+5810. At the end of parsing and conversion, it will add the data to the private List<POINT> m_points; and later it will call the method draw(). This method will draw all of the lines that were not drawn before. Obviously, on pan or application start this method will draw all points.

public void drawLatLong(string latitude, string longitude)
{

    Point aPoint = new Point();

    aPoint.X = 
      (Convert.ToInt32(latitude.Substring(latitude.Length - 4, 4)));
    aPoint.Y = 
      (Convert.ToInt32(longitude.Substring(longitude.Length - 4, 4)));

    aPoint.X += 
      (Convert.ToInt32(latitude.Substring(latitude.Length - 7, 2))) * 60;
    aPoint.Y += 
      (Convert.ToInt32(longitude.Substring(longitude.Length - 7, 2))) * 60;

    aPoint.X += 
      (Convert.ToInt32(latitude.Substring(latitude.Length - 9, 2))) * 3600;
    aPoint.Y += 
      (Convert.ToInt32(longitude.Substring(longitude.Length - 9, 2))) * 3600;

    m_points.Add(aPoint);
    draw();
}

public void draw()
{
    float xTo = 0;
    float xFrom = 0;
    float yTo = 0;
    float yFrom = 0;
               
    for (int i = m_drawded; i < m_points.Count; i++)
    {
        xTo = (m_points[i].X - m_points[0].X) / m_scale + m_center.X;
        xFrom = (m_points[i - 1].X - 
                 m_points[0].X) / m_scale + m_center.X;
        yTo = (m_points[i].Y - m_points[0].Y) / m_scale + m_center.Y;
        yFrom = (m_points[i - 1].Y - m_points[0].Y) / 
                 m_scale + m_center.Y;
        m_g.DrawLine(m_linePen, (int)xTo, (int)yTo, 
                    (int)xFrom, (int)yFrom);
        m_g.DrawEllipse(m_pointPen, 
                        new Rectangle((int)xFrom - 2, 
                        (int)yFrom - 2, 4, 4));
    }

    m_g.DrawEllipse(m_lastPointPen, 
                    new Rectangle((int)xTo - 2, (int)yTo - 2, 4, 4));
    m_drawded++;
}

At the end, you can see the loadPath(...) and savePath methods. These methods are called by the form that asks the user the filename/location from the windows form dialog m_mapper.loatPath(openFileDialog1.FileName); m_mapper.savePath(saveFileDialog1.FileName);. So this simply loads/saves the private List<POINT> m_points; from/to a file.

        public void loatPath(String filename)
        {
            StreamReader sr = new StreamReader(filename);

            m_points.Clear();
            int n = 0;
            Point p = new Point();
            while (!sr.EndOfStream)
            {

                String readed = sr.ReadLine();
                p.X = Convert.ToInt32(readed);
                readed = sr.ReadLine();
                p.Y = Convert.ToInt32(readed);
                m_points.Add(p);
                n++;
            }
            m_drawded = 1;
            sr.Close();
            clearAndDraw();
        }

        public void savePath(String filename)
        {
            StreamWriter sw = new StreamWriter(filename);

            foreach (Point p in m_points)
            {
                sw.WriteLine(Convert.ToString(p.X));
                sw.WriteLine(Convert.ToString(p.Y));
            }

            sw.Flush();
            sw.Close();
        }

Points of interest

I know that this is a simple project for a skilled developer, but I want to demonstrate that the device development is very simple with VisualStudio2005 and CompactFramework 2.0. It's my first project on the great CodeProject website, so please contact me if you have any doubts or proposals. I'm always available for collaboration.

History

  • Start of development: 8/7/2006
  • First release: 8/9/2006
  • Second release : 8/10/2006
    • Added Center function
    • Now demo mode run without GPS or any serial port
    • Some and various fix
  • Article edited and posted to the main CodeProject.com article base: 5/22/2007

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

About the Author

leonardosalvatore
Architect Giuneco http://www.giuneco.it
Italy Italy
IT is not only work, it is a hobbie, for that i post here!

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board.
Search this forum  
    Spacing  Noise  Layout  Per page   
QuestionMultiple GPS device ?memberAshlesh25-Feb-09 21:10 
Can I attach the multiple GPS devices with a single Pocket PC Device? If yes then please explain me the COM Port settings for it.
 
Thanks.
AnswerRe: Multiple GPS device ?memberleonardosalvatore11-Mar-09 1:45 
Yes, you can absolutelly, and with some modification you could monitor a couple of devices...
About com port, you have to discover wich they are using that:
http://www.codeproject.com/KB/mobile/WMEnumComPorts.aspx[^]
GeneralCOM Port error - IOExceptionmemberVitorX24-Feb-09 16:53 
Hi, im trying to run this in Windows Mobile 6 with a Asus P526 (gps integrated), but crashes with this exception:
 
---> m_readed = m_serialPort1.ReadLine();
 
in System.IO.Ports.SerialPort.ThrowIfClosed()
in System.IO.Ports.SerialPort.ReadTo()
in System.IO.Ports.SerialPort.ReadLine()
in GpsTracer.reader.methodTh()
 
System.IO.IOException was unhandled
Message="IOException"
StackTrace:
in System.IO.Ports.SerialStream.WinIOError()
in System.IO.Ports.SerialStream..ctor()
in System.IO.Ports.SerialPort.Open()
in GpsTracer.reader.methodTh()
 
Should i configure the integrated gps with some specific data?
Thanks in advance...
GeneralRe: COM Port error - IOExceptionmemberleonardosalvatore25-Feb-09 21:05 
Hi,
Try to use the Windows Mobile 6 application GPSSettings.exe

[^]
 
Good luck with the GPS intermediate driver!
 
Leonardo Salvatore
Msn:leonardosalvatore@hotmail.com
Email:Leonardosalvatore@giuneco.it
WebSite:www.giuneco.it

GeneralRe: COM Port error - IOExceptionmemberVitorX27-Feb-09 1:40 
Windows Mobile 6, in this case, already has "GPSSettings.exe" integrated (this PDA has GPS integrated). I solve the COM Port problem, and now it turns on the GPS antenna, but dont return any location neither draw it. Is something missing?
GeneralRe: COM Port error - IOExceptionmemberleonardosalvatore11-Mar-09 2:00 
try to that, and tell to me on wich problem.
http://www.codeproject.com/KB/mobile/WMEnumComPorts.aspx[^]
 
To solve that i have to test on a win mo 6 (i don't have yet..) or an emulated device.
 
Leonardo Salvatore
Msn:leonardosalvatore@hotmail.com
Email:Leonardosalvatore@giuneco.it
WebSite:www.giuneco.it

QuestionIntermediate driver??membervivek_pawar4-Feb-09 21:53 
I have used Intermediate driver for GPS Parsing but my application migrated from Windows mobile 5.0 to Windows CE 5.0. so i am getting error PInvoke DLL ‘gpsapi.dll’ error.
is there intermediate driver present for Windows CE 5.0? or any diffrent dll or library
AnswerRe: Intermediate driver??memberleonardosalvatore25-Feb-09 21:03 
Hi, wich device are you using?
 
Leonardo Salvatore
Msn:leonardosalvatore@hotmail.com
Email:Leonardosalvatore@giuneco.it
WebSite:www.giuneco.it

GeneralRe: Intermediate driver??membervivek_pawar26-Feb-09 1:21 
Roper Mobile having Windows CE 5.0
GeneralRe: Intermediate driver??memberleonardosalvatore11-Mar-09 1:47 
uhm... it's should don't have nothing like that.
http://www.codeproject.com/KB/mobile/WMEnumComPorts.aspx[^]
 
Leonardo Salvatore
Msn:leonardosalvatore@hotmail.com
Email:Leonardosalvatore@giuneco.it
WebSite:www.giuneco.it

GeneralVBmemberunusualfrank29-Dec-08 8:37 
Does this work for VB? Awesome job!
GeneralRe: VBmemberleonardosalvatore29-Dec-08 21:31 
Yes, why not?
Thank you
 
Leonardo Salvatore
Msn:leonardosalvatore@hotmail.com
Email:Leonardosalvatore@giuneco.it
WebSite:www.giuneco.it

Generalgps in windows mobile6memberniktana20-Oct-08 1:03 
hi
can i run this project on windows mobile6 ?
GeneralRe: gps in windows mobile6memberleonardosalvatore11-Mar-09 1:58 
i don't know exactly.
I'm sure that win mo 6 include the GPS support, so you don't have to code nothing to communicate win the gps device.
 
Leonardo Salvatore
Msn:leonardosalvatore@hotmail.com
Email:Leonardosalvatore@giuneco.it
WebSite:www.giuneco.it

GeneralRMSmemberEdyb25-Aug-08 2:39 
Hello,
 
Any idea on using RMS on windows mobile phones?
 
Thank you.
GeneralRe: RMSmemberleonardosalvatore8-Oct-08 5:20 
Send to me more details about that.
 
Leonardo Salvatore
Msn:leonardosalvatore@hotmail.com
Email:Leonardosalvatore@giuneco.it
WebSite:www.giuneco.it

GeneralGPS receiver and a bletooth connectionmemberkalxite14-Jul-08 19:41 
Hello,
 

I would like to know how you would implement the code using a bluetooth enabled GPS receiver and a windows mobile ce pda
 
thanks
GeneralRe: GPS receiver and a bletooth connectionmemberleonardosalvatore15-Jul-08 0:15 
Hi,
to do that it's need to use the Bluetooth serial service exposed from your bluetooth GPS receiver.
I also suggest to refactor some peace of code, it's a 06 project and i don't have time to upgrade to 08 tecnhologies.
 
Leonardo Salvatore
Msn:leonardosalvatore@hotmail.com
Email:Leonardosalvatore@giuneco.it
WebSite:www.giuneco.it

GeneralRe: GPS receiver and a bletooth connectionmemberleonardosalvatore15-Jul-08 0:30 
I did'n see that post..
 
http://www.codeproject.com/KB/mobile/GpsTracerAppWMCE5.aspx?fid=331297&select=2380862&fr=1#xx2380862xx[^]
 
Leonardo Salvatore
Msn:leonardosalvatore@hotmail.com
Email:Leonardosalvatore@giuneco.it
WebSite:www.giuneco.it

GeneralIntermediate drivermembersolutionator2-Jul-08 22:01 
Can this also been done using the intermediate driver? I just want to record NMEA data into a text file, so i can use it in FAKEGPS (windows mobile 6 SDK), but I prefer using the intermediate driver if possible.
GeneralRe: Intermediate drivermemberleonardosalvatore15-Jul-08 0:16 
Yes i think that it can be done it as easy.
 
Leonardo Salvatore
Msn:leonardosalvatore@hotmail.com
Email:Leonardosalvatore@giuneco.it
WebSite:www.giuneco.it

Questionare there any license restrictions?memberedspencer9-Jun-08 6:09 
Thank you for posting this excellent example.
I wanted to ask you if there are any restrictions on
using this code. I would like to use it in a project
that I am building at work.
 
Ed Spencer
AnswerRe: are there any license restrictions?memberleonardosalvatore15-Jul-08 0:27 
No software licensing is needed.
It's free, in any case for if you need assistance please visit www.giuneco.it
 
Leonardo Salvatore
Msn:leonardosalvatore@hotmail.com
Email:Leonardosalvatore@giuneco.it
WebSite:www.giuneco.it

Generalquick.pe.krmembera1000cc4-Apr-08 11:34 
THANKS!!!!
 
gpsTracer->PDA->quick.pe.kr->map
GeneralRe: quick.pe.krmemberleonardosalvatore15-Jul-08 0:27 
To you Wink | ;)
 
Leonardo Salvatore
Msn:leonardosalvatore@hotmail.com
Email:Leonardosalvatore@giuneco.it
WebSite:www.giuneco.it

Generalgoodmemberpamauro22-Mar-08 6:41 
thx ... Big Grin | :-D
but return value string is $GPGGA , not $GPGGC in my gps
GeneralRe: goodmemberleonardosalvatore5-Apr-08 0:05 
Wow
it's a $GPGGA - Global Positioning System Fix Data
This mean that you are using a new GPS, i coded that application 2 years ago or more Wink | ;)
 
bye!
 
Leonardo Salvatore
Msn:leonardosalvatore@hotmail.com
Email:Leonardosalvatore@giuneco.it
WebSite:www.giuneco.it

Generalproblem after deploying your application on Visuall studio 2005's Pocket Pc 2003 SE Emulatormemberjadothebest11-Mar-08 13:51 
hi there, 1st i would like to thank you for you effort.
What i did here is:
i connected Majellan sporTrak Gps to com5.
i can read data from gps normally using hyperterminal.
now the problem is,after i deploy your application to the Pocket Pc 2003 SE Emulator, and exactly when i click RUN/STOP from the menu i get this error:
"An unexpected error has occured in DeviceApplication2.exe. Select Quit and then restart this program.or Select Details for more information"
here are the details of the error:
IOException
at System.IO.Ports.SerialStream.WinIOError()
at System.IO.Ports.SerialStream.CheckResult()
at System.IO.Ports.SerialStream.get_BytesToRead()
at System.IO.Ports.SerialPort.ReadTo()
at System.IO.Ports.SerialPort.ReadLine()
at GpsTracer.reader.methodTh()
 
Any help is apreciated, thanks in advance for your time
GeneralRe: problem after deploying your application on Visuall studio 2005's Pocket Pc 2003 SE Emulatormemberleonardosalvatore11-Mar-08 22:12 
Can you verify the protocol of your GPS device?
 
Leonardo Salvatore
Msn:leonardosalvatore@hotmail.com
Email:Leonardosalvatore@giuneco.it
WebSite:www.giuneco.it

GeneralRe: problem after deploying your application on Visuall studio 2005's Pocket Pc 2003 SE Emulatormemberjadothebest12-Mar-08 5:07 
hi there,
i beleive the protocol used by my gps is NMEA,
is that is not the answer you're looking for, can you please tell me
how can i exactly find out the protocol ?
here is a log of my gps received messages via serial port com5:
$GPGSV,3,1,12,15,48,2
$GPGSV,
$GPGSV,3,2,12,12,37,284,,29,35,197,,04,25,123,,28,17,066,*7F
$GPGSV,3,3,12,02,15,157,,05,10,273,,08,01,124,,18,-2,277,*67
$PMGNST,01.10,3,F,822,11.2,-02424,20*5F
$GPGSV,3,1,12,09,47,321,36,15,45,219,,17,44,047,,26,41,201,*7F
$GPGSV,3,2,12,12,37,284,,29,35,197,,04,25,123,,28,17,066,*7F
$GPGSV,3,3,12,02,15,157,,05,10,273,,08,01,124,,18,-2,277,*67
$PMGNST,01.10,3,F,838,11.4,-02424,20*52
$GPGSV,3,1,12,09,47,321,36,15,45,219,,17,44,047,,26,41,201,*7F
$GPGSV,3,2,12,12,37,284,,29,35,197,,04,25,123,,28,17,066,*7
$GPGSV,3,3,12,02,15,157,,05,10,273,,08,01,124,,18,-2,277,*67
$PMGNST,01.10,3,F,838,11.4,-02424,20*52
 
If you need further info, please let me know.
Thanks again
GeneralRe: problem after deploying your application on Visuall studio 2005's Pocket Pc 2003 SE Emulatormemberjadothebest13-Mar-08 11:11 
hi again, its NMEA V2.1 GSA
GeneralRe: problem after deploying your application on Visuall studio 2005's Pocket Pc 2003 SE Emulatormemberleonardosalvatore15-Jul-08 0:29 
So you need to upgrade sources to this new protocol.
If you want post here a text file with data that you are receiving from your GPS device.
 
Leonardo Salvatore
Msn:leonardosalvatore@hotmail.com
Email:Leonardosalvatore@giuneco.it
WebSite:www.giuneco.it

Questionhow to insert a pic (map)memberkiu26-Feb-08 18:29 
can u tell me how to insert a picture of map into the code as a background of the screen??
GeneralRe: how to insert a pic (map)memberleonardosalvatore27-Feb-08 21:11 
I think that you have to study a solution before start to customize that project.
If you need a map as "backgroud" you will encounter a lot of alignments problems.
 
Leonardo Salvatore
Msn:leonardosalvatore@hotmail.com
Email:Leonardosalvatore@giuneco.it
WebSite:www.giuneco.it

GeneralVB.Net versionmemberMember 471965512-Dec-07 0:42 
Could someone please try and convert this to vb.net as i am not a C# Dev and im bound down by projects.
 
Domino.VBcoder
GeneralSerial transmissionmemberjobin.dm11-Dec-07 5:30 
I do not have a GPS, I am simulating the data entry with an ASCII terminal. I can connect to my pocket PC with GpsTracer and the BlueTooth link work. It seems that the data never arrived. What is the data rate to set in my terminal?
GeneralRe: Serial transmissionmemberleonardosalvatore24-Dec-07 6:22 
I think that 9600 baud rate will be quite sufficient.
 
Leonardo Salvatore
Msn:leonardosalvatore@hotmail.com
Email:Leonardosalvatore@giuneco.it
WebSite:www.giuneco.it

GeneralRe: Serial transmissionmemberjobin.dm7-Jan-08 2:39 
Hello Salvatore,
Thanks for the reply. I found out that the setup IS 9600 bauds.
Still cannot transfert data. Port opens fine and connect. I arrive to:
 
m_readed = m_serialPort1.ReadLine();
 
but from here I never get any data when I send them from HyperTerminal. I test the connection and the data transfers using another terminal on my mobile.
 
Works with terminals but does not work with your example. Any clue?
GeneralRe: Serial transmissionmemberleonardosalvatore7-Jan-08 3:05 
Do you start the GPS?
 
Leonardo Salvatore
Msn:leonardosalvatore@hotmail.com
Email:Leonardosalvatore@giuneco.it
WebSite:www.giuneco.it

GeneralRe: Serial transmissionmemberjobin.dm7-Jan-08 3:14 
No.
I am not using a GPS. I am trying to transfer ASCII data from my PC using Hyperterminal. The connection works because I can test it from Hyperterminal and Zterm which is running on the PDA.
Now I try the same transfer of data using your GPS tracer and I can connect but cannot transfer any ASCII data.
GeneralRe: Serial transmissionmemberjobin.dm7-Jan-08 4:28 
Salvatore,
I found out that:
I was not sending a "Newline" on line end with hyper terminal but "Carriage Return". All fine thank you.
I can say that this example can be used with any Serial Port Profile in BT and not just GPS. By the way making it running on Mobile 2003.
Great example and thanks for your help.
GeneralRe: Serial transmissionmemberleonardosalvatore15-Jul-08 0:30 
Good, ty!
 
Leonardo Salvatore
Msn:leonardosalvatore@hotmail.com
Email:Leonardosalvatore@giuneco.it
WebSite:www.giuneco.it

QuestionIs this project needs GPS receiver?membersaiswar20-Nov-07 12:46 
is this project need GPS receiver?
AnswerRe: Is this project needs GPS receiver?memberleonardosalvatore20-Nov-07 20:39 
Sure, how to do it without?
Wifi/GsmCell identification has a poor precision.
 
Leonardo Salvatore
Msn:leonardosalvatore@hotmail.com
Email:Leonardosalvatore@giuneco.it
WebSite:www.giuneco.it

QuestionThis project need GPS receivermembersaiswar20-Nov-07 12:45 
This project need GPS receiver
QuestionWhat if i try ur code for Magnetic Card Reading?memberzeeshan hanif5-Nov-07 21:40 
plz do help me with this. i want to use ur gps tracer program for reading from a Magnetic card reader built in Extech Mobile Printer; i tried out all ports while card swipe but no data is read; plz tell me whats prob?
u can respond to my email:
zeesoft2005@yahoo.com
zeeshan hanif
QuestionOutofMemoryException after about 30 secondsmembershowman4715-Aug-07 5:38 
Hi
 
I've been trying out your application on an MDA.
 
Demo mode works perfectly, but in normal mode it works correctly for about 30 to 40 seconds before coming up with this error:
 
OutOfMemoryException
at
System.IO.Ports.SerialPort.MaybeResizeBuffer()
at System.IO.Ports.SerialPort.ReadTo()
at
System.IO.Ports.SerialPort.ReadLine()
at GpsTracer.reader.methodTh()
 
I am an experienced programmer, but new to c#, but looking at your code (which is really easy to follow) this is obviously happening when getting the data from the COM port.
 
really no idea what to do here. Would be grateful for some advice.
 
Am going to try changing the size of the buffer as in
byte[] buffer=new byte[100] to different values, but I'm really in the dark here.
If this helps, here is some basic data about the mobile:
model:ARTE110
platform:PocketPC
 
hardware:
CPU:OMAP850
speed 201 Mhz
RAM: 64 MB
Flash size: 128 MB
data bus:16 bit
storage size: 51 MB
 
Any help gratefully received

 

 

AnswerRe: OutofMemoryException after about 30 secondsmemberJoel Ivory Johnson22-Aug-07 14:51 
our of curiousity, how much of your ram is free before you begin to run the program?
 
Joel Ivory Johnson
Computer Science, spsu.edu

QuestionAproblem for an amator developermembermehdib647-Aug-07 1:35 
hello
this project is very usefull for my last project in uni.
i have some problem.i want to move this traces and paths every time new point readed to the center of screen,i mean always last point must be in the center of screen
please help me
QuestionHow can i use WM5 ?memberhyohaeng20-Jul-07 8:04 
Could you give a full explanation?
 
hello~

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Permalink | Advertise | Privacy | Mobile
Web03 | 2.6.130617.1 | Last Updated 22 May 2007
Article Copyright 2006 by leonardosalvatore
Everything else Copyright © CodeProject, 1999-2013
Terms of Use
Layout: fixed | fluid