Android Box Browse SDK

Box Android Browse SDK

License

License

GroupId

GroupId

com.box
ArtifactId

ArtifactId

box-android-browse-sdk
Last Version

Last Version

3.0.1
Release Date

Release Date

Type

Type

aar
Description

Description

Android Box Browse SDK
Box Android Browse SDK
Project URL

Project URL

https://github.com/box/box-android-browse-sdk
Source Code Management

Source Code Management

https://github.com/box/box-android-browse-sdk

Download box-android-browse-sdk

How to add to project

<!-- https://jarcasting.com/artifacts/com.box/box-android-browse-sdk/ -->
<dependency>
    <groupId>com.box</groupId>
    <artifactId>box-android-browse-sdk</artifactId>
    <version>3.0.1</version>
    <type>aar</type>
</dependency>
// https://jarcasting.com/artifacts/com.box/box-android-browse-sdk/
implementation 'com.box:box-android-browse-sdk:3.0.1'
// https://jarcasting.com/artifacts/com.box/box-android-browse-sdk/
implementation ("com.box:box-android-browse-sdk:3.0.1")
'com.box:box-android-browse-sdk:aar:3.0.1'
<dependency org="com.box" name="box-android-browse-sdk" rev="3.0.1">
  <artifact name="box-android-browse-sdk" type="aar" />
</dependency>
@Grapes(
@Grab(group='com.box', module='box-android-browse-sdk', version='3.0.1')
)
libraryDependencies += "com.box" % "box-android-browse-sdk" % "3.0.1"
[com.box/box-android-browse-sdk "3.0.1"]

Dependencies

compile (3)

Group / Artifact Type Version
com.box : box-android-sdk jar 5.0.0
androidx.appcompat » appcompat jar 1.0.2
androidx.recyclerview » recyclerview jar 1.0.0

Project Modules

There are no modules declared in this project.

Box Android Browse SDK

This SDK enables the ability to easily browse through Box storage to pick a folder/file.

Developer Setup

The SDK can be obtained by adding it as a maven dependency, cloning the source into your project, or by downloading one of the precompiled JARs from the releases page on GitHub.

Gradle:

implementation 'com.box:box-android-browse-sdk:3.0.0'

Maven:

<dependency>
    <groupId>com.box</groupId>
    <artifactId>box-android-browse-sdk</artifactId>
    <version>3.0.0</version>
</dependency>

If not using Gradle or Maven, this SDK has the following dependencies and will need to be included in your project:

The SDK was migrated to AndroidX in version 3.0.0. Latest stable version with support library is 2.1.0.

Quickstart

You will need a BoxSession and the BoxItem from the box-content-sdk. Please refer to the documentation of the box-content-sdk for additional details.

    BoxSession session = new BoxSession(MainActivity.this);
    BoxFolder folder = new BoxApiFolder(session).getInfo("<FOLDER_ID>").send();

####File Picker To launch the activity to browse a given folder and pick a file:

    startActivityForResult(BoxBrowseFileActivity.getLaunchIntent(MainActivity.this, "<FOLDER_ID>", session), "<YOUR_REQUEST_CODE>");

To receive the result from the file picker after you picked a file, implement onActivityResult in your activity:

    @Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        if (requestCode ==  "<YOUR_REQUEST_CODE>") {
            if (resultCode == Activity.RESULT_OK) {
                BoxFile boxFile = (BoxFile) data.getSerializableExtra(FilePickerActivity.EXTRA_BOX_FILE);
                // Your own code to handle boxFile goes here.
            } else {
                // Your error handling code.
            }
        }
    }

####Folder Picker To launch the activity to browse a given folder and pick a folder:

    startActivityForResult(BoxBrowseFolderActivity.getLaunchIntent(MainActivity.this, "<FOLDER_ID>", session),  "<YOUR_REQUEST_CODE>");

To receive the result from the file picker after you picked a folder, implement onActivityResult in your activity:

    @Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        if (requestCode ==  "<YOUR_REQUEST_CODE>") {
            if (resultCode == Activity.RESULT_OK) {
                BoxFolder boxFolder = (BoxFolder) data.getSerializableExtra(FolderPickerActivity.EXTRA_BOX_FOLDER);
                // Your own code to handle boxFile goes here.
            } else {
                // Your error handling code.
            }
        }
    }

Sample App

A sample app can be found in the box-browse-sample folder.

Copyright and License

Copyright 2015 Box, Inc. All rights reserved.

Licensed 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

http://www.apache.org/licenses/LICENSE-2.0

Unless 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.

com.box

Box

Box, Inc.

Versions

Version
3.0.1
3.0.0
2.1.0
2.0.3
2.0.2
2.0.1
2.0.0
1.1.2
1.1.1
1.1.0