{"id":20119596,"url":"https://github.com/box/box-android-preview-sdk","last_synced_at":"2025-07-29T03:03:17.068Z","repository":{"id":57717981,"uuid":"45281719","full_name":"box/box-android-preview-sdk","owner":"box","description":"Box Android Preview SDK","archived":false,"fork":false,"pushed_at":"2019-08-05T12:39:31.000Z","size":109,"stargazers_count":13,"open_issues_count":7,"forks_count":10,"subscribers_count":51,"default_branch":"master","last_synced_at":"2025-05-06T14:37:19.137Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/box.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-10-30T23:36:08.000Z","updated_at":"2023-09-08T17:03:09.000Z","dependencies_parsed_at":"2022-08-24T11:10:54.935Z","dependency_job_id":null,"html_url":"https://github.com/box/box-android-preview-sdk","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/box/box-android-preview-sdk","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/box%2Fbox-android-preview-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/box%2Fbox-android-preview-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/box%2Fbox-android-preview-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/box%2Fbox-android-preview-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/box","download_url":"https://codeload.github.com/box/box-android-preview-sdk/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/box%2Fbox-android-preview-sdk/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267621572,"owners_count":24116899,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-29T02:00:12.549Z","response_time":2574,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-13T19:16:15.380Z","updated_at":"2025-07-29T03:03:17.046Z","avatar_url":"https://github.com/box.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"Box Android Preview SDK\n==============\nThis SDK enables you to support previewing Box files within your application.\n\nTypes of files supported:\n- images\n- PDFs\n- audio/video files\n- markdown/text/code files\n- Office documents\n\nCurrently not supported:\n- Box Notes\n\nDeveloper Setup\n--------------\nThe box preview sdk is currently private, and distributed as an aar file through maven:\n```gradle\n    implementation 'com.box:box-android-preview-sdk:3.0.3'\n```\n\nPlease refer to the build.gradle file in box-preview-sample for setting up your gradle dependencies.\n\n\nQuickstart\n--------------\nRefer to  [box-content-sdk](https://github.com/box/box-android-content-sdk) for details on how to set your client id, and secret;\nand authenticate the user.\n\nYou can get a BoxFile instance using the [box-content-sdk](https://github.com/box/box-android-content-sdk) \nor the [box-browse-sdk](https://github.com/box/box-android-browse-sdk) \n\nThe simplest way to preview a single file, is to start a BoxPreviewActivity, the intent for which can be created using the createIntentBuilder factory method.\n```java\n     BoxPreviewActivity.IntentBuilder builder = BoxPreviewActivity.createIntentBuilder(this, boxSession, boxFile);\n```\n\n### Modifying visibility of document preview menu items\nIt's possible to modify visibility of specific menu items in document preview by overriding `bool` resource value in consuming application.\nOptions available for modification with their default values:\n\n```xml\n\u003c!-- sets visibility of the grid menu option --\u003e\n\u003cbool name=\"box_previewsdk_document_menu_grid_visible\"\u003etrue\u003c/bool\u003e \n\u003c!-- sets visibility of the outline menu option --\u003e\n\u003cbool name=\"box_previewsdk_document_menu_outline_visible\"\u003etrue\u003c/bool\u003e \n```\n\nExample code is provided in the sample app repository.\n\n### Paging through multiple images, audio or video files\nPassing the BoxFolder to the intent builder BoxPreviewActivity allows the sdk to also load other files\nof the same type from the parent folder into a custom ViewPager called the BoxPreviewViewPager. \nAnother way of doing this, is to directly pass a BoxItems collection to the builder.\n\n```java\n     builder.setBoxFolder(boxFolder);\n```\n\n### Precaching files:\n\nTo preload files into the cache, without presenting them, make use of `com.box.androidsdk.preview.BoxPreviewViewPager.getCacheFileRequest` api.\n\n```java\n     FutureTask task = BoxPreviewViewPager.getCacheFileRequest(boxSession, previewStorage, boxFile);\n```\n\n### Customizing cache policy:\n\nYou can customize the max cache size (default 500MB), and cache age (default 90 days) by defining\n\n```java\ncom.box.androidsdk.preview.PreviewStorage.MAX_CACHE_SIZE \ncom.box.androidsdk.preview.PreviewStorage.MAX_CACHE_AGE\n```\n\nCache age defines how long an unaccessed file will stay in the cache, if it hasn't been cleared out of the LRU cache for memory.\n\n\nSample App\n--------------\nA sample app can be found in the [box-preview-sample](https://github.com/box/box-android-preview-sdk) folder.\n\nCopyright and License\n--------------\nCopyright 2015 Box, Inc. All rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at\n\nhttp://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbox%2Fbox-android-preview-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbox%2Fbox-android-preview-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbox%2Fbox-android-preview-sdk/lists"}