Evernote SDK for Android

Overview

Evernote SDK for Android version 2.0.0-RC4

Evernote API version 1.25

Overview

This SDK wraps the Evernote Cloud API and provides OAuth authentication functionality. The SDK is provided as an Android Library project that can be included in your application with Gradle.

Prerequisites

In order to use the code in this SDK, you need to obtain an API key from https://dev.evernote.com/doc/. You'll also find full API documentation on that page.

In order to run the demo code, you need a user account on the sandbox service where you will do your development. Sign up for an account at https://sandbox.evernote.com/Registration.action

The instructions below assume you have the latest Android SDK.

Download

Add the library as a dependency in your build.gradle file.

dependencies {
    compile 'com.evernote:android-sdk:2.0.0-RC4'
}
(Optional) Using a snapshot build for early access previews

Add Sonatype's snapshot repository in your build script.

maven {
    url "https://oss.sonatype.org/content/repositories/snapshots"
}

Add the snapshot depdendency.

dependencies {
    compile 'com.evernote:android-sdk:2.0.0-SNAPSHOT'
}

Demo App

The demo application 'Evernote SDK Demo' demonstrates how to use the Evernote SDK for Android to authentication to the Evernote service using OAuth, then access the user's Evernote account. The demo code provides multiple activities that show notebook listing, note creation, and resource creation in two scenarios: A plain text note creator and an image saver.

Running the demo app from Android Studio

To build and run the demo project from Android Studio:

  1. Open Android Studio
  2. Choose Import Project (Eclipse ADT, Gradle, etc.)
  3. Select the SDK root directory (the directory containing this README) and click OK
  4. Add your Evernote API consumer key and secret (see below)
Adding Evernote API consumer key and secret

You have two different options to add your consumer key and secret.

gradle.properties file (preferred)
  1. Open the folder ~/.gradle in your user's home directory.
  2. Open or create a file called gradle.properties
  3. Add a line EVERNOTE_CONSUMER_KEY=Your Consumer Key
  4. Add a line EVERNOTE_CONSUMER_SECRET=Your Consumer Secret
In code
  1. Open the class com.evernote.android.demo.DemoApp.java
  2. At the top of DemoApp.java, fill in your Evernote API consumer key and secret.

Usage SDK

Modify your AndroidManifest.xml

The SDK's OAuth functionality is implemented as an Android Activity that must be declared in your app's AndroidManifest.xml.

Starting with Android Gradle plugin version 1.0.0 the necessary activities are merged in your app's AndroidManifest.xml file and you don't need to do anything. Otherwise simply copy and paste the following snippet into your AndroidManifest.xml within the application section:

<activity android:name="com.evernote.client.android.EvernoteOAuthActivity" />
<activity android:name="com.evernote.client.android.login.EvernoteLoginActivity"/>

Set up an EvernoteSession

Define your app credentials (key, secret, and host). See http://dev.evernote.com/documentation/cloud/

private static final String CONSUMER_KEY = "Your consumer key";
private static final String CONSUMER_SECRET = "Your consumer secret";
private static final EvernoteSession.EvernoteService EVERNOTE_SERVICE = EvernoteSession.EvernoteService.SANDBOX;

When your app starts, initialize the EvernoteSession singleton that has all of the information that is needed to authenticate to Evernote. The EvernoteSession instance of saved statically and does not need to be passed between activities. The better option is to build the instance in your onCreate() of the Application object or your parent Activity object.

mEvernoteSession = new EvernoteSession.Builder(this)
    .setEvernoteService(EVERNOTE_SERVICE)
    .setSupportAppLinkedNotebooks(SUPPORT_APP_LINKED_NOTEBOOKS)
    .build(consumerKey, consumerSecret)
    .asSingleton();

Give the user a way to initiate authentication

In our demo app, we have a "Login" button that initiates the authentication process. You might choose to do something similar, or you might simply initiate authentication the first time that the user tries to access Evernote-related functionality.

The recommended approach is to use FragmentActivitys. Then the authentication process opens a dialog and no extra Activity. But normal Activitys are supported as well.

mEvernoteSession.authenticate(this);

Evernote and Yinxiang Biji Service Bootstrapping

The Activity that completes the OAuth authentication automatically determines if the User is on the Evernote service or the Yinxiang service and configures the end points automatically.

If you want to test if bootstrapping works within your app, you can either change the device's language to Chinese or you can set a specific Locale object in the session builder, e.g. new EvernoteSession.Builder(this).setLocale(Locale.SIMPLIFIED_CHINESE). If the SDK can't decide which server to use, then the user has the option to change the Evernote service while authenticating.

Complete authentication

If you use a FragmentActivity, you should implement the EvernoteLoginFragment.ResultCallback interface.

public class MyActivity extends Activity implements EvernoteLoginFragment.ResultCallback {

    // ...

    @Override
    public void onLoginFinished(boolean successful) {
        // handle result
    }
}    

If you use a normal Activity, you should override onActivityResult.

@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
    switch (requestCode) {
        case EvernoteSession.REQUEST_CODE_LOGIN:
            if (resultCode == Activity.RESULT_OK) {
                // handle success
            } else {
                // handle failure
            }        
            break;
            
        default:
            super.onActivityResult(requestCode, resultCode, data);
            break;
    }
}

Snippets

Calling EvernoteSession.getEvernoteClientFactory() will give you access to async wrappers around NoteStore.Client or UserStore.Client. Browse the API JavaDocs at http://dev.evernote.com/documentation/reference/javadoc/

The EvernoteClientFactory also creates multiple helper classes, e.g. EvernoteHtmlHelper to download a note as HTML.

Create an EvernoteNoteStoreClient to access primary methods for personal note data

EvernoteSession.getInstance().getEvernoteClientFactory().getNoteStoreClient();

Create an EvernoteUserStoreClient to access User related methods

EvernoteSession.getInstance().getEvernoteClientFactory().getUserStoreClient();

Create an EvernoteBusinessNotebookHelper to access Business Notebooks

EvernoteSession.getInstance().getEvernoteClientFactory().getBusinessNotebookHelper();

Create an EvernoteLinkedNotebookHelper to access shared notebooks

EvernoteSession.getInstance().getEvernoteClientFactory().getLinkedNotebookHelper(linkedNotebook);
Getting list of notebooks asynchronously
if (!EvernoteSession.getInstance().isLoggedIn()) {
    return;
}

EvernoteNoteStoreClient noteStoreClient = EvernoteSession.getInstance().getEvernoteClientFactory().getNoteStoreClient();
noteStoreClient.listNotebooksAsync(new EvernoteCallback<List<Notebook>>() {
    @Override
    public void onSuccess(List<Notebook> result) {
        List<String> namesList = new ArrayList<>(result.size());
        for (Notebook notebook : result) {
            namesList.add(notebook.getName());
        }
        String notebookNames = TextUtils.join(", ", namesList);
        Toast.makeText(getApplicationContext(), notebookNames + " notebooks have been retrieved", Toast.LENGTH_LONG).show();
    }

    @Override
    public void onException(Exception exception) {
        Log.e(LOGTAG, "Error retrieving notebooks", exception);
    }
});
Creating a note asynchronously
if (!EvernoteSession.getInstance().isLoggedIn()) {
    return;
}

EvernoteNoteStoreClient noteStoreClient = EvernoteSession.getInstance().getEvernoteClientFactory().getNoteStoreClient();

Note note = new Note();
note.setTitle("My title");
note.setContent(EvernoteUtil.NOTE_PREFIX + "My content" + EvernoteUtil.NOTE_SUFFIX);

noteStoreClient.createNoteAsync(note, new EvernoteCallback<Note>() {
    @Override
    public void onSuccess(Note result) {
        Toast.makeText(getApplicationContext(), result.getTitle() + " has been created", Toast.LENGTH_LONG).show();
    }

    @Override
    public void onException(Exception exception) {
        Log.e(LOGTAG, "Error creating note", exception);
    }
});
Using the EvernoteBusinessNotebookHelper to Access Evernote Business data
  1. Check if user is member of a business
  2. Create EvernoteBusinessNotebookHelper
  3. Call synchronous methods from a background thread or call async methods from UI thread

This note store is not long lived, the Business authentication token expires frequently and is refreshed if needed in the getBusinessNotebookHelper() method.

Example using the synchronous business methods inside a background thread to create a note in a business account

new Thread() {
    @Override
    public void run() {
        try {
            if (!EvernoteSession.getInstance().getEvernoteClientFactory().getUserStoreClient().isBusinessUser()) {
                Log.d(LOGTAG, "Not a business User");
                return;
            }

            EvernoteBusinessNotebookHelper businessNotebookHelper = EvernoteSession.getInstance().getEvernoteClientFactory().getBusinessNotebookHelper();
            List<LinkedNotebook> businessNotebooks = businessNotebookHelper.listBusinessNotebooks(EvernoteSession.getInstance());
            if (businessNotebooks.isEmpty()) {
                Log.d(LOGTAG, "No business notebooks found");
            }

            LinkedNotebook linkedNotebook = businessNotebooks.get(0);

            Note note = new Note();
            note.setTitle("My title");
            note.setContent(EvernoteUtil.NOTE_PREFIX + "My content" + EvernoteUtil.NOTE_SUFFIX);

            EvernoteLinkedNotebookHelper linkedNotebookHelper = EvernoteSession.getInstance().getEvernoteClientFactory().getLinkedNotebookHelper(linkedNotebook);
            final Note createdNote = linkedNotebookHelper.createNoteInLinkedNotebook(note);

            runOnUiThread(new Runnable() {
                @Override
                public void run() {
                    Toast.makeText(getApplicationContext(), createdNote.getTitle() + " has been created.", Toast.LENGTH_LONG).show();
                }
            });

        } catch (TException | EDAMUserException | EDAMSystemException | EDAMNotFoundException e) {
            e.printStackTrace();
        }
    }
}.start();

License

Copyright (c) 2007-2015 by Evernote Corporation, All rights reserved.

Use of the source code and binary libraries included in this package
is permitted under the following terms:

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:

    1. Redistributions of source code must retain the above copyright
    notice, this list of conditions and the following disclaimer.
    2. Redistributions in binary form must reproduce the above copyright
    notice, this list of conditions and the following disclaimer in the
    documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Comments
  • Using the Evernote SDK with Android Studio

    Using the Evernote SDK with Android Studio

    I am trying to set-up an Android Studio project with the Evernote SDK, but it does not seem to work.

    What I have tried:

    • Adding the JARs to the project module dependencies - this does not seem to work, because Android Studio uses Gradle. (http://stackoverflow...-android-studio)
    • Adding the evernote-sdk-android/library to the project, as described in this answer on StackOverflow: http://stackoverflow...16639227/221612

    This answer got me a little farther, but when compiling Evernote Android Studio is complaining:

    Information:Compilation completed with 101 errors and 0 warnings in 16 sec Information:101 errors Information:0 warnings Error:Gradle: Execution failed for task ':libraries:evernote-sdk:compileRelease'.

    Compilation failed; see the compiler error output for details. /Users/kenny/AndroidStudioProjects/GreenDiaryProject/libraries/evernote-sdk/src/com/evernote/client/android/AsyncBusinessNoteStoreClient.java Error:Error:line (28)Gradle: package com.evernote.edam.error does not exist Error:Error:line (29)Gradle: package com.evernote.edam.error does not exist Error:Error:line (30)Gradle: package com.evernote.edam.error does not exist Error:Error:line (31)Gradle: package com.evernote.edam.type does not exist Error:Error:line (32)Gradle: package com.evernote.edam.type does not exist Error:Error:line (33)Gradle: package com.evernote.edam.type does not exist Error:Error:line (34)Gradle: package com.evernote.edam.type does not exist Error:Error:line (35)Gradle: package com.evernote.thrift does not exist Error:Error:line (36)Gradle: package com.evernote.thrift.protocol does not exist Error:Error:line (37)Gradle: package com.evernote.thrift.transport does not exist Error:Error:line (60)Gradle: cannot find symbol class TProtocol Error:Error:line (60)Gradle: cannot find symbol class TProtocol Error:Error:line (60)Gradle: cannot find symbol class TTransportException Error:Error:line (79)Gradle: cannot find symbol class Note Error:Error:line (79)Gradle: cannot find symbol class LinkedNotebook Error:Error:line (79)Gradle: cannot find symbol class Note Error:Error:line (79)Gradle: cannot find symbol class EDAMUserException Error:Error:line (79)Gradle: cannot find symbol class EDAMSystemException Error:Error:line (79)Gradle: cannot find symbol class TException Error:Error:line (79)Gradle: cannot find symbol class EDAMNotFoundException Error:Error:line (100)Gradle: cannot find symbol class LinkedNotebook Error:Error:line (100)Gradle: cannot find symbol class EDAMUserException Error:Error:line (100)Gradle: cannot find symbol class EDAMSystemException Error:Error:line (100)Gradle: cannot find symbol class TException Error:Error:line (100)Gradle: cannot find symbol class EDAMNotFoundException Error:Error:line (119)Gradle: cannot find symbol class Notebook Error:Error:line (119)Gradle: cannot find symbol class LinkedNotebook Error:Error:line (119)Gradle: cannot find symbol class TException Error:Error:line (119)Gradle: cannot find symbol class EDAMUserException Error:Error:line (119)Gradle: cannot find symbol class EDAMSystemException Error:Error:line (119)Gradle: cannot find symbol class EDAMNotFoundException Error:Error:line (131)Gradle: cannot find symbol class LinkedNotebook Error:Error:line (131)Gradle: cannot find symbol class TException Error:Error:line (131)Gradle: cannot find symbol class EDAMUserException Error:Error:line (131)Gradle: cannot find symbol class EDAMSystemException Error:Error:line (131)Gradle: cannot find symbol class EDAMNotFoundException Error:Error:line (149)Gradle: cannot find symbol class LinkedNotebook Error:Error:line (149)Gradle: cannot find symbol class Notebook Error:Error:line (149)Gradle: cannot find symbol class TException Error:Error:line (149)Gradle: cannot find symbol class EDAMUserException Error:Error:line (149)Gradle: cannot find symbol class EDAMSystemException Error:Error:line (149)Gradle: cannot find symbol class EDAMNotFoundException /Users/kenny/AndroidStudioProjects/GreenDiaryProject/libraries/evernote-sdk/src/com/evernote/client/android/AsyncLinkedNoteStoreClient.java Error:Error:line (28)Gradle: package com.evernote.edam.error does not exist Error:Error:line (29)Gradle: package com.evernote.edam.error does not exist Error:Error:line (30)Gradle: package com.evernote.edam.error does not exist Error:Error:line (31)Gradle: package com.evernote.edam.type does not exist Error:Error:line (32)Gradle: package com.evernote.edam.type does not exist Error:Error:line (33)Gradle: package com.evernote.edam.type does not exist Error:Error:line (34)Gradle: package com.evernote.edam.type does not exist Error:Error:line (35)Gradle: package com.evernote.thrift does not exist Error:Error:line (36)Gradle: package com.evernote.thrift.protocol does not exist Error:Error:line (37)Gradle: package com.evernote.thrift.transport does not exist Error:Error:line (63)Gradle: cannot find symbol class TProtocol Error:Error:line (63)Gradle: cannot find symbol class TProtocol Error:Error:line (63)Gradle: cannot find symbol class TTransportException Error:Error:line (101)Gradle: cannot find symbol class Note Error:Error:line (101)Gradle: cannot find symbol class LinkedNotebook Error:Error:line (101)Gradle: cannot find symbol class Note Error:Error:line (120)Gradle: cannot find symbol class Note Error:Error:line (120)Gradle: cannot find symbol class LinkedNotebook Error:Error:line (120)Gradle: cannot find symbol class Note Error:Error:line (120)Gradle: cannot find symbol class EDAMUserException Error:Error:line (120)Gradle: cannot find symbol class EDAMSystemException Error:Error:line (120)Gradle: cannot find symbol class TException Error:Error:line (120)Gradle: cannot find symbol class EDAMNotFoundException Error:Error:line (135)Gradle: cannot find symbol class LinkedNotebook Error:Error:line (145)Gradle: cannot find symbol class LinkedNotebook Error:Error:line (145)Gradle: cannot find symbol class EDAMUserException Error:Error:line (145)Gradle: cannot find symbol class EDAMSystemException Error:Error:line (145)Gradle: cannot find symbol class TException Error:Error:line (145)Gradle: cannot find symbol class EDAMNotFoundException Error:Error:line (156)Gradle: cannot find symbol class Notebook Error:Error:line (156)Gradle: cannot find symbol class LinkedNotebook Error:Error:line (167)Gradle: cannot find symbol class Notebook Error:Error:line (167)Gradle: cannot find symbol class LinkedNotebook Error:Error:line (167)Gradle: cannot find symbol class TException Error:Error:line (167)Gradle: cannot find symbol class EDAMUserException Error:Error:line (167)Gradle: cannot find symbol class EDAMSystemException Error:Error:line (167)Gradle: cannot find symbol class EDAMNotFoundException Error:Error:line (187)Gradle: cannot find symbol class LinkedNotebook Error:Error:line (198)Gradle: cannot find symbol class LinkedNotebook Error:Error:line (198)Gradle: cannot find symbol class TException Error:Error:line (198)Gradle: cannot find symbol class EDAMUserException Error:Error:line (198)Gradle: cannot find symbol class EDAMSystemException /Users/kenny/AndroidStudioProjects/GreenDiaryProject/libraries/evernote-sdk/src/com/evernote/client/android/ClientFactory.java Error:Error:line (29)Gradle: package com.evernote.edam.error does not exist Error:Error:line (30)Gradle: package com.evernote.edam.error does not exist Error:Error:line (31)Gradle: package com.evernote.edam.error does not exist Error:Error:line (32)Gradle: package com.evernote.edam.type does not exist Error:Error:line (33)Gradle: package com.evernote.edam.userstore does not exist Error:Error:line (34)Gradle: package com.evernote.thrift does not exist Error:Error:line (35)Gradle: package com.evernote.thrift.protocol does not exist Error:Error:line (36)Gradle: package com.evernote.thrift.transport does not exist /Users/kenny/AndroidStudioProjects/GreenDiaryProject/libraries/evernote-sdk/src/com/evernote/client/android/AsyncNoteStoreClient.java Error:Error:line (28)Gradle: package com.evernote.edam.error does not exist Error:Error:line (29)Gradle: package com.evernote.edam.error does not exist Error:Error:line (30)Gradle: package com.evernote.edam.error does not exist Error:Error:line (31)Gradle: package com.evernote.edam.notestore does not exist Error:Error:line (32)Gradle: package com.evernote.edam.type does not exist Error:Error:line (33)Gradle: package com.evernote.edam.userstore does not exist Error:Error:line (34)Gradle: package com.evernote.thrift does not exist Error:Error:line (35)Gradle: package com.evernote.thrift.protocol does not exist

    Can you reproduce this issue?

    opened by kennym 9
  • Signature for EvernoteAuthToken(String, String, String, String, int, String)

    Signature for EvernoteAuthToken(String, String, String, String, int, String)

    In an attempt to make modifications to the source code for the OAuth client, I think I might have ran into a problem with the com.evernote.client.oauth.AccessTokenExtractor class.

    When I attempt to compile the src, I get the following error:

    The constructor EvernoteAuthToken(String, String, String, String, int, String) is undefined.

    This is the offending code block:

    public Token extract(String response) { Preconditions.checkEmptyString(response, "Response body is incorrect. " + "Can't extract a token from an empty string"); return new EvernoteAuthToken(extract(response, TOKEN_REGEX), extract(response, SECRET_REGEX), extract(response, NOTESTORE_REGEX), extract(response, WEBAPI_REGEX), Integer.parseInt(extract(response, USERID_REGEX)), response); }

    The only constructor in the EvernoteAuthToken class is:

    public EvernoteAuthToken(Token token)

    Did I miss something when pulling in the original source?

    opened by kyleparker 4
  • Support gradle

    Support gradle

    Since Android Studio was announced at Google I/O this year, Android Studio and gradle is getting popular and popular (and seems standard now). I added gradle support in this PR, and hope aar binary will be uploaded to maven repo soon.

    opened by thorikawa 3
  • NoSuchMethodException when calling methods that require primitives

    NoSuchMethodException when calling methods that require primitives

    Hi,

    this thread on the forum led me to think that there's an issue with reflection for methods that require primitive arguments.

    It seems to me that primitive values are auto-boxed and that the resulting

    Ex with findNotes :

    The call is

    findNotes(filter, 0, 100, new OnClientCallback<NoteList>())
    

    and the reflector tries to find

    findNotes [class java.lang.String, class com.evernote.edam.notestore.NoteFilter, class java.lang.Integer, class java.lang.Integer]
    

    and fails as the signature of the method is

    findNotes(java.lang.String authenticationToken, com.evernote.edam.notestore.NoteFilter filter, int offset, int maxNotes)
    

    The same thing happens with findNoteCounts(java.lang.String authenticationToken, com.evernote.edam.notestore.NoteFilter filter, boolean withTrash).

    Do I miss something or is there really a problem ?

    opened by Laurent-Sarrazin 3
  • OAuthConnectionException when I use EvernoteSession.HOST_PRODUCTION

    OAuthConnectionException when I use EvernoteSession.HOST_PRODUCTION

    When I use follow EvernoteService private static final EvernoteSession.EvernoteService EVERNOTE_SERVICE = EvernoteSession.EvernoteService.SANDBOX; I can sign in Evernote but when I use private static final EvernoteSession.EvernoteService EVERNOTE_SERVICE = EvernoteSession.EvernoteService.PRODUCTION; I cannot do it.

    StackTrace: 03-30 21:44:57.772: E/EvernoteOAuthActivity(8570): Failed to obtain OAuth request token 03-30 21:44:57.772: E/EvernoteOAuthActivity(8570): org.scribe.exceptions.OAuthConnectionException: There was a problem while creating a connection to the remote service. 03-30 21:44:57.772: E/EvernoteOAuthActivity(8570): at org.scribe.model.Request.send(Request.java:66) 03-30 21:44:57.772: E/EvernoteOAuthActivity(8570): at org.scribe.model.OAuthRequest.send(OAuthRequest.java:12) 03-30 21:44:57.772: E/EvernoteOAuthActivity(8570): at org.scribe.oauth.OAuth10aServiceImpl.getRequestToken(OAuth10aServiceImpl.java:47) 03-30 21:44:57.772: E/EvernoteOAuthActivity(8570): at com.evernote.client.android.EvernoteOAuthActivity$BootstrapAsyncTask.doInBackground(EvernoteOAuthActivity.java:389) 03-30 21:44:57.772: E/EvernoteOAuthActivity(8570): at com.evernote.client.android.EvernoteOAuthActivity$BootstrapAsyncTask.doInBackground(EvernoteOAuthActivity.java:1) 03-30 21:44:57.772: E/EvernoteOAuthActivity(8570): at android.os.AsyncTask$2.call(AsyncTask.java:264) 03-30 21:44:57.772: E/EvernoteOAuthActivity(8570): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305) 03-30 21:44:57.772: E/EvernoteOAuthActivity(8570): at java.util.concurrent.FutureTask.run(FutureTask.java:137) 03-30 21:44:57.772: E/EvernoteOAuthActivity(8570): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076) 03-30 21:44:57.772: E/EvernoteOAuthActivity(8570): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569) 03-30 21:44:57.772: E/EvernoteOAuthActivity(8570): at java.lang.Thread.run(Thread.java:856) 03-30 21:44:57.772: E/EvernoteOAuthActivity(8570): Caused by: java.io.IOException: Received authentication challenge is null 03-30 21:44:57.772: E/EvernoteOAuthActivity(8570): at libcore.net.http.HttpURLConnectionImpl.processAuthHeader(HttpURLConnectionImpl.java:397) 03-30 21:44:57.772: E/EvernoteOAuthActivity(8570): at libcore.net.http.HttpURLConnectionImpl.processResponseHeaders(HttpURLConnectionImpl.java:345) 03-30 21:44:57.772: E/EvernoteOAuthActivity(8570): at libcore.net.http.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:276) 03-30 21:44:57.772: E/EvernoteOAuthActivity(8570): at libcore.net.http.HttpURLConnectionImpl.getResponseCode(HttpURLConnectionImpl.java:479) 03-30 21:44:57.772: E/EvernoteOAuthActivity(8570): at libcore.net.http.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:133) 03-30 21:44:57.772: E/EvernoteOAuthActivity(8570): at org.scribe.model.Response.(Response.java:29) 03-30 21:44:57.772: E/EvernoteOAuthActivity(8570): at org.scribe.model.Request.doSend(Request.java:106) 03-30 21:44:57.772: E/EvernoteOAuthActivity(8570): at org.scribe.model.Request.send(Request.java:62) 03-30 21:44:57.772: E/EvernoteOAuthActivity(8570): ... 10 more

    opened by osanwe 2
  • Evernote Authentication Callback Problem

    Evernote Authentication Callback Problem

    When I click "authorize" after logging into evernote, it opens a new browser windows with a URL that starts with:

    en-[consumer_key]://callback?oauth...

    The auth never completes and it doesn't return to the application.

    This was happening on my application so I installed the sample application and the behavior is the same.

    opened by akshaydhavle 2
  • NetworkOnMainThreadException in EvernoteOAuthActivity if set useSDK to level 11 or greater

    NetworkOnMainThreadException in EvernoteOAuthActivity if set useSDK to level 11 or greater

    OAuth10ServiceImpl.getRquestToken() should not be called at UI thread or NetworkOnMainThreadException will be thrown after HoneyComb.

    Here is the reference: http://developer.android.com/reference/android/os/NetworkOnMainThreadException.html

    opened by julianshen 2
  • Invoke authorization when evernote client doesn't login could lead to crash.

    Invoke authorization when evernote client doesn't login could lead to crash.

    in my app, I call EvernoteSession.authorize(this) to start authorization. then the evernote sdk's progress dialog show, and later ,a crash dialog was shown.

    I find that it only happened when I didn't login in in the Evernote app.

    when I have already login in in the Evernote app, and then call EvernoteSession.authorize(this) from my app,It can work.

    so ,for simplicity. the issue is when I don't login in in the Evernote App,It will crash when third part app use Evernote App to authorize. and I use YinXiangBiJi app.

    here is the log message.

    E/Parcel ( 857): Reading a NULL string not supported here. E/msm8974_platform( 292): platform_update_tpa_poll: Could not get ctl for mixer cmd - TPA6165 POLL ACC DET E/EN (14193): [ev] - Uncaught exception E/EN (14193): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.evernote/com.evernote.ui.landing.AuthorizeThirdPartyAppActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String com.evernote.client.b.g()' on a null object reference E/EN (14193): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2314) E/EN (14193): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2386) E/EN (14193): at android.app.ActivityThread.access$800(ActivityThread.java:148) E/EN (14193): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1292) E/EN (14193): at android.os.Handler.dispatchMessage(Handler.java:102) E/EN (14193): at android.os.Looper.loop(Looper.java:135) E/EN (14193): at android.app.ActivityThread.main(ActivityThread.java:5310) E/EN (14193): at java.lang.reflect.Method.invoke(Native Method) E/EN (14193): at java.lang.reflect.Method.invoke(Method.java:372) E/EN (14193): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:901) E/EN (14193): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:696) E/EN (14193): Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String com.evernote.client.b.g()' on a null object reference E/EN (14193): at com.evernote.ui.landing.AuthorizeThirdPartyAppActivity.g(AuthorizeThirdPartyAppActivity.java:123) E/EN (14193): at com.evernote.ui.landing.AuthorizeThirdPartyAppActivity.onCreate(AuthorizeThirdPartyAppActivity.java:88) E/EN (14193): at android.app.Activity.performCreate(Activity.java:5953) E/EN (14193): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1128) E/EN (14193): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2267) E/EN (14193): ... 10 more E/EN (14193): [ev] - Uncaught exception, Notifying real exception handler E/EN (14193): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.evernote/com.evernote.ui.landing.AuthorizeThirdPartyAppActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String com.evernote.client.b.g()' on a null object reference E/EN (14193): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2314) E/EN (14193): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2386) E/EN (14193): at android.app.ActivityThread.access$800(ActivityThread.java:148) E/EN (14193): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1292) E/EN (14193): at android.os.Handler.dispatchMessage(Handler.java:102) E/EN (14193): at android.os.Looper.loop(Looper.java:135) E/EN (14193): at android.app.ActivityThread.main(ActivityThread.java:5310) E/EN (14193): at java.lang.reflect.Method.invoke(Native Method) E/EN (14193): at java.lang.reflect.Method.invoke(Method.java:372) E/EN (14193): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:901) E/EN (14193): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:696) E/EN (14193): Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String com.evernote.client.b.g()' on a null object reference E/EN (14193): at com.evernote.ui.landing.AuthorizeThirdPartyAppActivity.g(AuthorizeThirdPartyAppActivity.java:123) E/EN (14193): at com.evernote.ui.landing.AuthorizeThirdPartyAppActivity.onCreate(AuthorizeThirdPartyAppActivity.java:88) E/EN (14193): at android.app.Activity.performCreate(Activity.java:5953) E/EN (14193): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1128) E/EN (14193): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2267) E/EN (14193): ... 10 more E/AndroidRuntime(14193): FATAL EXCEPTION: main E/AndroidRuntime(14193): Process: com.evernote, PID: 14193 E/AndroidRuntime(14193): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.evernote/com.evernote.ui.landing.AuthorizeThirdPartyAppActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String com.evernote.client.b.g()' on a null object reference E/AndroidRuntime(14193): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2314) E/AndroidRuntime(14193): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2386) E/AndroidRuntime(14193): at android.app.ActivityThread.access$800(ActivityThread.java:148) E/AndroidRuntime(14193): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1292) E/AndroidRuntime(14193): at android.os.Handler.dispatchMessage(Handler.java:102) E/AndroidRuntime(14193): at android.os.Looper.loop(Looper.java:135) E/AndroidRuntime(14193): at android.app.ActivityThread.main(ActivityThread.java:5310) E/AndroidRuntime(14193): at java.lang.reflect.Method.invoke(Native Method) E/AndroidRuntime(14193): at java.lang.reflect.Method.invoke(Method.java:372) E/AndroidRuntime(14193): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:901) E/AndroidRuntime(14193): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:696) E/AndroidRuntime(14193): Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String com.evernote.client.b.g()' on a null object reference E/AndroidRuntime(14193): at com.evernote.ui.landing.AuthorizeThirdPartyAppActivity.g(AuthorizeThirdPartyAppActivity.java:123) E/AndroidRuntime(14193): at com.evernote.ui.landing.AuthorizeThirdPartyAppActivity.onCreate(AuthorizeThirdPartyAppActivity.java:88) E/AndroidRuntime(14193): at android.app.Activity.performCreate(Activity.java:5953) E/AndroidRuntime(14193): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1128) E/AndroidRuntime(14193): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2267) E/AndroidRuntime(14193): ... 10 more E/msm8974_platform( 292): platform_update_tpa_poll: Could not get ctl for mixer cmd - TPA6165 POLL ACC DET

    bug 
    opened by jinksw 1
  • [Bug] EvernoteOAuthActivity not translated

    [Bug] EvernoteOAuthActivity not translated

    Steps to reproduce:

    1. Open EvernoteOAuthActivity with english language on device
    2. Head back to previous activity
    3. Change language in device settings
    4. Open app and reopen EvernoteOAuthActivity Result: EvernoteOAthActivity is left translated in previous language
    opened by markiyan-antonyuk 1
  • OOM issue when using getLinkedNotebooks.

    OOM issue when using getLinkedNotebooks.

    java.lang.OutOfMemoryError at com.evernote.thrift.protocol.TBinaryProtocol.readStringBody(int) at com.evernote.thrift.protocol.TBinaryProtocol.readString() at com.evernote.thrift.protocol.TBinaryProtocol.readMessageBegin() at com.evernote.edam.notestore.NoteStore$Client.recv_listLinkedNotebooks() at myapp.evernote.logic.EvernoteApi.getLinkedNoteBooks() at myapp.evernote.logic.EvernoteApi.listLinkedNotebooks(FileData) at myapp.evernote.logic.EvernoteApi.replace(org.w3c.dom.Document,java.lang.String,java.lang.String), at myapp.evernote.logic.EvernoteCache$1.doInBackground$10299ca() at myapp.evernote.logic.EvernoteCache$1.doInBackground(java.lang.Object[]) at java.lang.Thread.run(Thread.java:838)

    opened by LionYang 1
  • Way to dismiss EvernoteOAuthActivity on back button press

    Way to dismiss EvernoteOAuthActivity on back button press

    When I call EvernoteSession.authenticate(), that triggers EvernoteOAuthActivity to authorize the client. It loads the webview for Evernote OAuth authorization, progress dialog is shown. There is no way by which user can stop authenticating or go back until the web page is loaded.

    Is there a way to finish this activity or handle back button on the progress dialog?

    opened by jainsanyam 1
  • OAuthConnectionException: There was a problem while creating a connection to the remote service.

    OAuthConnectionException: There was a problem while creating a connection to the remote service.

    2020-11-21 19:01:05.454 2403-5825/AndroidRuntime: FATAL EXCEPTION: pool-16-thread-1 org.scribe.exceptions.OAuthConnectionException: There was a problem while creating a connection to the remote service. at org.scribe.model.Request.send(SourceFile:3) at org.scribe.oauth.OAuth10aServiceImpl.getRequestToken(SourceFile:10) at org.scribe.oauth.OAuth10aServiceImpl.getRequestToken(SourceFile:1) at org.scribe.oauth.OAuth10aServiceImpl.getRequestToken(SourceFile:2) at com.evernote.client.android.EvernoteOAuthHelper.createRequestToken(SourceFile:1) at com.evernote.client.android.EvernoteOAuthHelper.startAuthorization(SourceFile:2) at com.evernote.client.android.login.EvernoteLoginTask.startAuthorization(SourceFile:20) at com.evernote.client.android.login.EvernoteLoginTask.execute(SourceFile:2) at com.evernote.client.android.login.EvernoteLoginTask.execute(SourceFile:1) at net.vrallev.android.task.Task.executeInner(SourceFile:1) at net.vrallev.android.task.TaskExecutor$b.run(SourceFile:1) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) at java.lang.Thread.run(Thread.java:919) Caused by: javax.net.ssl.SSLHandshakeException: Chain validation failed at com.android.org.conscrypt.ConscryptFileDescriptorSocket.startHandshake(ConscryptFileDescriptorSocket.java:231) at com.android.okhttp.internal.io.RealConnection.connectTls(RealConnection.java:196) at com.android.okhttp.internal.io.RealConnection.connectSocket(RealConnection.java:153)

    com.evernote.client.android.EvernoteSession#authenticate(android.support.v4.app.FragmentActivity) will crash app if occur above OAuthConnectionException.

    opened by wangsuicheng 0
  • Locale can not be set to Chinese

    Locale can not be set to Chinese

    Set to english, ok Set to Chinese, the following error occurs: org.scribe.exceptions.OAuthException: Response body is incorrect. Can't extract token and secret from this: '

    opened by Moonkan 0
  • Whether EvernoteSession isLoggedIn() should be related to whether EvernoteService is SANDBOX?

    Whether EvernoteSession isLoggedIn() should be related to whether EvernoteService is SANDBOX?

    Now is only check whether is empty.

        /**
         * Check whether the session has valid authentication information
         * that will allow successful API calls to be made.
         */
        public synchronized boolean isLoggedIn() {
            return mAuthenticationResult != null;
        }
    
    opened by laomo 0
  • Authenticate to Evernote using Google returns 403 - disallowed_useragent

    Authenticate to Evernote using Google returns 403 - disallowed_useragent

    Basically, that's all the info. Rumors say it might relate to 'user agent' for webView (e.g. https://stackoverflow.com/questions/40591090/403-error-thats-an-error-error-disallowed-useragent).

    Looks like the one in 'EvernoteOAuthActivity' doesn't have any code related to userAgent.

    opened by Den-Rimus 0
Owner
Evernote
Evernote
Segmenkt - The SegmenKT Kotlin SDK is a Kotlin-first SDK for Segment

SegmenKT Kotlin SDK The SegmenKT Kotlin SDK is a Kotlin-first SDK for Segment. I

UNiDAYS 0 Nov 25, 2022
Frogo SDK - SDK Core for Easy Development

SDK for anything your problem to make easier developing android apps

Frogobox 10 Dec 15, 2022
HubSpot Kotlin SDK 🧺 Implementation of HubSpot API for Java/Kotlin in tiny SDK

HubSpot Kotlin SDK ?? Implementation of HubSpot API for Java/Kotlin in tiny SDK

BOOM 3 Oct 27, 2022
AWS SDK for Android. For more information, see our web site:

AWS SDK for Android For new projects, we recommend interacting with AWS using the Amplify Framework. The AWS SDK for Android is a collection of low-le

AWS Amplify 976 Dec 29, 2022
Countly Product Analytics Android SDK

Countly Android SDK We're hiring: Countly is looking for Android SDK developers, full stack devs, devops and growth hackers (remote work). Click this

Countly Team 648 Dec 23, 2022
Android Real Time Chat & Messaging SDK

Android Chat SDK Overview Applozic brings real-time engagement with chat, video, and voice to your web, mobile, and conversational apps. We power emer

Applozic 659 May 14, 2022
Air Native Extension (iOS and Android) for the Facebook mobile SDK

Air Native Extension for Facebook (iOS + Android) This is an AIR Native Extension for the Facebook SDK on iOS and Android. It has been developed by Fr

Freshplanet 219 Nov 25, 2022
Android Chat SDK built on Firebase

Chat21 is the core of the open source live chat platform Tiledesk.com. Chat21 SDK Documentation Features With Chat21 Android SDK you can: Send a direc

Chat21 235 Dec 2, 2022
Liquid SDK (Android)

Liquid Android SDK Quick Start to Liquid SDK for Android This document is just a quick start introduction to Liquid SDK for Android. We recommend you

Liquid 17 Nov 12, 2021
AWS SDK for Android. For more information, see our web site:

AWS SDK for Android For new projects, we recommend interacting with AWS using the Amplify Framework. The AWS SDK for Android is a collection of low-le

AWS Amplify 975 Dec 24, 2022
新浪微博 Android SDK

ReadMe 公告: 鉴于线上服务器出现问题,推荐下载本地aar后上传到自己公司的服务器,保证后续服务稳定, 我们也将尽快重新提供一个稳定的地址供大家使用。 新包地址:https://github.com/sinaweibosdk/weibo_android_sdk/tree/master/2019

SinaWeiboSDK 1.8k Dec 30, 2022
Official Appwrite Android SDK 💚 🤖

Appwrite Android SDK This SDK is compatible with Appwrite server version 0.8.x. For older versions, please check previous releases. Appwrite is an ope

Appwrite 62 Dec 18, 2022
This App is sending Face capture data over network, built around the latest Android Arcore SDK.

AndroidArcoreFacesStreaming From any Android phone ArCore compatible, using this app will send over TCP 5680 bytes messages: The first 5616 bytes is a

Maxime Dupart 30 Nov 16, 2022
Trackingplan for Android SDK

With Trackingplan for Android you can make sure that your tracking is going as you planned without changing your current analytics stack or code.

Trackingplan 3 Oct 26, 2021
Desk360 Mobile Chat SDK for Android

Desk360 Chat Android SDK Introduction Desk360 Live Chat SDK is an open source Android library that provides live support to your customers directly fr

null 31 Dec 13, 2022
Storyblok Kotlin Multiplatform SDK sample (Android, JVM, JS)

storyblok-mp-SDK-sample *WIP* ... a showcase of the Storyblok Kotlin Multiplatform Client SDK. (Android, JVM, JS, iOS, ...) What's included ?? • About

Mike Penz 6 Jan 8, 2022
A demo of Rongcloud uniapp sdk integration for compiling debug-apk in Android Studio

Rongcloud-uniapp-sdk-demo A demo of Rongcloud uniapp sdk integration for compiling debug-apk in Android Studio 这是一个为了给uniapp在Android平台打出debug-apk的demo

Zongkui Guo 1 Oct 13, 2021
StreamPack: live streaming SDK for Android based on Secure Reliable Transport

StreamPack: live streaming SDK for Android based on Secure Reliable Transport (SRT) StreamPack brings the best audio/video live technologies together

guo shao hong 2 Aug 10, 2022
Judo Android SDK

Judo Android SDK Requirements: Android SDK/API level: Android API 23 or later (it will install in apps with minSDK as low as 19, but rendering is only

Judo 16 Nov 17, 2022