Giter Site home page Giter Site logo

evernote-sdk-android's Introduction

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.

evernote-sdk-android's People

Contributors

arturdryomov avatar juandg avatar rdtr avatar rekotan avatar tabachain avatar tyvsmith avatar vrallev avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

evernote-sdk-android's Issues

logout: Null Pointer Exception

I wrote follow code:
public class MainActivity extends ParentActivity implements OnClickListener {
private static final String TAG = "MainActivity";

    private Button loginButton;

    @Override
    public void onClick(View view) {
        mEvernoteSession.logOut(this);
    }

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        loginButton = (Button)findViewById(R.id.login_button);

        loginButton.setOnClickListener(this);
    }
}

and looked follow exception:
03-13 22:37:54.810: E/AndroidRuntime(9934): FATAL EXCEPTION: main
03-13 22:37:54.810: E/AndroidRuntime(9934): java.lang.NullPointerException
03-13 22:37:54.810: E/AndroidRuntime(9934): at com.evernote.client.android.EvernoteSession.logOut(EvernoteSession.java:360)
03-13 22:37:54.810: E/AndroidRuntime(9934): at ru.dcosanve.everlistforandroid.MainActivity.onClick(MainActivity.java:20)
03-13 22:37:54.810: E/AndroidRuntime(9934): at android.view.View.performClick(View.java:3526)
03-13 22:37:54.810: E/AndroidRuntime(9934): at android.view.View$PerformClick.run(View.java:14133)
03-13 22:37:54.810: E/AndroidRuntime(9934): at android.os.Handler.handleCallback(Handler.java:605)
03-13 22:37:54.810: E/AndroidRuntime(9934): at android.os.Handler.dispatchMessage(Handler.java:92)
03-13 22:37:54.810: E/AndroidRuntime(9934): at android.os.Looper.loop(Looper.java:137)
03-13 22:37:54.810: E/AndroidRuntime(9934): at android.app.ActivityThread.main(ActivityThread.java:4697)
03-13 22:37:54.810: E/AndroidRuntime(9934): at java.lang.reflect.Method.invokeNative(Native Method)
03-13 22:37:54.810: E/AndroidRuntime(9934): at java.lang.reflect.Method.invoke(Method.java:511)
03-13 22:37:54.810: E/AndroidRuntime(9934): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:787)
03-13 22:37:54.810: E/AndroidRuntime(9934): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:554)
03-13 22:37:54.810: E/AndroidRuntime(9934): at dalvik.system.NativeStart.main(Native Method)
I think your want to validate field mAuthenticationResult before using.

Failed to obtain OAuth request token in OAuth authentication in sample app.

I am trying to run the sample app(HelloEDAM) provided with the sdk but after putting my consumer key and consumer secret i am not able to run it.I am getting an error in authentication process.error is given below:

05-25 10:48:01.906: E/EvernoteOAuthActivity(29965): Failed to obtain OAuth request token
05-25 10:48:01.906: E/EvernoteOAuthActivity(29965): org.scribe.exceptions.OAuthException: Response body is incorrect. Can't extract token and secret from this:

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)

[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

GUID of created note on business notebook is null

When a note is created on business notebook, the guid of result note is always null.
How do I get the guid of created note?

The code is below:

session.getClientFactory().createBusinessNoteStoreClientAsync(new OnClientCallback<AsyncBusinessNoteStoreClient>() {
    @Override
    public void onSuccess(AsyncBusinessNoteStoreClient bNoteStore) {
        if (bNoteStore == null) {
            // failed
        } else {
            bNoteStore.createNoteAsync(note, nb, new OnClientCallback<Note>() {
                @Override
                public void onSuccess(Note data) {
                    String guid = data.getGuid();
                    /* guid is null!! but the note is created */
                }
                @Override
                public void onException(Exception exception) {
                    // failed
                }
            });
        }                                               
    }
    @Override
    public void onException(Exception ex) {
        // failed   
    }
});

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?

Example HelloEDAM app fails at runtime on 4.1.2 / 22.0.4

After upgrading to ADT 22.0.1, I noticed that one of my apps started crashing when reaching code provided by the Evernote SDK. Trying to debug, I found that it was still crashing when using the example HelloEDAM project, crashing on startup (fairly certain I've successfully run the example on this computer/configuration before (minus version changes)). Logcat captured the following exception:

http://pastebin.com/raw.php?i=z7HDpN9D

Possibly relevant info:

  • ADT 22.0.1 / 22.0.4
  • Android 4.1.2 via Cyanogenmod, running on an original Galaxy S
  • Eclipse 3.7.2 / java-8-oracle / Ubuntu 12.04 (also tested it with java-7-oracle, java-1.7.0-openjdk-amd64)
  • Yes, I'm using the latest master
  • Created some new workspaces to make sure there weren't problems with that

org.scribe.exceptions.OAuthException

The Sdk is ok with sandbox service but this error went out when i change it to production service. (and i have requested activation of my API key on production service..i have got the email...)

Process: com.evernote.android.demo, PID: 26517
03-24 01:53:31.890 26517-26695/com.evernote.android.demo E/AndroidRuntime: org.scribe.exceptions.OAuthException: Response body is incorrect. Can't extract token and secret from this: '
03-24 01:53:31.890 26517-26695/com.evernote.android.demo E/AndroidRuntime:
03-24 01:53:31.890 26517-26695/com.evernote.android.demo E/AndroidRuntime:
03-24 01:53:31.890 26517-26695/com.evernote.android.demo E/AndroidRuntime:
03-24 01:53:31.890 26517-26695/com.evernote.android.demo E/AndroidRuntime:
03-24 01:53:31.890 26517-26695/com.evernote.android.demo E/AndroidRuntime:
03-24 01:53:31.890 26517-26695/com.evernote.android.demo E/AndroidRuntime:

onLoginFinished sometimes returns successful == false

We're having issues using the login code with 2.0.0-RC3 where we occasionally get successful == false in the callback. The authentication worked on the Evernote activity, and when the result gets passed back to our activity, it's inconsistent whether we get a success or failure.

This problem seems to occur a lot more when we use an emulator vs a physical device; and are able to reproduce this in the demo app.

The simplest way to reproduce is to run the demo app in an emulator, and then repeatedly login and logout. You'll notice that sometimes the Evernote authentication activity succeeded, but the returning result in login activity won't trigger the callback successfully.

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.

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

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: '

Callback login invalid

Hi,

I have an issue when login to Evernote using Android SDK.

After click login by Evernote Account, the sdk does not response anymore.

I have check it. Here's the problem

Screen Shot 2023-03-24 at 13 53 57

Web url does not have URI SCHEME to give the callback.

Please correspond it. Thank you.

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?

ProGuard causes TargetMethodFinder to fail

Hi,
I'm not sure if this is just my ProGuard file that needs a fix, or maybe just the Evernote examples, but I think it should be fixed at the SDK level.

When this sample from the API example is executed, it downloads the list of notes, but stays loading forever.
ADB logs only this warning :
W/TargetMethodFinder: Didn't find method, result type interface java.util.List, result [com.evernote.client.android.c.a@bcea7c2, com.evernote.client.android.c.a@26b8d3, com.evernote.client.android.c.a@bcea7c2, com.evernote.client.android.c.a@30c7d4, ...long list of notes here.... com.evernote.client.android.c.a@11fe256, com.evernote.client.android.c.a@60d12d7], annotationId null, fragmentId 0/2131558519/null

which was sent from this library included in the EN SDK :
https://github.com/vRallev/android-task/blob/master/library/src/main/java/net/vrallev/android/task/TargetMethodFinder.java#L87

Seems to occur a bit randomly, possibly in different places (I heard about weird bugs from users), but after some testing, I think it happens only in release mode when ProGuard is enabled.

I built the Demo with in release mode and was forced to modify the build config, but it also happens there. Here's what I added to the demo build.gradle file :

    signingConfigs {
        release {
            storeFile file(RELEASE_STORE_FILE)
            storePassword RELEASE_STORE_PASSWORD
            keyAlias RELEASE_KEY_ALIAS
            keyPassword RELEASE_KEY_PASSWORD
        }
    }


    buildTypes {
        debug {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }

        release {
            minifyEnabled true
            proguardFile getDefaultProguardFile('proguard-android-optimize.txt')
            proguardFile 'proguard-rules.pro'
            signingConfig signingConfigs.release
        }
    }

And proguard-rules.pro :

# --- Remove some warnings, as suggested by the warnings
# --- It won't compile without (at least some of) them
-dontwarn sun.misc.Unsafe
-dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement
-dontwarn java.nio.file.*
-dontwarn org.scribe.services.DatatypeConverterEncoder
-dontwarn com.evernote.client.conn.mobile.TAndroidTransport
-dontwarn com.evernote.client.conn.mobile.DiskBackedByteStore
-dontwarn com.evernote.client.conn.mobile.ByteStore
-dontwarn org.scribe.services.CommonsEncoder
-dontwarn org.apache.commons.codec.binary.Base64

For now, my dumb fix is to set minifyEnabled false, because I simply have too many problems with ProGuard, but it would be great to either have a fix in the SDK or help me edit my ProGuard file.

Thanks

Skitch Integration

Are there any resources for integrating and customizing skitch?

I am trying to pass a .png file from my android app to skitch's canvas for markup. Skitch can be used as an excellent markup tool and I would love to utilize its capability in my app rather then recreate the wheel. Any help or info would be greatly appreciated. Thanks.

Evernote for Android Intent manager

Create a library to manage the intents used to create note, view note, search notes, and more from the Evernote for Android app. Additionally create an install helper for the app.

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:

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?

TTransportException on listNotebooks()

Hi,

I hope the Android SDK is still developed since I got a problem with it.

I am already able to login sucessfully with my app but whenever I try to make a connection to retrieve information I get an error. For example, when calling noteStoreClient.listNotebooks(); after logging in, I get the following error:

06-05 14:38:17.710 29267-29267/de.wocheplaner W/System.err: com.evernote.thrift.transport.TTransportException: android.os.NetworkOnMainThreadException 06-05 14:38:17.715 29267-29267/de.wocheplaner W/System.err: at com.evernote.client.conn.mobile.TAndroidTransport.flush(TAndroidTransport.java:136) 06-05 14:38:17.715 29267-29267/de.wocheplaner W/System.err: at com.evernote.edam.notestore.NoteStore$Client.send_listNotebooks(NoteStore.java:332) 06-05 14:38:17.715 29267-29267/de.wocheplaner W/System.err: at com.evernote.edam.notestore.NoteStore$Client.listNotebooks(NoteStore.java:321) 06-05 14:38:17.716 29267-29267/de.wocheplaner W/System.err: at com.evernote.client.android.asyncclient.EvernoteNoteStoreClient.listNotebooks(EvernoteNoteStoreClient.java:145) 06-05 14:38:17.716 29267-29267/de.wocheplaner W/System.err: at de.wocheplaner.MainActivity.refreshRecipes(MainActivity.java:183) 06-05 14:38:17.716 29267-29267/de.wocheplaner W/System.err: at de.wocheplaner.MainActivity.onLoginFinished(MainActivity.java:160) 06-05 14:38:17.716 29267-29267/de.wocheplaner W/System.err: at com.evernote.client.android.login.EvernoteLoginFragment.onResult(EvernoteLoginFragment.java:150) 06-05 14:38:17.716 29267-29267/de.wocheplaner W/System.err: at java.lang.reflect.Method.invoke(Native Method) 06-05 14:38:17.716 29267-29267/de.wocheplaner W/System.err: at net.vrallev.android.task.TargetMethodFinder.invoke(TargetMethodFinder.java:110) 06-05 14:38:17.716 29267-29267/de.wocheplaner W/System.err: at net.vrallev.android.task.TargetMethodFinder.invoke(TargetMethodFinder.java:102) 06-05 14:38:17.716 29267-29267/de.wocheplaner W/System.err: at net.vrallev.android.task.TaskExecutor.postResultNow(TaskExecutor.java:171) 06-05 14:38:17.716 29267-29267/de.wocheplaner W/System.err: at net.vrallev.android.task.TaskExecutor$TaskRunnable$1.run(TaskExecutor.java:236) 06-05 14:38:17.716 29267-29267/de.wocheplaner W/System.err: at android.os.Handler.handleCallback(Handler.java:739) 06-05 14:38:17.716 29267-29267/de.wocheplaner W/System.err: at android.os.Handler.dispatchMessage(Handler.java:95) 06-05 14:38:17.716 29267-29267/de.wocheplaner W/System.err: at android.os.Looper.loop(Looper.java:148) 06-05 14:38:17.716 29267-29267/de.wocheplaner W/System.err: at android.app.ActivityThread.main(ActivityThread.java:5417) 06-05 14:38:17.716 29267-29267/de.wocheplaner W/System.err: at java.lang.reflect.Method.invoke(Native Method) 06-05 14:38:17.716 29267-29267/de.wocheplaner W/System.err: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) 06-05 14:38:17.716 29267-29267/de.wocheplaner W/System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616) 06-05 14:38:17.717 29267-29267/de.wocheplaner W/System.err: Caused by: android.os.NetworkOnMainThreadException 06-05 14:38:17.722 29267-29267/de.wocheplaner W/System.err: at android.os.StrictMode$AndroidBlockGuardPolicy.onNetwork(StrictMode.java:1273) 06-05 14:38:17.722 29267-29267/de.wocheplaner W/System.err: at com.android.org.conscrypt.OpenSSLSocketImpl$SSLInputStream.read(OpenSSLSocketImpl.java:688) 06-05 14:38:17.722 29267-29267/de.wocheplaner W/System.err: at okio.Okio$2.read(Okio.java:137) 06-05 14:38:17.722 29267-29267/de.wocheplaner W/System.err: at okio.AsyncTimeout$2.read(AsyncTimeout.java:211) 06-05 14:38:17.722 29267-29267/de.wocheplaner W/System.err: at okio.RealBufferedSource.exhausted(RealBufferedSource.java:60) 06-05 14:38:17.722 29267-29267/de.wocheplaner W/System.err: at com.squareup.okhttp.internal.http.HttpConnection.isReadable(HttpConnection.java:155) 06-05 14:38:17.722 29267-29267/de.wocheplaner W/System.err: at com.squareup.okhttp.Connection.isReadable(Connection.java:235) 06-05 14:38:17.723 29267-29267/de.wocheplaner W/System.err: at com.squareup.okhttp.OkHttpClient$1.isReadable(OkHttpClient.java:91) 06-05 14:38:17.723 29267-29267/de.wocheplaner W/System.err: at com.squareup.okhttp.internal.http.HttpEngine.createNextConnection(HttpEngine.java:350) 06-05 14:38:17.723 29267-29267/de.wocheplaner W/System.err: at com.squareup.okhttp.internal.http.HttpEngine.nextConnection(HttpEngine.java:340) 06-05 14:38:17.723 29267-29267/de.wocheplaner W/System.err: at com.squareup.okhttp.internal.http.HttpEngine.connect(HttpEngine.java:330) 06-05 14:38:17.723 29267-29267/de.wocheplaner W/System.err: at com.squareup.okhttp.internal.http.HttpEngine.sendRequest(HttpEngine.java:248) 06-05 14:38:17.723 29267-29267/de.wocheplaner W/System.err: at com.squareup.okhttp.Call.getResponse(Call.java:273) 06-05 14:38:17.723 29267-29267/de.wocheplaner W/System.err: at com.squareup.okhttp.Call$ApplicationInterceptorChain.proceed(Call.java:230) 06-05 14:38:17.723 29267-29267/de.wocheplaner W/System.err: at com.squareup.okhttp.Call.getResponseWithInterceptorChain(Call.java:201) 06-05 14:38:17.723 29267-29267/de.wocheplaner W/System.err: at com.squareup.okhttp.Call.execute(Call.java:81) 06-05 14:38:17.723 29267-29267/de.wocheplaner W/System.err: at com.evernote.client.conn.mobile.TAndroidTransport.flush(TAndroidTransport.java:127) 06-05 14:38:17.723 29267-29267/de.wocheplaner W/System.err: ... 18 more

Currenty, after some investigation I assume that this error may be related to the deprecation of org.apache.http package after android 23. However, all suggested solution (using useLibrary 'org.apache.http.legacy') did not make any difference.

Any chance for help?

Best regards,
Thomas

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.

Evernote SDK Timeout

Hi, I have a problem

When I am trying to upload note with attachment around 10 Mb, I receive the following exception:
java.io.InterruptedIOException: timeout (java.net.SocketException: Socket is closed)

I am using "createNoteAsync" method with onSuccess() and onException() handlers. My account is Premium. When we are using Evernote iOS SDK, everything goes fine.

What can be the problem?

Thanks in advance and best regards

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

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 ?

UI issue

There's a logical UI issue in the Evernote Application on Android, I am afraid if the issue exists on iOS version too. The issue can be discussed here or I can be provided with a valid email to contact the developer team.
Thanks

NullPointerException

java.lang.NullPointerException
at com.evernote.client.android.login.EvernoteLoginActivity$2.run(EvernoteLoginActivity.java:145)

java.lang.NoClassDefFoundError: Failed resolution of: Ljavax/xml/bind/DatatypeConverter

Hello,
This is only happening with Android 9 devices.
I've upgraded my targetSdkVersion to 28 and migrated to androidX and now I'm catching this issue in crashlytics with this stacktrace:

Fatal Exception: java.lang.NoClassDefFoundError: Failed resolution of: Ljavax/xml/bind/DatatypeConverter;
       at org.scribe.services.DatatypeConverterEncoder.encode(DatatypeConverterEncoder.java:10)
       at org.scribe.services.HMACSha1SignatureService.bytesToBase64String(HMACSha1SignatureService.java:51)
       at org.scribe.services.HMACSha1SignatureService.doSign(HMACSha1SignatureService.java:46)
       at org.scribe.services.HMACSha1SignatureService.getSignature(HMACSha1SignatureService.java:32)
       at org.scribe.oauth.OAuth10aServiceImpl.getSignature(OAuth10aServiceImpl.java:151)
       at org.scribe.oauth.OAuth10aServiceImpl.addOAuthParams(OAuth10aServiceImpl.java:75)
       at org.scribe.oauth.OAuth10aServiceImpl.getRequestToken(OAuth10aServiceImpl.java:55)
       at org.scribe.oauth.OAuth10aServiceImpl.getRequestToken(OAuth10aServiceImpl.java:40)
       at org.scribe.oauth.OAuth10aServiceImpl.getRequestToken(OAuth10aServiceImpl.java:45)
       at com.evernote.client.android.EvernoteOAuthHelper.createRequestToken(EvernoteOAuthHelper.java:106)
       at com.evernote.client.android.EvernoteOAuthHelper.startAuthorization(EvernoteOAuthHelper.java:127)
       at com.evernote.client.android.login.EvernoteLoginTask.startAuthorization(EvernoteLoginTask.java:144)
       at com.evernote.client.android.login.EvernoteLoginTask.execute(EvernoteLoginTask.java:51)
       at com.evernote.client.android.login.EvernoteLoginTask.execute(EvernoteLoginTask.java:23)
       at net.vrallev.android.task.Task.executeInner(Task.java:67)
       at net.vrallev.android.task.TaskExecutor$TaskRunnable.run(TaskExecutor.java:191)
       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:764)
Caused by java.lang.ClassNotFoundException: Didn't find class "javax.xml.bind.DatatypeConverter" on path: DexPathList[[zip file "/data/app/com.appName-wW-VAgs8nrHvdZ5Jsbu0Ag==/base.apk"],nativeLibraryDirectories=[/data/app/com.appName-wW-VAgs8nrHvdZ5Jsbu0Ag==/lib/arm64, /data/app/com.appName-wW-VAgs8nrHvdZ5Jsbu0Ag==/base.apk!/lib/arm64-v8a, /system/lib64]]
       at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:134)
       at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
       at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
       at org.scribe.services.DatatypeConverterEncoder.encode(DatatypeConverterEncoder.java:10)
       at org.scribe.services.HMACSha1SignatureService.bytesToBase64String(HMACSha1SignatureService.java:51)
       at org.scribe.services.HMACSha1SignatureService.doSign(HMACSha1SignatureService.java:46)
       at org.scribe.services.HMACSha1SignatureService.getSignature(HMACSha1SignatureService.java:32)
       at org.scribe.oauth.OAuth10aServiceImpl.getSignature(OAuth10aServiceImpl.java:151)
       at org.scribe.oauth.OAuth10aServiceImpl.addOAuthParams(OAuth10aServiceImpl.java:75)
       at org.scribe.oauth.OAuth10aServiceImpl.getRequestToken(OAuth10aServiceImpl.java:55)
       at org.scribe.oauth.OAuth10aServiceImpl.getRequestToken(OAuth10aServiceImpl.java:40)
       at org.scribe.oauth.OAuth10aServiceImpl.getRequestToken(OAuth10aServiceImpl.java:45)
       at com.evernote.client.android.EvernoteOAuthHelper.createRequestToken(EvernoteOAuthHelper.java:106)
       at com.evernote.client.android.EvernoteOAuthHelper.startAuthorization(EvernoteOAuthHelper.java:127)
       at com.evernote.client.android.login.EvernoteLoginTask.startAuthorization(EvernoteLoginTask.java:144)
       at com.evernote.client.android.login.EvernoteLoginTask.execute(EvernoteLoginTask.java:51)
       at com.evernote.client.android.login.EvernoteLoginTask.execute(EvernoteLoginTask.java:23)
       at net.vrallev.android.task.Task.executeInner(Task.java:67)
       at net.vrallev.android.task.TaskExecutor$TaskRunnable.run(TaskExecutor.java:191)
       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:764)

Can you please help me to fix this.
From what I've discovered, the evernote sdk is using this library "org.scribe:scribe:1.3.7", that is quite outdated, maybe this is the issue. Scribe Github Releases

Many thanks!

(Android) TTransportationException No more data avaible

I already created various notes with the SDK . But when I try to attach a file I encountered some errors. I created a Resource with the mime type and set the Data property with a Data object with the body and body hash.I also added a Resource Attribute with the file name and setting the "attachment" property to false. I also appended the en-media tag on the note content.

On the sandbox site I can view the note, the photo even appears as a thumbnail on the list of notes. But the photo do not appears when I select the note from the note list on the site.

And when a try to load this specific note I always get some error, usually the TTransportException. Also get a SSL related error. And just once the note loaded and I could parsed the photo attached e check the ENML and it was alright.

If I create a note on the sandbox site, with the same photo, will load normaly.

Sorry for the english
sandbox error

error

Can't get User email

I don't know if I'm doing something wrong or if it's a bug, but it seems I cannot retrieve user email, and always get null.

Here is my code:
String authToken = EvernoteService.this._session.getAuthToken();
User user = EvernoteService.this._session.createUserStore().getUser(authToken);
EvernoteService.this._userEmail = user.getEmail();

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.