Click here to Skip to main content
13,097,661 members (58,371 online)
Click here to Skip to main content
Add your own
alternative version


2 bookmarked
Posted 12 Oct 2012

App Innovation Contest – Nearby Hospitals

, 23 Oct 2012
Rate this:
Please Sign up or sign in to vote.
Provides a list of nearby hospitals

Editorial Note

This article is an entry in our AppInnovation Contest. Articles in this sub-section are not required to be full articles so care should be taken when voting.


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.


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: 

  1. Uses MVVM to bind data with controls.
  2. 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();
  3. 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}"
                ItemClick="itemGridView_ItemClick" />
  4. 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"
     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.SetView(pos, 12.0f);
  5. 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)
            // Get the Result object which stores the resultset.
            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);
  6. 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.
  7. This app provides a screen where the user can search nearby Hospitals by entering a Zip Code.
  8. User can either run this app in a Snap, Full Screen or Filled Screen view.
  9. Implemented a "Share Contract" to share a list of hospitals displayed on the screen using Email.  


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:


This is the version 1.0 of my app.


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Member 9503374
United States United States
No Biography provided

You may also be interested in...


Comments and Discussions

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.170813.1 | Last Updated 23 Oct 2012
Article Copyright 2012 by Member 9503374
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid