.NET Components for Mobility

StartApplication() brings Navigator to foreground. Also external GPS question.

Last post 08-07-2008 5:27 AM by PeterFoot. 6 replies.
Page 1 of 1 (7 items)
Sort Posts: Previous Next
  • 07-31-2008 11:45 AM

    StartApplication() brings Navigator to foreground. Also external GPS question.

     Hello,

    The library says that Navigator.StartApplication() will start the Navigator in the background. For me, it is starting in the foreground. Any work arounds would be most appreciated.

     

    I'm using Windows Mobile 6, Navigator SDK 6 .  

    Filed under: ,
  • 07-31-2008 3:50 PM In reply to

    Re: StartApplication() brings Navigator to foreground. Also external GPS question.

    I have one question about using external GPS. I am doing the following with an extra button I added to the PPC example:

     

               string fakeGPS= "$GPRMC,135300,A,3330.00,N,-8418.00,W,0.00,0.00,300708,,*1C";
                    
              System.Text.ASCIIEncoding  encoding=new System.Text.ASCIIEncoding();
              byte[ ] fakeGPSByteArr = encoding.GetBytes(fakeGPS);
                try
                {
                    GpsStream gs = n.ExternalGPSInput;
                    
                    gs.Write(fakeGPSByteArr , 0, fakeGPSByteArr .Length);
                                  
                }
                catch (TomTomException tte) { MessageBox.Show(tte.Error.ToString()); }

      I don't get any errors, but the event handler n_RawGpsReceived isn't reporting the NEMA string I have fed it.  Does n_RawGpsReceived not reply to external GPS writings? Or is there something wrong with my NEMA string? 

     

  • 08-01-2008 5:56 PM In reply to

    Re: StartApplication() brings Navigator to foreground. Also external GPS question.

    Is TomTom updating to the location you are passing in? I'm not entirely sure but it's probably expecting more than just the GPRMC sentence. It has been tested with data retrieved off actual GPS units connected indirectly and from text files containing actual logs from a real session.

    Peter

    Peter Foot
    Microsoft Device Application Development MVP
    www.peterfoot.net | www.inthehand.com
  • 08-01-2008 6:01 PM In reply to

    Re: StartApplication() brings Navigator to foreground. Also external GPS question.

    Regarding the StartApplication call you can bring your own application to the foreground to show it in front of TomTom. I'll check the underlying code to see if there is a reason for starting in the foreground.

    Peter Foot
    Microsoft Device Application Development MVP
    www.peterfoot.net | www.inthehand.com
  • 08-04-2008 11:03 AM In reply to

    Re: StartApplication() brings Navigator to foreground. Also external GPS question.

     

    PeterFoot:

    Regarding the StartApplication call you can bring your own application to the foreground to show it in front of TomTom. I'll check the underlying code to see if there is a reason for starting in the foreground.

    How would I go about doing that?  I've tried something like:

     

    void procedure(){ 

     Navigator.StartApplication();//now the tomtom navigator screen is shown.  

     this.BringToFront();//nothing changes, tomtom still in the foreground.

      } 

     

    PeterFoot:

    Is TomTom updating to the location you are passing in? I'm not entirely sure but it's probably expecting more than just the GPRMC sentence. It has been tested with data retrieved off actual GPS units connected indirectly and from text files containing actual logs from a real session.

     I'm still waiting for the Navigator software I ordered off the net. I have the InTheHand wrappers and theTomTom SDK but not the Navigator.However , the SDK came with the Navigator6 CAB so I can test a small section of the InTheHand wrappers but for some things (like updating position) the screen just says "no maps found" or I get a "NoMapOpen" error. So until the navigator maps ship, I am limited in my testing ability.  

     Any chance you could post an example of the logs you used for testing? 

     

    For reference, I was using the TomTom C++ example, in their documentation.

     

    TomTomDocs:

    /*Enables external GPS input coming from the user instead of GPS input supplied via the NAVIGATOR itself. Upon success, returns the window descriptor. The user should then send GPS messages (in NMEA-183 format) via WM_COPYDATA message to the specified window.*/

    CTomTomAPI::TExternalGPSResult gpsres;

    CTomTomAPI::TError err;

    int res = api.EnableExternalGPSInput(&err, &gpsres);

    HWND existingWindow = (HWND)gpsres.iResult;

    char* lineBuffer="$GPRMC,093832.000,A,5222.0741,N,00454.2019,E,0.00,86.46,300605,,,36";

    COPYDATASTRUCT cds;

    cds.dwData = 0;

    cds.cbData = numBytesRead;

    cds.lpData = lineBuffer;

    ::SendMessage(existingWindow, WM_COPYDATA, NULL, (LPARAM)&cds);

     

     

     And as always, thanks again for your help.  

  • 08-06-2008 2:41 PM In reply to

    Re: StartApplication() brings Navigator to foreground. Also external GPS question.

    I got the navigator to accept GPS using GPGGA,GPRMC, adn GPGSA sentences. The rawgps_received event never does anything but that is not too important to me right now.

     

    What I am having the most trouble with, is that it seems to be opening multipe windows and when I try to navigate to coordinates, it gives me "MethodFailed". 

  • 08-07-2008 5:27 AM In reply to

    Re: StartApplication() brings Navigator to foreground. Also external GPS question.

    Regarding the multiple windows, are you checking the IsApplicationRunning property before calling StartApplication?

    Peter

    Peter Foot
    Microsoft Device Application Development MVP
    www.peterfoot.net | www.inthehand.com
Page 1 of 1 (7 items)
Copyright © 2001-2008 In The Hand Ltd. All rights reserved. Terms of Use and Privacy Policy.