Click here to Skip to main content
Click here to Skip to main content

App Innovation Contest – Nearby Hospitals

, 12 Oct 2012
Rate this:
Please Sign up or sign in to vote.
Provides a list of nearby hospitals
This is an old version of the currently published article.

Please 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.

Introduction

I built this app for App Innovation Contest. My app gets your location coordinates using GPS (in your device) 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:

  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}”
                SelectionMode=”None”
                IsItemClickEnabled=”True”
                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"  
                        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);
     
     
  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.

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.

License

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

Comments and Discussions


Discussions posted for the Published version of this article. Posting a message here will take you to the publicly available article in order to continue your conversation in public.
 
QuestionNearby Hospitals Windows Store App PinmemberMember 950337426-Nov-12 12:50 
QuestionMVVM - Commands PinmemberEnrique Albert23-Oct-12 11:35 
AnswerRe: MVVM - Commands PinmemberMember 950337423-Oct-12 12:25 
GeneralMy vote of 5 PinmemberEnrique Albert23-Oct-12 11:29 
GeneralRe: My vote of 5 PinmemberMember 950337423-Oct-12 12:05 
GeneralMy vote of 5 PinmemberHari Tantry23-Oct-12 7:37 
GeneralMy vote of 5 PinmemberThailand Mike22-Oct-12 10:15 
GeneralMy vote of 5 PinmemberRenju Vinod22-Oct-12 2:54 
GeneralMy vote of 5 Pinmembersahitiv21-Oct-12 10:18 
GeneralForward Thinking Pinmemberrdmjrb18-Oct-12 10:23 
GeneralGreat Idea, Great Tool PinmemberMember 950905218-Oct-12 8:46 
GeneralMy vote of 5 PinmemberGabriela Macias18-Oct-12 6:09 
GeneralMy vote of 5 PinmemberDeeps200217-Oct-12 5:07 
QuestionNice Idea! PinmemberRatish Philip16-Oct-12 18:03 
GeneralMy vote of 5 PinmemberMember 951980616-Oct-12 13:28 
QuestionJust curious... PinmemberPHS24112-Oct-12 21:20 
AnswerRe: Just curious... PinmemberMember 950337413-Oct-12 6:58 
GeneralMy vote of 5 PinmemberMember 950911712-Oct-12 8:50 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Mobile
Web02 | 2.8.140709.1 | Last Updated 12 Oct 2012
Article Copyright 2012 by Member 9503374
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid