Re: GPSTracka - GPS Logging Application for Windows Mobile
Yes, there are other GPS libraries. There's one in the OpenNetCF library, it appears, that we could look at. I'm going to go through it soon and should have something ready this weekend, I hope.
Aside from that, I'm still sure there are more class libraries for this. Do post any you find.
Re: GPSTracka - GPS Logging Application for Windows Mobile
Originally Posted by mendhak
Damn, you're not alone!!!!
Ha ha
Really sorry, haven't had a chance to look into any of this yet. With the weather the way it is here i spent most of the day in traffic, just really sitting down for the first time just now, so thought I would check what going on here. I am going to try to have a play over the weekend, but I think I am going to need to do some reading up on GPS. Have you got any good links?
You could even come up with your own test app, specific to your phone, in which you attempt to read from COM4! if you get the time of course,I know we're all busy at work.
Re: GPSTracka - GPS Logging Application for Windows Mobile
Hey,
I don't know if you have already seen it, but I have just found a sample application which uses the GPS Library within the OpenNETCF, you can find it here:
I am going to try and have a play with this tomorrow night, but I just thought I would let you know about it just in case you get a chance to look at it.
Re: GPSTracka - GPS Logging Application for Windows Mobile
Wow! I was *JUST* (at this very moment) using the OpenNETCF library in a test form to see how it works.
I'm really glad you guys got it working and are at least getting some test data. I will scrub what I'm doing and use ralph's stuff now. Why reinvent the wheel?
Re: GPSTracka - GPS Logging Application for Windows Mobile
Hmm, found a bug in the OpenNetCF GPS class.
Code:
private string[] devices()
{
// lists all modems on the device
ArrayList al = new ArrayList();
RegistryKey defkey;
string[] keyNames;
string keyvalue="";
string strport="";
// now get the active
defkey=Registry.LocalMachine.CreateSubKey(@"Drivers\Active");
keyNames =defkey.GetSubKeyNames();
foreach (string x in keyNames)
{
try
{
keyvalue=defkey.CreateSubKey(x).GetValue("Key").ToString();
strport=defkey.CreateSubKey(x).GetValue("Name").ToString();
// fudge to remove rubbish off the end of the string
strport = strport.Substring(0,strport.IndexOf("'"));
RegistryKey thekey=Registry.LocalMachine.CreateSubKey(keyvalue);
if (strport.StartsWith("COM"))
al.Add(strport);
}
catch
{
}
}
return (string[]) al.ToArray(typeof(string));
}
I changed that red apostrophe to a colon, not sure why an apostrophe was there. The GPS bits now work too, although they work in a separate thread, which means that we'll need to 'invoke' writing to a texbox or file.
Re: GPSTracka - GPS Logging Application for Windows Mobile
Making some progress. I'll check the code in in an hour or so and ask you to run it. Ralph might want to take a look at it too...
The OpenNetCF library is really fast, btw. So fast that when I tried going verbose, I couldn't click stop, because the textbox was filling up so fast. I had to introduce a 100ms delay between writes to the textbox in verbose.
Re: GPSTracka - GPS Logging Application for Windows Mobile
Excuse my absence. I was held captive by the local raging mooses during a stroll in the wilderness.
I'll update myself with all that has been going on in this thread after i have had my revenge on said mooses.
As usual, choose your port and click Verbose, if you get junk data, then you're at the right place. Then stop it and click 'start' and wait for it to start logging.
Exceptions should show up in the textbox too. Let me know how you get along. You're welcome to try it via source code too, change anything you please.
Re: GPSTracka - GPS Logging Application for Windows Mobile
Good luck with the moose. I am sure that this re-download and retry will be worth the slaughter.
I've left in lots of commented code, we can clean up later. The important thing right now is that we get it working on your phones. I won't dwell on why the other class library didn't work.
Also, any help with the... UI would be great. You should also be able to flip the phone orientation and still have the app looking 'OK'.
Re: GPSTracka - GPS Logging Application for Windows Mobile
Good show,
I even went back to the .net serialport and tried adding all the settings that work here, including the handshake one that got the OpenNetCF one working for me and it still didn't work.
Re: GPSTracka - GPS Logging Application for Windows Mobile
Hey,
Once you have got the SDK installed, all you need to do is to deploy the the attached device, rather than the emulator.
This is done by first connecting your device through ActiveSync, which I will assume you are already doing, if not, let me know. Once that is done, select the Windows Mobile 6 Classic Device from the dropdown list, see attached screen shot, and the application should be deployed to the Device.
You might get some warning appearing on your phone, just acknowledge them, assuming you trust Mendhak
Re: GPSTracka - GPS Logging Application for Windows Mobile
Oh... i have to trust mendhak?... i dont know...
just kidding. Thanks for that information, I assumed that was all that had to be done, but I keep getting the error "No such interface supported" no matter what option I choose to deploy to (both emulators and real devices). I cant understand why.
Re: GPSTracka - GPS Logging Application for Windows Mobile
Mendhak,
I was having a quick play with the code today, and it is looking a lot more promising. I had the textbox filling up with stuff when I hit Verbose. I only had a few minutes to play though, because I was wrestling with trying to get ActiveSync working, for some reason connecting my phone with the USB cable was causing a BSOD, so ended up connecting my phone using Bluetooth, which meant I had to wrestle with the Toshiba Bluetooth Stack....
Anyway, long story short, I can now deploy to my phone, and should be in a better position to have a look at this tomorrow.
I have some ideas for some UI changes as well, so I will try and get them incorporated as well.
Re: GPSTracka - GPS Logging Application for Windows Mobile
Originally Posted by Atheist
Oh... i have to trust mendhak?... i dont know...
just kidding. Thanks for that information, I assumed that was all that had to be done, but I keep getting the error "No such interface supported" no matter what option I choose to deploy to (both emulators and real devices). I cant understand why.
Hmm, that sounds similar to some problems that I have seen in the past, and normally they have just sorted themselves out, never really found an "actual" solution.
What OS are you running on your desktop? What OS are you running on your Mobile? Are you able to establish an ActiveSync connection successfully? Can you sync data between phone and desktop?
Re: GPSTracka - GPS Logging Application for Windows Mobile
Im running Vista Business 64 bit on my PC, Windows Mobile 6 on my mobile.
ActiveSync works like a charm. I have been able to use the device emulator to earlier, it suddenly all stopped working..
Re: GPSTracka - GPS Logging Application for Windows Mobile
Hey,
I am running Windows XP Pro, so I think the extent of knowledge to help you is going to end. I know if XP Pro and you run the emulator through activesync you have to change a setting in ActiveSync to use a "DMA" port, and then you have to change it back again when using a physical device. I don't know if that sounds familiar to you, but if it does have you confirmed this setting?
The other thing that rings a bell, and it sounds ridiculous, but....
Can you establish an ActiveSync connection, and then open up Visual Studio. I seem to remember that this caused my problems before, and this was one way I could guarantee the connection.
Apart from that though, i have nothing. I know the connections in Vista are handled differently using the Mobile Device Center, and I have never played with it.
Re: GPSTracka - GPS Logging Application for Windows Mobile
Atheist, can you try running the app as-is just to test if it's working in Verbose?
Gep, thanks again. Good to hear about Verbose.
I tried it on the other coworkers' phones and it worked fine, but the one problem that did crop up was that not every phone lets you write to \My Documents\GPSLogs... many of them will probably want to write to a storage card. So we should probably expose the folder path. Looks like the settings are taking up more and more space from that poor textbox
Re: GPSTracka - GPS Logging Application for Windows Mobile
That was actually going to be one of the UI changes that I was going to make.
I was going to make another form that handled the settings. At the end of the day, you only really need to set them once, so no real need for them to be displayed on screen all the time.
Re: GPSTracka - GPS Logging Application for Windows Mobile
Hey,
Right, I decided to have a play with the code a little and I have come up with the following, and I thought I would get some thoughts before checking anything in, so here goes...
Main Form (all screen real estate is given to the TextBox):
About Form:
Settings Form:
I know there are two schools of thought on this, but I decided to only use one form and then multiple panels to create the different pages, this prevents the need to instantiate multiple forms, rather simply show and hide panels, this should keep the app responsive.
In the designer, this means it looks like this:
I have to play some more obviously with the Settings screen, I have a GroupBox Control that I want to use to group like settings. There isn't one be default in the Compact Framework, so I rolled my own in another project.
The usage of the form has changed slightly. Rather than having both a start button and a verbose button, you now either check or uncheck the verbose menuitem and then depending on the checked state you either start in normal mode or verbose mode.
Let me know what you think, and if you like it I can finish it off and then check in the changes.
Re: GPSTracka - GPS Logging Application for Windows Mobile
Originally Posted by mendhak
Wait! Does it work for you then? Were you able to get GPX log files written? Was it able to find your position?
Oh, when you check it in, if you get unresolved conflicts, make sure you 'merge in merge tool' instead of getting it done automatically
Really nice work.
You would think that that would be something I would have checked by now wouldn't you, but I keep forgetting. I don't get a reliable GPS signal either at the office or at home, so I keep meaning to do it on the way to and from, but always seem to forget. I will "try" and remember today.
I will keep in mind what you say about the check in's. I should get everything checked in tonight.