Android Open Source - box-android-sdk-v2-master Box Android Client






From Project

Back to project page box-android-sdk-v2-master.

License

The source code is released under:

Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRI...

If you think the Android project box-android-sdk-v2-master listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.box.boxandroidlibv2;
/*w  w  w . ja v a 2  s  . c o  m*/
import com.box.boxandroidlibv2.dao.BoxAndroidOAuthData;
import com.box.boxandroidlibv2.jsonparsing.AndroidBoxResourceHub;
import com.box.boxjavalibv2.BoxClient;
import com.box.boxjavalibv2.dao.BoxOAuthToken;
import com.box.boxjavalibv2.interfaces.IAuthFlowMessage;
import com.box.boxjavalibv2.interfaces.IBoxJSONParser;
import com.box.boxjavalibv2.interfaces.IBoxResourceHub;
import com.box.restclientv2.interfaces.IBoxConfig;

/**
 * This is the main entrance of the sdk. The client contains all resource managers and also handles authentication. Make sure you call authenticate method
 * before making any api calls. you can use the resource managers to execute requests <b>synchronously</b> against the Box REST API(V2). Full details about the
 * Box API can be found at {@see <a href="http://developers.box.com/docs">http://developers.box.com/docs</a>} . You must have an OpenBox application with a
 * valid API key to use the Box API. All methods in this class are executed in the invoking thread, and therefore are NOT safe to execute in the UI thread of
 * your application. You should only use this class if you already have worker threads or AsyncTasks that you want to incorporate the Box API into.
 */
public class BoxAndroidClient extends BoxClient {

    /**
     * This constructor has some connection parameters. They are used to periodically close idle connections that HttpClient opens.
     * 
     * @param maxConnection
     *            maximum connection.
     * @param maxConnectionPerRoute
     *            maximum connection allowed per route.
     * @param timePeriodCleanUpIdleConnection
     *            clean up idle connection every such period of time. in miliseconds.
     * @param idleTimeThreshold
     *            an idle connection will be closed if idled above this threshold of time. in miliseconds.
     */
    public BoxAndroidClient(final String clientId, final String clientSecret, final IBoxResourceHub hub, final IBoxJSONParser parser, final int maxConnection,
        final int maxConnectionPerRoute, final long timePeriodCleanUpIdleConnection, final long idleTimeThreshold) {
        super(clientId, clientSecret, hub, parser, maxConnection, maxConnectionPerRoute, timePeriodCleanUpIdleConnection, idleTimeThreshold);
    }

    /**
     * @param clientId
     *            client id
     * @param clientSecret
     *            client secret
     * @param resourcehub
     *            resource hub, use null for default resource hub.
     * @param parser
     *            json parser, use null for default parser.
     */
    public BoxAndroidClient(final String clientId, final String clientSecret, final IBoxResourceHub resourcehub, final IBoxJSONParser parser) {
        super(clientId, clientSecret, resourcehub, parser);
    }

    @Deprecated
    public BoxAndroidClient(String clientId, String clientSecret) {
        super(clientId, clientSecret);
    }

    @Override
    protected IBoxResourceHub createResourceHub() {
        return new AndroidBoxResourceHub();
    }

    @Override
    public IBoxConfig getConfig() {
        return BoxAndroidConfig.getInstance();
    }

    @Override
    protected BoxOAuthToken getOAuthTokenFromMessage(IAuthFlowMessage message) {
        return new BoxAndroidOAuthData(super.getOAuthTokenFromMessage(message));
    }
}




Java Source Code List

com.box.android.sample.BoxSDKSampleApplication.java
com.box.android.sample.FileListActivity.java
com.box.android.sample.FileListAdapter.java
com.box.androidlibv2.sample.oauth.OAuthActivity.java
com.box.androidlibv2.sample.oauth.OAuthSampleApplication.java
com.box.boxandroidlibv2.BoxAndroidClient.java
com.box.boxandroidlibv2.BoxAndroidConfig.java
com.box.boxandroidlibv2.activities.FilePickerActivity.java
com.box.boxandroidlibv2.activities.FolderNavigationActivity.java
com.box.boxandroidlibv2.activities.FolderPickerActivity.java
com.box.boxandroidlibv2.activities.OAuthActivity.java
com.box.boxandroidlibv2.adapters.BoxListItemAdapter.java
com.box.boxandroidlibv2.adapters.NavigationListAdapter.java
com.box.boxandroidlibv2.dao.BoxAndroidCollaboration.java
com.box.boxandroidlibv2.dao.BoxAndroidCollection.java
com.box.boxandroidlibv2.dao.BoxAndroidComment.java
com.box.boxandroidlibv2.dao.BoxAndroidEmailAlias.java
com.box.boxandroidlibv2.dao.BoxAndroidEmail.java
com.box.boxandroidlibv2.dao.BoxAndroidEnterprise.java
com.box.boxandroidlibv2.dao.BoxAndroidEventCollection.java
com.box.boxandroidlibv2.dao.BoxAndroidEvent.java
com.box.boxandroidlibv2.dao.BoxAndroidFileVersion.java
com.box.boxandroidlibv2.dao.BoxAndroidFile.java
com.box.boxandroidlibv2.dao.BoxAndroidFolder.java
com.box.boxandroidlibv2.dao.BoxAndroidGroupMembership.java
com.box.boxandroidlibv2.dao.BoxAndroidGroup.java
com.box.boxandroidlibv2.dao.BoxAndroidOAuthData.java
com.box.boxandroidlibv2.dao.BoxAndroidSharedLinkPermissions.java
com.box.boxandroidlibv2.dao.BoxAndroidSharedLink.java
com.box.boxandroidlibv2.dao.BoxAndroidUser.java
com.box.boxandroidlibv2.dao.BoxAndroidWebLink.java
com.box.boxandroidlibv2.dao.BoxParcel.java
com.box.boxandroidlibv2.exceptions.BoxAndroidLibException.java
com.box.boxandroidlibv2.exceptions.IBoxAndroidLibException.java
com.box.boxandroidlibv2.exceptions.UserTerminationException.java
com.box.boxandroidlibv2.jsonparsing.AndroidBoxResourceHub.java
com.box.boxandroidlibv2.manager.ThumbnailManager.java
com.box.boxandroidlibv2.viewdata.BoxListItem.java
com.box.boxandroidlibv2.viewdata.NavigationItem.java
com.box.boxandroidlibv2.viewlisteners.OAuthWebViewListener.java
com.box.boxandroidlibv2.viewlisteners.StringMessage.java
com.box.boxandroidlibv2.views.OAuthWebView.java
com.example.helloworld.HelloWorldApplication.java
com.example.helloworld.MainActivity.java