public final class EvernoteUtil
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
EvernoteUtil.EvernoteInstallStatus |
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
ACTION_AUTHORIZE
Action for an
Intent to authorize this app. |
static java.lang.String |
ACTION_GET_BOOTSTRAP_PROFILE_NAME
Action for an
Intent to receive the bootstrap profile name from the main Evernote app. |
static java.lang.String |
EXTRA_AUTHORIZATION_URL
Extra URL to authorize this app.
|
static java.lang.String |
EXTRA_BOOTSTRAP_PROFILE_NAME
Returned bootstrap profile name from the main Evernote app.
|
static java.lang.String |
EXTRA_OAUTH_CALLBACK_URL
Returned OAuth callback from the main Evernote app.
|
static java.lang.String |
NOTE_PREFIX
The ENML preamble to every Evernote note.
|
static java.lang.String |
NOTE_SUFFIX
The ENML postamble to every Evernote note.
|
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String |
bytesToHex(byte[] bytes)
Converts the provided byte array into a hexadecimal string
with two characters per byte.
|
static java.lang.String |
bytesToHex(byte[] bytes,
boolean withSpaces)
Takes the provided byte array and converts it into a hexadecimal string
with two characters per byte.
|
static android.content.Intent |
createAuthorizationIntent(android.content.Context context,
java.lang.String authorizationUrl,
boolean forceThirdPartyApp)
Creates an
Intent to authorize this app by the main Evernote app. |
static java.lang.String |
createEnMediaTag(Resource resource)
Create an ENML <en-media> tag for the specified Resource object.
|
static android.content.Intent |
createGetBootstrapProfileNameIntent(android.content.Context context,
EvernoteSession evernoteSession)
Returns an Intent to query the bootstrap profile name from the main Evernote app.
|
static java.lang.String |
generateUserAgentString(android.content.Context ctx)
Construct a user-agent string based on the running application and
the device and operating system information.
|
static EvernoteUtil.EvernoteInstallStatus |
getEvernoteInstallStatus(android.content.Context context,
java.lang.String action)
Checks if Evernote is installed and if the app can resolve this action.
|
static byte[] |
hash(byte[] body)
Returns an MD5 checksum of the provided array of bytes.
|
static byte[] |
hash(java.io.InputStream in)
Returns an MD5 checksum of the contents of the provided InputStream.
|
static byte[] |
hexToBytes(java.lang.String hexString)
Takes a string in hexadecimal format and converts it to a binary byte
array.
|
static void |
removeAllCookies(android.content.Context context)
Removes all cookies for this application.
|
public static final java.lang.String ACTION_AUTHORIZE
Intent to authorize this app.public static final java.lang.String ACTION_GET_BOOTSTRAP_PROFILE_NAME
Intent to receive the bootstrap profile name from the main Evernote app.public static final java.lang.String EXTRA_AUTHORIZATION_URL
public static final java.lang.String EXTRA_OAUTH_CALLBACK_URL
public static final java.lang.String EXTRA_BOOTSTRAP_PROFILE_NAME
public static final java.lang.String NOTE_PREFIX
public static final java.lang.String NOTE_SUFFIX
public static java.lang.String createEnMediaTag(Resource resource)
public static byte[] hash(byte[] body)
public static byte[] hash(java.io.InputStream in)
throws java.io.IOException
java.io.IOExceptionpublic static java.lang.String bytesToHex(byte[] bytes)
public static java.lang.String bytesToHex(byte[] bytes,
boolean withSpaces)
withSpaces - if true, include a space character between each hex-rendered
byte for readability.public static byte[] hexToBytes(java.lang.String hexString)
public static void removeAllCookies(android.content.Context context)
public static EvernoteUtil.EvernoteInstallStatus getEvernoteInstallStatus(android.content.Context context, java.lang.String action)
public static android.content.Intent createAuthorizationIntent(android.content.Context context,
java.lang.String authorizationUrl,
boolean forceThirdPartyApp)
Intent to authorize this app by the main Evernote app.context - The Context starting the Intent.authorizationUrl - The OAuth authorization URL.forceThirdPartyApp - If true, never use Evernote app to authenticate user.Intent.public static android.content.Intent createGetBootstrapProfileNameIntent(android.content.Context context,
EvernoteSession evernoteSession)
context - The Context starting the Intent.evernoteSession - The current session.null, if the main app
is not installed, not up to date or you do not want to use the main app to authenticate the
user.public static java.lang.String generateUserAgentString(android.content.Context ctx)