Package com.dropbox.core.android
Class DbxOfficialAppConnector
- java.lang.Object
-
- com.dropbox.core.android.DbxOfficialAppConnector
-
public class DbxOfficialAppConnector extends java.lang.ObjectThe DbxOfficialAppConnector is used by an app to communicate with the Official Android Dropbox app.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classDbxOfficialAppConnector.DbxOfficialAppInstallInfo
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringACTION_DBXC_EDITstatic java.lang.StringACTION_DBXC_VIEWstatic java.lang.StringACTION_SHOW_DROPBOX_PREVIEWstatic java.lang.StringACTION_SHOW_UPGRADEstatic java.lang.StringEXTRA_CALLING_PACKAGEstatic java.lang.StringEXTRA_DROPBOX_PATHstatic java.lang.StringEXTRA_DROPBOX_READ_ONLYstatic java.lang.StringEXTRA_DROPBOX_REVstatic java.lang.StringEXTRA_DROPBOX_SESSION_IDstatic java.lang.StringEXTRA_DROPBOX_UIDprotected java.lang.Stringuiduid associated with this DbxOfficialAppConnector
-
Constructor Summary
Constructors Constructor Description DbxOfficialAppConnector(java.lang.String uid)Construct DbxOfficialAppConnector
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddExtrasToIntent(android.content.Context context, android.content.Intent intent)Add uid information to an explicit intent directed to DropboxAppstatic android.content.IntentgenerateOpenWithIntentFromUtmContent(java.lang.String UtmContent)Decodes a Google Play Campaign attribution utm_content field that was generated by Dropbox OpenWith flow.static android.content.IntentgetDropboxPlayStoreIntent()android.content.IntentgetPreviewFileIntent(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.android.content.IntentgetUpgradeAccountIntent(android.content.Context context)static booleanisAnySignedIn(android.content.Context context)static DbxOfficialAppConnector.DbxOfficialAppInstallInfoisInstalled(android.content.Context context)booleanisSignedIn(android.content.Context context)protected android.content.IntentlaunchDropbox(android.content.Context context)
-
-
-
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 DropboxUidNotInitializedExceptionConstruct DbxOfficialAppConnector- Parameters:
uid- The extra that goes in an intent when returning from Dropbox auth to provide the user's Dropbox UID.- Throws:
DropboxUidNotInitializedException- whenuidis 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
-
isInstalled
public static DbxOfficialAppConnector.DbxOfficialAppInstallInfo isInstalled(android.content.Context context)
- Returns:
- Information about installed version of DropboxApp. Returns null if DropboxApp is not installed
-
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 previewlastRev- 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 DropboxParseExceptionDecodes 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
-
-