Download the free trial version
Basic4android Video
Features
Tutorials and manuals
Showcase
Screenshots

Go Back   Android Development Forum - Basic4android > Basic4ppc (Windows Mobile) > Code Samples & Tips > Additional Libraries
Documentation Wiki Register Members List B4P Search Today's Posts Mark Forums Read

Additional Libraries Users contributed libraries.
This sub-forum is only available to licensed users.

GPSSerial library

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 11-12-2008, 06:36 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 5,953
Awards Showcase
Innovator medal Beta Tester Forum Contributer 
Total Awards: 3
Default GPSSerial library

With the shiny new GPSDriver library for WM5.0 devices, and later, with internal GPS we now have two incompatible ways of writing GPS apps. The "old" GPS library and Serial2 for serial ports, such as Bluetooth, and the new GPSDriver for GPS Intermediate Driver equipped devices.

I thought that it might be nice to be able to develop GPS apps on my laptops or desktop which use Bluetooth or USB GPS devices then port them to my Diamond which uses the Intermediate Driver. Also GPSDriver returns more information than GPS does and I wanted to be able access that on other platforms than an Intermediate Driver equipped device.

So here is a compatible solution, the GPSSerial library. It looks like GPSDriver to the code but hiding underneath is a SerialPort like in the Serial2 library. Porting code between the two should be a matter of changing your objects to use the correct library and altering the Open method which is the only one that differs between the two libraries.

This is quite a complex piece of code (have peek at the source!) and I have observed that the NMEA sentences from different devices don't all carry the same information in the same way. I have tested it on my Axim X30 (WM2003, Bluetooth) my desktop (Vista, RS232 to USB) and my EEE PC (XP, Bluetooth and RS232 to USB). However some code bugs may remain and there may be incompatibility problems with some devices. However if it will work with GPS and Serial2 it ought to work with this library.

EDIT :- Version 1.1 posted with corrected GPSSerialConverter object.

EDIT :- Version 1.2 posted. See post #16 for details.

EDIT :- Version 1.3 rapidly posted as I didn't get 1.2 quite right . See post #19 for details.
Attached Files
File Type: zip GPSSerial1.3.zip (45.5 KB, 329 views)

Last edited by agraham : 01-16-2009 at 10:32 AM.
Reply With Quote
  #2 (permalink)  
Old 11-13-2008, 04:11 PM
Knows the basics
 
Join Date: Apr 2007
Location: Steinheim, Germany
Posts: 91
Default External compiler error

Hi agraham,
when I try to compile your code for the device the attached error is displayed (desktop works). Nothing is changed in your code. Downloaded twice, installed in a new folder but no succes. All files are avaiable in the correct folders.
Attached Images
File Type: jpg error.jpg (11.5 KB, 34 views)
__________________
Thanks for all
wolfgang
___________________
Desktop: Dual Core 3.0 GHz, Win7
Device: IPAQ 3970 WM 2003, Asus 632N WM5, HTC 3650 Cruise
GPS: iblue 747
Reply With Quote
  #3 (permalink)  
Old 11-13-2008, 04:52 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 5,953
Awards Showcase
Innovator medal Beta Tester Forum Contributer 
Total Awards: 3
Default

I am afraid that I cannot reproduce that error. I have just downloaded the zip to make sure I have the same code as you. I have put it into an empty folder unzipped it and it optimised compiles fine for both desktop and device and also both with and without the source file in the Libraries folder

The reference to the MicrosoftCE namespace is puzzling as there is no explicit reference in the library to that (or it wouldn't work on both desktop and device). I have checked the compiler response file that Basic4ppc produces for device compilation and only the dlls that Basic4ppc refers to by default for all optimised device compilation are required. Do you get the error WITHOUT the source code in the Libraries folder and can you optimise compile other device applications?

The only thing that I can think of is that you don't have the Compact Framework SDK installed but if this is the case you couldn't have optimised compiled and I would expect a "Cannot locate .Net Compact Framework 2.0 files." error message.

Last edited by agraham : 11-13-2008 at 04:56 PM.
Reply With Quote
  #4 (permalink)  
Old 11-13-2008, 05:17 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 5,953
Awards Showcase
Innovator medal Beta Tester Forum Contributer 
Total Awards: 3
Default

I found it! You have the ImageLibExDevice.cs source file in your library. Delete it and all should be fine. ImageLibEx Device needs a reference to Microsoft.WindowsCE.Forms to optimise compile and as Basic4ppc doesn't know this by default it needs an entry in the compiler LibrariesExceptions.txt file

You could also edit your LibrariesException.txt file to overcome this problem but Erel probably doesn't everyone playing with that file. I'll check with him, in the meantime just delete the ImageLibExDevice source and use the pre-compiled library.
Reply With Quote
  #5 (permalink)  
Old 11-13-2008, 05:31 PM
Knows the basics
 
Join Date: Apr 2007
Location: Steinheim, Germany
Posts: 91
Default

Quote:
Originally Posted by agraham View Post
I found it! You have the ImageLibExDevice.cs source file in your library. Delete it and all should be fine. ...
That's it. Thank you so much.
__________________
Thanks for all
wolfgang
___________________
Desktop: Dual Core 3.0 GHz, Win7
Device: IPAQ 3970 WM 2003, Asus 632N WM5, HTC 3650 Cruise
GPS: iblue 747
Reply With Quote
  #6 (permalink)  
Old 11-13-2008, 05:33 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 13,162
Awards Showcase
Basic4ppc Founder 
Total Awards: 1
Default

Quote:
You could also edit your LibrariesException.txt file to overcome this problem but Erel probably doesn't everyone playing with that file. I'll check with him, in the meantime just delete the ImageLibExDevice source and use the pre-compiled library.
This file is intended for cases like that.
However you can just add this line anywhere in your code:
Code:
SIP(false)
It will have the same effect.
__________________
Basic4android documentation
Reply With Quote
  #7 (permalink)  
Old 11-13-2008, 05:39 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 5,953
Awards Showcase
Innovator medal Beta Tester Forum Contributer 
Total Awards: 3
Default

Quote:
Originally Posted by Erel View Post
However you can just add this line anywhere in your code:
Code:
SIP(false)
It will have the same effect.
I'd forgotten that trick - makes mental note!
Reply With Quote
  #8 (permalink)  
Old 11-25-2008, 08:59 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 5,953
Awards Showcase
Innovator medal Beta Tester Forum Contributer 
Total Awards: 3
Default

Version 1.1 now posted with the corrected GPSSerialConverter. The original code was inherited (copied!) from the original GPSDriver code which turned out to be buggy and which Erel has now fixed.
Reply With Quote
  #9 (permalink)  
Old 01-14-2009, 09:43 PM
schimanski's Avatar
Basic4ppc Veteran
 
Join Date: Oct 2007
Location: Germany
Posts: 289
Default Differnt Lat/Lon in GPSDriver and GPSSerial????

Sorry, perhaps I have made a mistake?

Quote:
Porting code between the two should be a matter of changing your objects
to use the correct library and altering the Open method which is the only one
that differs between the two libraries.
Is the format of the latitude/longitude in the GPSDriver-Lib different to the latitude/longitude of the GPSSerial-Lib?

In my large gps-application, I only have changed the object and the open-method for the desktop, but with the two different formats, it doesn't work. Did I missed something?
__________________
schimanski
--------------------------------------
Device: Motorola Defy, Samsung Galaxy Tab P1000
Dekstop: Asus Eee PC
Reply With Quote
  #10 (permalink)  
Old 01-15-2009, 09:17 AM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 5,953
Awards Showcase
Innovator medal Beta Tester Forum Contributer 
Total Awards: 3
Default

Quote:
Originally Posted by schimanski View Post
it doesn't work.
It should be the same. Can you give me some details of what the problem is?
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Door library (Beta) - Special library Erel Official Updates 60 01-13-2011 12:23 PM
Merging Outlook library and Phone library Erel Official Updates 11 09-15-2010 10:22 AM
PhoneticAlgorithms Library (ex-StringComparison Library) moster67 Additional Libraries 10 11-11-2008 08:46 PM


All times are GMT. The time now is 12:59 AM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0