Click here to Skip to main content
12,349,603 members (28,029 online)
Click here to Skip to main content
Add your own
alternative version

Tagged as

Stats

8K views
2 bookmarked
Posted

App Innovation Contest – Nearby Hospitals

, 12 Oct 2012 CPOL
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.

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.

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>
  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)

Share

About the Author

Member 9503374
United States United States
No Biography provided

You may also be interested in...

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 Pin
Member 950337426-Nov-12 12:50
memberMember 950337426-Nov-12 12:50 
QuestionMVVM - Commands Pin
Enrique Albert23-Oct-12 11:35
memberEnrique Albert23-Oct-12 11:35 
AnswerRe: MVVM - Commands Pin
Member 950337423-Oct-12 12:25
memberMember 950337423-Oct-12 12:25 
GeneralMy vote of 5 Pin
Enrique Albert23-Oct-12 11:29
memberEnrique Albert23-Oct-12 11:29 
GeneralRe: My vote of 5 Pin
Member 950337423-Oct-12 12:05
memberMember 950337423-Oct-12 12:05 
GeneralMy vote of 5 Pin
Hari Tantry23-Oct-12 7:37
memberHari Tantry23-Oct-12 7:37 
GeneralMy vote of 5 Pin
Thailand Mike22-Oct-12 10:15
memberThailand Mike22-Oct-12 10:15 
GeneralMy vote of 5 Pin
Renju Vinod22-Oct-12 2:54
memberRenju Vinod22-Oct-12 2:54 
GeneralMy vote of 5 Pin
sahitiv21-Oct-12 10:18
membersahitiv21-Oct-12 10:18 
GeneralForward Thinking Pin
rdmjrb18-Oct-12 10:23
memberrdmjrb18-Oct-12 10:23 
GeneralGreat Idea, Great Tool Pin
Member 950905218-Oct-12 8:46
memberMember 950905218-Oct-12 8:46 
GeneralMy vote of 5 Pin
Gabriela Macias18-Oct-12 6:09
memberGabriela Macias18-Oct-12 6:09 
GeneralMy vote of 5 Pin
Deeps200217-Oct-12 5:07
memberDeeps200217-Oct-12 5:07 
QuestionNice Idea! Pin
Ratish Philip16-Oct-12 18:03
memberRatish Philip16-Oct-12 18:03 
GeneralMy vote of 5 Pin
Member 951980616-Oct-12 13:28
memberMember 951980616-Oct-12 13:28 
QuestionJust curious... Pin
PHS24112-Oct-12 21:20
memberPHS24112-Oct-12 21:20 
AnswerRe: Just curious... Pin
Member 950337413-Oct-12 6:58
memberMember 950337413-Oct-12 6:58 
GeneralMy vote of 5 Pin
Member 950911712-Oct-12 8:50
memberMember 950911712-Oct-12 8:50 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    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 | Terms of Use | Mobile
Web02 | 2.8.160621.1 | Last Updated 12 Oct 2012
Article Copyright 2012 by Member 9503374
Everything else Copyright © CodeProject, 1999-2016
Layout: fixed | fluid