OneDrive / onedrive-sdk-android

OneDrive SDK for Android!
https://dev.onedrive.com
Other
148 stars 52 forks source link

Expand Children and thumbnails with new API? #32

Closed phileo closed 8 years ago

phileo commented 8 years ago

In the old API, I used the following QueryOptions request to retrieve expanded collection of children with medium res thumbnails:

children(expand=thumbnails(select=medium)),thumbnails(select=medium)

How would I achieve the equivalent result in the new API?

oneDriveClient .getDrive() .getRoot() .buildRequest() .expand(???) .get(callback);

peternied commented 8 years ago

For a specific item you'd want a expand statement like "thumbnails(select=medium)", he is how it could look from your example.

oneDriveClient
   .getDrive()
   .getItem(itemId)
   .buildRequest()
   .expand("thumbnails(select=medium)")
   .get(callback);

I noticed that your first referenced example used a children expansion as well, you can do that with this API too, it would look like this:

oneDriveClient
   .getDrive()
   .getItem(itemId)
   .buildRequest()
   .expand("children(expand=thumbnails(select=medium))")
   .get(callback);

For reference, the OneDrive Explorer for Android uses nearly this behavoir, see its usage within its main item fragment.

phileo commented 8 years ago

Thanks for the prompt response! I will try that out.

peternied commented 8 years ago

Please reopen if you are still having issues, thanks!