The WhereAmI Project is all about GPS Location of oneself. It is a simple and easy mechanism for oneself to transmit his/her GPS location to a central server and for family, friends and colleagues to figure out where in the world the person is at. It is a small application that lives inside your Windows Mobile Pocket PC Phone that at your will track your GPS position and upload your whereabouts to let your buddies know where you're at. It is the beginnings of a potential Social Networking Platform.
Technically, it is the coming together of various Microsoft Key technologies to showcase how one can build practical, feature rich Windows Mobile applications leveraging technologies such as Windows Mobile 6.x (and SDK), Virtual Earth, ASP.Net, Web Services, ASP.Net AJAX, IIS 7, Windows Server 2008 (or 2003, or Windows XP Pro), SQL Server and Visual Studio 2008.
I am currently migrating this project over to VS 2010, Expression Blend 4, Silverlight 4 and .Net 4.0 and Windows Phone 7.
How it works and How did I do it
Windows Mobile provides is a fantastic rich platform for application development for Enterprises, hobbyists and amateurs. With the advent of Windows Mobile 6.x combined w/ the power of .Net Compact Framework and Visual Studio 2008, the doors have opened up all the more for powerful features and API Stacks that can be leveraged right out of the box.
The WhereAmI Project was built on top of various key Microsoft technologies on the client and server side. Windows Mobile 6.0 SDK and .Net 3.5, AJAX.ASP.Net Extensions for .Net 3.5, Virtual Earth 6.1 MapControl and Web Services and were programmed using my favorite development tool Visual Studio 2008.
Let's go a bit deeper;
To go a bit deeper, let's understand how The WhereAmI Project works at a high level - sort of a simple flow chart rundown shall we.
The FIRST piece of The WhereAmI Project application is the one that runs on the client device - a Windows Mobile 6.x Pocket PC Phone that either has built in GPS capability OR has access to one via Bluetooth, or other mechanism (Let's call this application 'The Client').
The SECOND piece of The WhereAmI Project application is the one that runs on the Server end - a (web site and webservice) hosted on Internet Information Server (IIS) 7.0 running Windows server 2008 Standard Edition. One could host the server side pieces on IIS 6.0 running Windows Server 2003 or Windows XP Professional as well. I prefer IIS 7 on WS2K8 - as it is far easier to manage web sites running on IIS7 on WS2K8. If you have access to WS2K8 and IIS7, I'd highly recommend that route for hosting the server side components.
Let's look at the workflow;
The client app when run, initiates a web service call to the server to check if the device has an associated server side profile set up. The web service then returns the results on the Profile if it exists. A Profile is unique to the device and identifies the user w/ his/her account on the WhereAmI Server. If a Profile exists for that device/user, the Client application continues on and awaits user to initiate activities such as GPS tracking, Upload tracking data to the server, Edit Profile details, change options, etc. On the other hand, if a Profile did not exist, the Client application allows the user to create one for him/herself. Profile creation is completely self-provisioned.
On the Server side, there are 2 pieces in action. One, the tracing browser itself that allows one to track where someone is. and the Second, is the Web Service that allows all the interfacing btwn the Client App and the Server. The Web Service also provides AJAX enabled functions such as getting Profile tracking data that the browser uses to track a particular profile. This function had to be defined as AJAX enabled function so that when one tracks a profile, the browser could get and pain profile tracking data on the MapPoint page w/o having to refresh the entire page everytime the tracking data needs to be refreshed.
How did I do it - the Client component development;
If you were to build your own "The WhereAmI Project", depending on how many bells-and-whistles you're looking to add to it, it is fairly straight forward.
To build the Client side components, Get your self a copy of Visual Studio 2008 Express and install it on your development box - it is free from Microsoft and can be downloaded from here:. Download and install "Windows Mobile 6.0 SDK". It is free also and can be downloaded from here: The beauty of Windows Mobile 6.0 SDK is that it comes w/ the fully functional "Windows Mobile Pocket PC Phone" emulators right out of the box. When you install the SDK, it automatically wires up the Visual Studio 2008 w/ the required Project Types for Windows Mobile Development including the emulators. To develop Windows Mobile applications, you dont need a physical Windows Mobile device, you can pretty much use the emulators for all programming and testing needs.
Once you install the above components, fire up Visual Studio 2008, and create a new 'Smart Device" project type. The Client is a WinForm based application as you will notice. Pick the device type inside Visual Studio. Now, you're all set to go to start programming.
I will not go into every single step of creating a Windows Mobile app in this document. But, will only cover a few salient pieces that will help you uncover some of the many features inside the WM SDK and Visual Studio.
When I talk to developers and users, I was always asked, "how does one program the GPS in Windows Mobile". When you install the WM 6.0 SDK, it installs a ton of samples ranging from the Managed C# and VB to the Native C++ examples. One of the examples that comes w/ the install is "GPS application". Take a look at it, it is a fantastic piece of wrapper, you could use the compiled DLL right off the bat in your application development. I used it myself and have been extremely happy w/ its ease of interface and performance. There are objects and methods in that GPS dll that allow you to initiate GPS device (intermediate or physical), start/stop the GPS device, Get coordinates, Get fix data, Satellite count, strength of satellite signals, etc. And you will be surprised how easy it is to get all of these data by the simple interface that this dll provides.
The second question I get asked a lot is, "OK, once you get the GPS data how does one send that data over the air to whereever it needs to go to". Well, in the context of The WhereAmI Project, it is fairly straight forward. The device knows of a webservice and a few methods that is exposes. The device then calls the method w/ Lat/Lon/Alt/Speed and other details to upload the data to the server. Every time the device needs to send the data over the air to the server, it either uses the GPRS connection that might already be available, or establish a new connection over a shared modem, or dial-up network (DUN) to get a ISP provided internet connection. Once the connection is established, the method call is executed via the call to the webservice. Now, how did the device know about the webservice? At the time of development of the windows mobile client application inside Visual Studio 2008, you would make a reference to the webservice by doing, "Web Reference" in the IDE. Once that is done, Visual Studio creates a "Proxy" to the server hosted webservice on the client side. Simple.
How did I do it - the Server side component development;
To develop the server side components, download and install the free "AJAX Extensions for ASP.Net 2.0" from here. These components provide AJAX behaviors and features for a few aynschronous calls to webservices that we will use in the browser page.
Inside Visual Studio 2008, create a new "ASP.Net AJAX" enabled website. This creates a project that automatically has all the AJAX pieces wired into the project for you to start using right off the bat.
There are two pieces to the server side components. The 'Browser' and the 'WebService'. The 'Browser' allows visitors to view where a particular profile is at - tracking. The 'Browser' depends and leverages Microsoft Map Point/ Virtual Earth MapControl 6.1. It is a feature rich browser enabled, mapping user interface loaded w/ great features for all your mapping needs. The control is client side scripting enabled component that one can program against using scripting technologies such as JavaScript/JScript/VBScript. And, best of all, you as a developer would only need to call methods to achieve the great functionality of Virtual Earth. All the hard work was already done by our Virtual Earth team - I love those guys.
The WebService piece of the WhereAmI Project Server component is pretty simple. It exposes a bunch of <WebMethod> meethods to do things such as check profile, delete profile, update profile, upload profile data, get profile data. The 'Browser' page calls one particular method in the webservice to "get profile data" given a profile. The remainder of the web methods are called by the Windows Mobile application.
How do I deploy the Client and Server side components.
The Client project can be compiled and then packaged into a CAB file that can be installed on windows mobile pocketpc devices. As long as that device already has .Net CF 2.0, you;re all set to go.
On the server side, you will need an external facing (internet facing) webserver that knows how to receive HTTP calls. Copy your project's server side runtime components to a server folder. Setup your website on IIS running on this web server to point to this folder and start hosting your site. Remember to install these components on the server side at the time of deployment: SQL Server Express, "AJAX Extensions for ASP.Net 2.0".
Another key thing to keep in mind is, make sure your client side component references the correct Fully Qualified Internet URL for your site's webservice.
I thouroughly enjoyed building The WhereAmI Project and currently working on Ver 2,0. In your efforts to building your own "WhereAmI", if you have ?s, please feel to ping me.
How does this work?
(Non-technical)
There are essentially THREE pieces of moving parts. ONE, an application that I will have running on my GPS ENABLED Mobile device (Windows Pocket PC Phone) that has a pre-established Internet Connection. TWO, a Web Service that is hosted on my server at home that gets called by #ONE with my GPS data. And, THREE, an ASP.NET AJAX Enabled web page hosting Microsoft Virtual Earth Mapping Control that knows how to plot my position on the world map.
If you have a Pocket PC Phone that is internet connection aware and has GPS data stream, you're all set to go to leverage this project (GPS receiver connectivity can be either built into your Pocket PC Phone or via Bluetooth, or direct cabled).
The WhereAmI Project - Coverage on On10.net
http://on10.net/blogs/laura/Where-am-I/Default.aspx