Project Description

This library provides a simple framework for building Windows Store applications that connect to Microsoft HealthVault.

HealthVault Resources

Project Contents

  • hvsdk: A Windows runtime component providing the lowest level abstractions for working with HealthVault. This includes:
    • HealthVault XML-over-HTTP method invocation, request serialization and response deserialization
    • HealthVault authentication protocol (SODA)
    • Wrappers for HealthVault methods.
  • hvrt: A Windows Store class library providing abstractions for HealthVault objects that can be used within Windows Store applications. This includes:
    • Wrappers for the HealthVault data types, common types and vocabulary objects.
    • Storage helpers for assisting with caching and synchronizing data between HealthVault and a Windows Store app.
  • sample: A Windows Store sample application written in Javascript that demonstrates how to build Windows Store apps that work with HealthVault.

Getting the Project

  • Download the project release zip file or sync the project Source Code by connecting with TFS or Subversion.

Building and running the sample application

  • This section describes how to build and run the Javascript sample application that's part of this library. This sample apps demonstrates how to build Windows Store applications that connect to HealthVault using the Javascript programming model. See below for building a XAML-based Windows Store app that connected to HealthVault.
  • Install Visual Studio 2012 or Visual Studio Express 2012 for Windows 8
  • Navigate to the /sample/ folder in the project and open hvJS.sln
  • The solution file opens in Visual Studio and references the 3 components listed above.
  • Hit Ctrl-F5 to run the sample application.
    • Alternatively, hit F5 to debug the sample application. The code in /sample/js/default.js file is executed early on and is a good place to set a breakpoint for stepping through.
  • When the app starts up, a new browser will be launched and you'll see a screen similar to the screenshot one below. This is the HeathVault sign-in / sign-up screen in the HealthVault Pre-Production (PPE) environment. From here you'll create a HealthVault account and authorize the "Windows 8 Test Sample" application to access a HealthVault record.
  • Once the above is complete, the HealthVault Shell will indicate that you should return to the sample app. Navigating to the sample app, you'll see a screen that looks like the screenshot below. From here you can experiment with the sample app and explore the library's capabilities.

XAML-based Windows Store applications for HealthVault

This library includes a javascript-based sample application. This section describes how to build a XAML-based Windows Store application for HealthVault.
  • In Visual Studio click File->New Project then select Visual C#->Windows Store from the left nav. From the middle window select Blank App (XAML). Name the project and create it.
  • Once the solution is created, right click the solution from the solution explorer and click Add->Existing Project. Add the following projects to the solution:
    • /hvsdk/HealthVault.Foundation.csproj and
    • /hvrt/HealthVault.Runtime.csproj
  • Now right-click the References node of the XAML project created above and select Add Reference....
  • Select the HealthVault.Foundation project and the HealthVault.Runtime project and continue.
  • At this point the C# XAML-based application is ready to be developed. For instance, you can add the following code to the OnNavigatedTo method in the MainPage.xaml.cs file and then run the application.

var app = new HealthVault.Foundation.HealthVaultApp("c24d9800-236f-48e3-b06b-bdf90a6cb0be");
await app.StartAsync(); 
  • (Note, the appID c24d9800.... above is the sample app's appID and is used as an example. You should change this to your own appID at some point during development of your application).
  • This will bring up the HealthVault sign-in page and ask you to authorize a record.
  • Once completed, you'll be brought back to an empty application.
  • Calling app.StartAsync() one more time allows the app to make calls to the HealthVault service.
  • You can now add your C# XAML-based code to the application.

Last edited Jan 29, 2013 at 3:22 AM by ali_emami, version 38