Introduction
I built this app for App Innovation Contest. I am in the process of creating two versions for this App, Desktop App (Healthcare category) and Windows Store App. My app gets your location coordinates
using GPS (one of the sensor in Ultrabok) or using IP address. It displays a list of hospitals
near your location. It will also provide you Yahoo ratings for the hospitals and
plot them on a map. It allows user to search hospitals near any US Zip Code. This
app is very useful if you have small children or an elderly person in your house.
Background
The basic idea of this App is to provide you with important information which
can be used during emergency. In an emergency situation we don’t have time to do
a search on internet for nearby hospitals and find their ratings. This app makes
important information available to you at your fingertips.
This app uses following technical components:
- Uses MVVM to bind data with controls.
- Uses Geolocator class’s
GetGeopositionAsync method to obtain user’s location.
Here is the code which retrieves user’s current location.
Geolocator geo = new Geolocator();Geoposition cur_pos;
cur_pos = await geo.GetGeopositionAsync();
...
- Calls a Web service to obtain list of nearby hospitals based on user’s Location.
The results are then mapped to the UI using Data Binding. The results are displayed
using ListView control. Here is the sample code:
<ListView x:Name=”itemGridView” ItemSource={Binding Results}”
ItemTemplate=”{StatisResource HospitalItemTemplate}”
SelectionMode=”None”
IsItemClickEnabled=”True”
ItemClick=”itemGridView_ItemClick” />
- The app also plots the locations in the resultset on the map. Following
code is used to plot an image on the map:
<bm:Map x:Name="map"
Credentials="YOUR_KEY"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Height="600"
Width="700"
Grid.RowSpan="2"
Margin="10,0,0,0"
Grid.Column="1">
</bm:Map>
Image img;
img = new Image();
img.Width = 32;
img.Height = 32;
img.Opacity = 0.8;
BitmapImage bi = new BitmapImage();
bi.UriSource = new Uri(“ms-appx:///Assets/your_icon.png”);
Location pos = new Location(cur_pos.Coordinate.Latitude, cur_pos.Coordinate.Longitude);
img.Source = bi;
MapLayer.SetPosition(img, pos);
map.Children.Add(img);
map.SetView(pos, 12.0f);
- When user clicks on any one of the item in the resultset, it would be nice
to pan the map so that the selected location shows up in the center of the map.
Here is the code for doing that:
private void itemGridView_ItemClick(object sender, ItemClickEventArgs e)
{
Model.Result res = ((Model.Result)e.ClickedItem);
Location currloc = new Location(double.Parse(res.Latitude,CultureInfo.InvariantCulture),double.Parse(res.Longitude,CultureInfo.InvariantCulture));
map.SetView(currloc, 15.0f);
}
- This app also makes use of LiveTiles features in Windows 8. It displays
a list of nearby hospitals in a WideTile format to the user when the application
is not running.
- This app provides a screen where the user can search nearby Hospitals by
entering a Zip Code.
- User can either run this app in a Snap, Full Screen or Filled Screen view.
- Implemented a "Share Contract" to share a list of hospitals displayed on the screen using Email.
Features
Ultrabooks are equipped with Compass/Magnetometer, Accelerometer, Gyroscope/Gyrometer, GPS, and Ambient Light Sensor. I am using some of these sensors in my application.
GPS Sensor: The GPS Sensor is used to get your Ultrabook's current locations.
Ambient Light Sensor: Planning to make use of this sensor in the Ultrabook to make this app a Light-aware app. It will adjust for Dark, Indoors, Outdoors, Contrast adjustment on visual state.
Touch Screen: Users can interact with the application using touch. They can activate the bottom app bar and choose to search Hospitals by Zip code using touch. Users can also select (by touch) a particular Hospital from the list and view its location on the Map. The map can be zoomed-in/out/pan with touch. You can use multi-touch to expand/reduce your visibility area.
Accelerometer/Gyroscope: The Accelerometer is used to get the orientation of the Ultrabook device. The application's presentation style changes when the Ultrabook is rotated Horizontally/Vertically.
Points of Interest
I learned a lot about Windows 8 Store app when developing this app and how to
handle errors within code without impacting the user experience.
Here are some of the App Screenshots:


History
This is the version 1.0 of my app.