-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cache files for offline usage #14
Comments
It appears that the android-preview-sdk can only cache thumbnail(for image) and metadata(for files) and not the actual content as opposed to the ios-preview-sdk on ios(as per ios-preview-sdk docs, content caching is possible).Is content caching going to be implemented for android-preview-sdk as well? If already present please provide guidance for implementing same. |
Thank you for the input. We will look into making this caching logic public. Currently it is possible through extending BoxApiPreview and overwriting the getOfflineRequests method which is protected. |
Looking at our code again there is another way to do this by calling BoxPreviewViewPager.getCacheFileRequest(final PreviewController previewController, final BoxFile file) . |
Thanks for the reply. We had tried the 2nd approach. But it just cached the preview as mentioned in my earlier comment. We will try the first approach. |
Not sure what you mean by actual content. The sdk caching methods are
designed to store enough data on a given file so that it can be shown in
the preview sdk when offline. It won't necessarily store the original file
if that's what you meant.
…On Nov 6, 2017 9:49 PM, "upendrapatil" ***@***.***> wrote:
Thanks for the reply. We had tried the 2nd approach. But it just cached
the preview as mentioned in my earlier comment. We will try the first
approach.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#14 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAmHYvNz4EM7lbJQNBqSQdzSt71zwQlrks5sz-9kgaJpZM4N_JZa>
.
|
Lets say I have an image of 5000x5000.When I use the preview sdk method BoxPreviewViewPager.getCacheFileRequest()..it internally calls BoxPreviewImageFragment.getCachePreviewRequest() which uses 1024 size, while I want the original 5000x5000 image to be cached for preview. Its just an example but I believe that should help clarify what I mean by actual content. |
Thanks for clarifying. The reason why we use the 1024 thumbnails is actually to handle this situation as extremely high resolution images will not only be slow to download, but can cause memory/performance issues when displayed. If you are absolutely certain the original image is suitable for display you can implement PreviewController (and Serializable) or extend DefaultPreviewController and implement the download thumbnail method. You can change the implementation of PreviewController in the intent to launch preview activity. This is the implementation in our DefaultPreviewController for some guidance:
|
I am building the android app which uses box-content and box-preview api's, as box-preview api allows cache policy i want to use that and cache the files for offline purpose. But i can't find any documentation for the same nor the example.
Can anyone help me with how can i use the api to cache the file for offline usage. Also how to read the cached file.
The text was updated successfully, but these errors were encountered: