Downloading PDF onto Android Device

Apr 16, 2014 at 12:55 PM
Hi,

I am trying to download a PDF file from Ms. Health Vault using Android Application.
But the PDFs downloaded are always empty.

Could you please suggest me the method of downloading the PDF file.
Coordinator
Apr 21, 2014 at 4:15 PM
Hi,

In order to download attachments, you need to include instructions in your GetThings request which inform HV to return the attached blob(s).

The easiest approach is to do this:
ThingFormatSpec2 format = new ThingFormatSpec2();
        format.getSection().add(ThingSectionSpec2.core);
        format.getSection().add(ThingSectionSpec2.blobpayload);
        format.getXml().add("");
        format.setBlobPayloadRequest(getBlobPayloadRequest());
        
        return format;
    }
    
    private static BlobPayloadRequest getBlobPayloadRequest() {
        BlobFormat format = new BlobFormat();
        format.setBlobFormatSpec(BlobFormatSpec.inline);
        
        BlobPayloadRequest blobPayload = new BlobPayloadRequest();
        blobPayload.setBlobFormat(format);
        
        return blobPayload;
    }
.