Thursday, December 18, 2008

Visual Studio Google Gadget

I was curious as to how Google Gadgets worked, and for that matter, how they were built. I set out to Google's site and looked up Google Gadget. Found the API, downloaded the SDK and I was off to a good start. My project: list recent Visual Studio projects. One step further than that, I want to be able to select which Visual Studio version I wanted to list the projects for.

After a bit of research of how to access the registry through javascript, I was off to a good start. I created the basic form, which was basically just a shell, no real content. On the load event, it would call a method that would 1) find out which version of Visual Studio to look at 2) look under the proper Visual Studio folder and see what recent projects are in the MRU. For each project found, it parses the string path and keeps the solution name and sticks it in a label on the form. If no projects are found, it creates a label that says "No Projects".

I then proceeded to create the Options page, which basically is just 3 mutually exclusive checkboxes for the 3 Visual Studio versions in question (2003, 2005 & 2008). Based on what is selected here, this will affect what is displayed on the main form.

Finally, I worked on the information displayed in the About page. I created the package (*.gg file) and tested it out thoroughly. It works like a charm!

If you're interested, here is the code (VisualStudioProjects.zip) and the gadget (Visual Studio Recent Projects-Sebastien Limoges.gg).

Tuesday, December 9, 2008

Google Maps vs Virtual Earth

I started looking at the details of Google Maps (GM) and noticed that they ignore everything after the 6th decimal. Normally, I'd say that's good enough, but in the case of GPS locations, that is very limiting. I then looked at Virtual Earth (VE) and noticed they didn't have that limitation. The other advantage of VE vs GM is that there's a higher threshold for requests per day and no need to register to receive a special key.

So I set out to test the flexibility of this Virtual Earth and quickly notice that it's using HTML and JavaScript inside a browser. This might be troublesome later when I try to stick this on the Window Mobile 6 (WM6) platform, but I'll deal with that later. For now, I just want to see if I can do what I want in a quick prototype fashion.

I start looking at the Virtual Earth SDK (http://msdn.microsoft.com/en-us/library/aa905677.aspx) and looking at the live demo (http://dev.live.com/virtualearth/sdk/) I see all I could possibly want for this project: type of map (Road, Satellite, hybrid), I can add pushpins (which are Shapes in VE) and I can grab coordinates by responding to mouse events.

After a few hours of testing and messing around with the different possibilities and permutations, I came up with a finished product that quickly demos the ability of VE for this project. You can get the code for this example at the bottom of this entry.

For the purpose of this prototype, I went back again to my good old blue hole #1 at NAS Jacksonville. I first set the "center" of the hole to get the appropriate map. I then set tentative 100, 150 & 200 yds markers and I set another one to simulate where I'd be on the tee box. I add event handlers for the mouse clicks. I set different functionality for both left click and right click. Left Click gets the coordinates of where I clicked on the map both in pixels & in latitude and longitude. It also tells me the distance (yds & ft) from where I clicked to where I'm currently at. Right Click sets my new current location, which would be handled by the GPS data normally. I also added two buttons, a plus and a minus to assist with zooming in and out (if you don't have a scroll button on your mouse). You can see below a screen shot of what it looks like in IE6.

All and all, I'm very happy with this prototype. The next step will be to figure out how to stick this inside the WM6 environment.

Until next time,

Sebastien Limoges

Monday, December 1, 2008

Upcoming MSDN Tiki Hut Roadshow related to my project efforts

I found out that there will be an MSDN Tiki Roadshow this Wednesday, December 3rd @ the FCCJ North Campus and one of the sessions relate to GPS programming. I'm going to make my best effort to be there to see if there's any aspect of data analysis that I'm forgetting and to see how they put a solution together.

For more info, go to the event's site: https://msevents.microsoft.com/CUI/EventDetail.aspx?EventID=1032389331&culture=en-US