Yesterday, I had a really hard time between choosing to do a Mobile Speedometer or a Mobile Altimeter. But another day gives us another opportunity, and today we shall create the Mobile Altimeter.
Mobile Altimeter
This will make the third application in the 30 Days of .NET series that has had targeted GPS capabilities. We have created a compass, a speedometer, and now a altimeter. And there are still dozens of applications we could create with the GPS capabilities of Windows Mobile.
This time I decided to a little more with the UI. We have a background that symbolizes “altitude” which is appealing to end users. Plus it gives the program a lot of style and class. On the left side of the screen if you look carefully, you will notice we have an attitude ruler, which has a marker that rises one pixel for every foot higher the device travels up to 180 feet.
This simple feature really takes our application up to the next level. :D (Yeah, I know: I’m terrible.)
At the bottom of the screen we are allowing the user to read all the main stats off the GPS so the application is even more useful. We show altitude in a large bold font in the middle of the screen for impact.
The main event: UpdateData
1: void UpdateData(object sender, System.EventArgs args)
2: {
3: if (gps.Opened)
4: {
5: if (position != null)
6: {
7: if (position.SeaLevelAltitudeValid)
8: {
9: labelAltitude.Text = position.SeaLevelAltitude.ToString("0.00ft");
10: if (position.SeaLevelAltitude >= 0 && position.SeaLevelAltitude <= 180)
11: pictureBoxArrow.Top = 173 - (int) position.SeaLevelAltitude;
12: else
13: pictureBoxArrow.Top = 173;
14: }
15: }
16: }
17: }
Possibilities:
I think a more realistic UI would be a great improvement. And the ability to switch from miles to kilometers would be good too. If the odometer would track miles traveled that would be an awesome enhancement.
Download executable: mobileAltimeter.cab
Download Source Code: mobileAltimeter.zip
Feedback:
Want more? What else would you like to see? There’s been a lot of demand for GPS related applications. Does that help?