The following sample code shows how to download an object body with the transfer-at-once method.
Here is what is happening in the sample code:
- Create a
KiiObject instance by calling the
- Create a reference to the target file (myImage.jpg).
- Start downloading by calling the
onTransferProgress() method will be called as the download progresses. The method can reach 100% on the first call if the data size is small.
You might need to get rutime permissions for accessing an external storage during the object body downloading. See Getting runtime permissions for the implementation details.