Class DbxOfficialAppConnector


  • public class DbxOfficialAppConnector
    extends java.lang.Object
    The DbxOfficialAppConnector is used by an app to communicate with the Official Android Dropbox app.
    • Field Detail

      • ACTION_SHOW_UPGRADE

        public static final java.lang.String ACTION_SHOW_UPGRADE
        See Also:
        Constant Field Values
      • EXTRA_DROPBOX_UID

        public static final java.lang.String EXTRA_DROPBOX_UID
        See Also:
        Constant Field Values
      • EXTRA_CALLING_PACKAGE

        public static final java.lang.String EXTRA_CALLING_PACKAGE
        See Also:
        Constant Field Values
      • ACTION_DBXC_EDIT

        public static final java.lang.String ACTION_DBXC_EDIT
        See Also:
        Constant Field Values
      • ACTION_DBXC_VIEW

        public static final java.lang.String ACTION_DBXC_VIEW
        See Also:
        Constant Field Values
      • ACTION_SHOW_DROPBOX_PREVIEW

        public static final java.lang.String ACTION_SHOW_DROPBOX_PREVIEW
        See Also:
        Constant Field Values
      • EXTRA_DROPBOX_PATH

        public static final java.lang.String EXTRA_DROPBOX_PATH
        See Also:
        Constant Field Values
      • EXTRA_DROPBOX_READ_ONLY

        public static final java.lang.String EXTRA_DROPBOX_READ_ONLY
        See Also:
        Constant Field Values
      • EXTRA_DROPBOX_REV

        public static final java.lang.String EXTRA_DROPBOX_REV
        See Also:
        Constant Field Values
      • EXTRA_DROPBOX_SESSION_ID

        public static final java.lang.String EXTRA_DROPBOX_SESSION_ID
        See Also:
        Constant Field Values
      • uid

        protected java.lang.String uid
        uid associated with this DbxOfficialAppConnector
    • Constructor Detail

      • DbxOfficialAppConnector

        public DbxOfficialAppConnector​(java.lang.String uid)
                                throws DropboxUidNotInitializedException
        Construct DbxOfficialAppConnector
        Parameters:
        uid - The extra that goes in an intent when returning from Dropbox auth to provide the user's Dropbox UID.
        Throws:
        DropboxUidNotInitializedException - when uid is empty
    • Method Detail

      • addExtrasToIntent

        protected void addExtrasToIntent​(android.content.Context context,
                                         android.content.Intent intent)
        Add uid information to an explicit intent directed to DropboxApp
      • isAnySignedIn

        public static boolean isAnySignedIn​(android.content.Context context)
        Returns:
        If any account is connected to DropboxApp
      • getDropboxPlayStoreIntent

        public static android.content.Intent getDropboxPlayStoreIntent()
        Returns:
        Intent that when passed into startActivity() will launch the Play Store page for Dropbox.
      • isSignedIn

        public boolean isSignedIn​(android.content.Context context)
        Returns:
        If authorized user is signed in to DropboxApp
      • launchDropbox

        protected android.content.Intent launchDropbox​(android.content.Context context)
      • getUpgradeAccountIntent

        public android.content.Intent getUpgradeAccountIntent​(android.content.Context context)
        Returns:
        Intent that when passed into startActivity() will start Dropbox account upgrade flow. If DropboxApp is installed, upgrade flow will launch an activity within DropboxApp. Otherwise, a web browser will be launched
      • getPreviewFileIntent

        public android.content.Intent getPreviewFileIntent​(android.content.Context context,
                                                           java.lang.String path,
                                                           java.lang.String lastRev)
        Display the DropboxApp's preview of file located at path This function should only be called if file was opened through DropboxAPI. If path refers to a directory (as defined by having a '/' at end, will show Dropbox file tree.

        You won't need to use this unless you are our official partner in openwith.

        Parameters:
        path - path of file in authorized user's Dropbox to preview
        lastRev - The revision of file user is seeing (as returned by DropboxAPI.getFile/DropboxAPI.putFile)
        Returns:
        Intent that when passed into startActivity() displays Dropbox preview Returns null if DropboxApp is not installed
      • generateOpenWithIntentFromUtmContent

        public static android.content.Intent generateOpenWithIntentFromUtmContent​(java.lang.String UtmContent)
                                                                           throws DropboxParseException
        Decodes a Google Play Campaign attribution utm_content field that was generated by Dropbox OpenWith flow. This should only be called if utm_source=”dropbox_android_openwith”. See https://developers.google.com/analytics/devguides/collection/android/v4/campaign for more information about how to use Play Store attribution.

        You won't need to use this unless you are our official partner in openwith.

        Parameters:
        UtmContent - GooglePlay utm content that has been urldecoded
        Returns:
        Intent OpenWith intent that, when launched, will open the file the user requested to edit. Caller MUST convert intent into an explicit intent it can handle.
        Throws:
        DropboxParseException - if cannot produce Intent from UtmContent