nondem
24th March 2009, 03:02 AM
This is my first "real" app for Windows Mobile. I've got a HTC Touch Diamond(Alltel). I've been programming in VB .net for a year or so but I'm NOT an good programmer. I'm a noob that is stumbling along. It's a tribute to .net that I'm able to produce the apps I have.
I've got a basic app working using the sample .dll from MSDN.
Working is relative though - it only works if I start some other application that uses GPS like google earth.
I've went through serveral ways of getting the positon information including this one that I leeched from someones explaination:
-------------------------------
Dim gps As Microsoft.WindowsMobile.Samples.Location.Gps
Try
' -- opens GPS device connected to GPS API
gps = New Microsoft.WindowsMobile.Samples.Location.Gps
gps.Open()
Dim pos As Microsoft.WindowsMobile.Samples.Location.GpsPositi on = _
gps.GetPosition()
'call invoke process
UpdateLAT(pos.Latitude)
UpdateLON(pos.Longitude)
gps.Close()
Catch ex As Exception
' -- position is unavailable
Finally
If gps IsNot Nothing AndAlso gps.Opened Then gps.Close()
End Try
--------------------------------
It pulls a positon fine - I used a TImer to run that code once a second and it'll post a empty positon till I open some other app - and then it updates fine. Once I stop the other app - it stops updating the position. It looks like the positon values I'm reading only get updated if some other process has the gps running.
What am I missing? I've googled and found all sorts of C# stuff. but NO examples besides in C# that doesn't work after using one of the C# translators to convert it.
So much of the "help" for this type of stuff is theory or high-level and assumes more knowledge than I posess - I need an actual EXAMPLE to build on.
Can any of you guys help?
BTW: Here is a VERY good example of "help" that leaves a huge gap of explaination before you actually have an idea how to code for it: http://msdn.microsoft.com/en-us/library/bb202050.aspx
I've got a basic app working using the sample .dll from MSDN.
Working is relative though - it only works if I start some other application that uses GPS like google earth.
I've went through serveral ways of getting the positon information including this one that I leeched from someones explaination:
-------------------------------
Dim gps As Microsoft.WindowsMobile.Samples.Location.Gps
Try
' -- opens GPS device connected to GPS API
gps = New Microsoft.WindowsMobile.Samples.Location.Gps
gps.Open()
Dim pos As Microsoft.WindowsMobile.Samples.Location.GpsPositi on = _
gps.GetPosition()
'call invoke process
UpdateLAT(pos.Latitude)
UpdateLON(pos.Longitude)
gps.Close()
Catch ex As Exception
' -- position is unavailable
Finally
If gps IsNot Nothing AndAlso gps.Opened Then gps.Close()
End Try
--------------------------------
It pulls a positon fine - I used a TImer to run that code once a second and it'll post a empty positon till I open some other app - and then it updates fine. Once I stop the other app - it stops updating the position. It looks like the positon values I'm reading only get updated if some other process has the gps running.
What am I missing? I've googled and found all sorts of C# stuff. but NO examples besides in C# that doesn't work after using one of the C# translators to convert it.
So much of the "help" for this type of stuff is theory or high-level and assumes more knowledge than I posess - I need an actual EXAMPLE to build on.
Can any of you guys help?
BTW: Here is a VERY good example of "help" that leaves a huge gap of explaination before you actually have an idea how to code for it: http://msdn.microsoft.com/en-us/library/bb202050.aspx