Creating Custom Types
Extending a HealthVault data type might not always solve your data needs. Many times there are legitimate use cases for which the application needs a unique data repository. For example, in our Quantified Self application, we need a repository to store all of the user’s self-experiments.
HealthVault provides a mechanism called an application-specific type for this purpose. This type is not shareable with other applications. Once application developers find a broader use for their data, they can work with Microsoft to create a first-class data type for their needs.
Example 4-11 shows
how one can use an application-specific type to store self-experiment
hypotheses for the Quantified Self application. In our application we are
asking a user to create a hypothesis using a simple text box. The value of
this text box is read as the hypothesis string in Line
. In Lines
–
, we create an XML document with the data for this
specific type and then add it to the document using
ApplicationSpecificXml in Line
. Each application-specific type requires a
SubtypeTag and Description (Lines ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access