Skip to content

Instantly share code, notes, and snippets.

@tyvsmith
Last active December 14, 2015 18:39
Show Gist options
  • Save tyvsmith/5130745 to your computer and use it in GitHub Desktop.
Save tyvsmith/5130745 to your computer and use it in GitHub Desktop.
Listing notebooks using the AsynNoteStoreClient
//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);
}
});
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);
}
});
<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