Last active
December 14, 2015 18:39
-
-
Save tyvsmith/5130745 to your computer and use it in GitHub Desktop.
Listing notebooks using the AsynNoteStoreClient
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Creating the business note store makes network requests | |
//to validate the auth token for the business | |
mEvernoteSession.getClientFactory().createBusinessNoteStoreClient( | |
new OnClientCallback<AsyncBusinessNoteStoreClient>() { | |
@Override | |
public void onSuccess(final AsyncBusinessNoteStoreClient client) { | |
//This is running in the UI Thread | |
client.listNotebooks(new OnClientCallback<List<Notebook>() { | |
@Override | |
public void onSuccess(final List<Notebook> notebooks) { | |
//This is running in the UI Thread | |
Log.d(LOGTAG, "Notebook count="notebooks.size()); | |
} | |
@Override | |
public void onException(Exception exception) { | |
//This is running in the UI Thread | |
Log.e(LOGTAG, "Error listing notebooks", exception); | |
} | |
} | |
}); | |
@Override | |
public void onException(Exception exception) { | |
Log.e(LOGTAG, "Error create business note store", exception); | |
} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ClientFactory clientFactory = mEvernoteSession.getClientFactory() | |
.getNoteStoreClient(); | |
client.listNotebooks(new OnClientCallback<List<Notebook>() { | |
@Override | |
public void onSuccess(final List<Notebook> notebooks) { | |
//This is running in the UI Thread | |
Log.d(LOGTAG, "Notebook count="notebooks.size()); | |
} | |
@Override | |
public void onException(Exception exception) { | |
//This is running in the UI Thread | |
Log.e(LOGTAG, "Error listing notebooks", exception); | |
} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<dependency> | |
<groupId>com.evernote</groupId> | |
<artifactId>android-sdk</artifactId> | |
<version>1.1</version> | |
<type>apklib</type> | |
</dependency> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment