1
Vote

how to get BP ,BG,Hight,Document from Health vaulth

description

for get weight code is

static List<String> getHights(Record selectedRecord,HealthVaultService service)
        {
            Record record = selectedRecord;

            SimpleRequestTemplate template = new SimpleRequestTemplate(
                    service.getConnection(),
                    record.getPersonId(),
                    record.getId());

            String info = "<info><group max=\"25\"><filter><type-id>" +
                    height.TYPE +
                "</type-id></filter><format><section>core</section>" +
                "<xml/></format></group></info>";

            Request request = new Request();
            request.setMethodName("GetThings");
            request.setInfo(info);

            return (List<String>)template.makeRequest(request, new RequestMarshaller() {
                public Object marshal(InputStream istream) throws Exception {
                    XmlPullParserFactory factory = XmlPullParserFactory.newInstance();
                    factory.setNamespaceAware(false);
                    XmlPullParser parser= factory.newPullParser();    
                    parser.setInput(istream, "utf8");

                    XmlUtils.nextStartTag(parser, "response");
                    XmlUtils.nextStartTag(parser, "status");
                    XmlUtils.skipSubTree(parser);
                    XmlUtils.nextStartTag(parser, "wc:info");
                    XmlUtils.nextStartTag(parser, "group");

                    List<String> height = new ArrayList<String>();

                    while (parser.nextTag() == XmlPullParser.START_TAG) {
                      if ("thing".equals(parser.getName())) {
                          int thingDepth = parser.getDepth();
                          while (parser.nextTag() == XmlPullParser.START_TAG
                                  && parser.getDepth() > thingDepth) {
                              if ("data-xml".equals(parser.getName()))
                              {
                                  int dataXmlDepth = parser.getDepth();
                                  while (parser.nextTag() == XmlPullParser.START_TAG
                                          && parser.getDepth() > dataXmlDepth) {
                                      if ("height".equals(parser.getName())) {
                                          height.add(
                                              String.valueOf(Weight.createFromXml(parser).getValue()));
                                      } 
                                      else {
                                          XmlUtils.skipSubTree(parser);
                                      }
                                  }
                              }
                              else
                              {
                                  XmlUtils.skipSubTree(parser);
                              }
                          }
                      } else {
                         XmlUtils.skipSubTree(parser);
                      }
                    }

                    return height;
                }
            });
        }

1>Here I can't understand

String info = "<info><group max=\"25\"><filter><type-id>" +
                    height.TYPE +
                "</type-id></filter><format><section>core</section>" +
                "<xml/></format></group></info>";
for get BP and BG what should be the info String

Where we get all information for creating info String


2) I want to print the response come from Health vault server for above method(above method is taken from Weight-app of SDK) ?

There is any way to print the response??

comments