Package com.dropbox.core.android
Class DbxOfficialAppConnector
- java.lang.Object
-
- com.dropbox.core.android.DbxOfficialAppConnector
-
public class DbxOfficialAppConnector extends java.lang.Object
The 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 class
DbxOfficialAppConnector.DbxOfficialAppInstallInfo
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
ACTION_DBXC_EDIT
static java.lang.String
ACTION_DBXC_VIEW
static java.lang.String
ACTION_SHOW_DROPBOX_PREVIEW
static java.lang.String
ACTION_SHOW_UPGRADE
static java.lang.String
EXTRA_CALLING_PACKAGE
static java.lang.String
EXTRA_DROPBOX_PATH
static java.lang.String
EXTRA_DROPBOX_READ_ONLY
static java.lang.String
EXTRA_DROPBOX_REV
static java.lang.String
EXTRA_DROPBOX_SESSION_ID
static java.lang.String
EXTRA_DROPBOX_UID
protected java.lang.String
uid
uid 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 void
addExtrasToIntent(android.content.Context context, android.content.Intent intent)
Add uid information to an explicit intent directed to DropboxAppstatic android.content.Intent
generateOpenWithIntentFromUtmContent(java.lang.String UtmContent)
Decodes a Google Play Campaign attribution utm_content field that was generated by Dropbox OpenWith flow.static android.content.Intent
getDropboxPlayStoreIntent()
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.android.content.Intent
getUpgradeAccountIntent(android.content.Context context)
static boolean
isAnySignedIn(android.content.Context context)
static DbxOfficialAppConnector.DbxOfficialAppInstallInfo
isInstalled(android.content.Context context)
boolean
isSignedIn(android.content.Context context)
protected android.content.Intent
launchDropbox(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 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
- whenuid
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
-
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 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
-
-