Evernote Tech Blog

The Care and Feeding of Elephants

The Evernote/Honda Hackathon: Our first Design & Build Weekend at Evernote HQ!

Design and Build Weekend

Join us in 3 weeks in Silicon Valley for our first ever Design & Build Weekend at Evernote HQ! After hosting many designer/developer events and workshops around the world, we are thrilled to finally bring the hackathon to our home turf and challenge app creators to build projects that sync with the Evernote API.

To attend our Design & Build Weekend, please RSVP for the event here »

All-New Integrations

We have some fantastic partners for the hackathon and our ongoing Evernote Devcup challenge. Our co-host for the design & build weekend is Honda Silicon Valley Lab (HSVL), Honda’s open innovation lab in Silicon Valley. HSVL will be launching a brand new API platform for developers at the event. In addition, we are introducing a new Hardware Hack section for the event, with special guests Leap Motion and NODE sensor!

Honda Silicon Valley Lab (HSVL) API

Honda Silicon Valley Labs
Honda Silicon Valley Lab is introducing the HSVL API platform for connecting into smart cars and providing developers with active data. For developers interested in the quantified self, the internet of everything, and life logging – this will be a brand new set of data for your applications. In addition, this hackathon will connect HSVL with developers in the community working on compelling and interesting use cases for the future of mobility.

Intelligent Design & Hardware Hacks

Leap Motion and NODE

Leap Motion

Evernote users have stored billions of notes in their accounts for the last 6+ years. The API team at Evernote loves to feature developers who build new ways for exploring notes and helping our 50+ million users get more out of Evernote.

When it comes to the future of the user interface, we are thrilled to include Leap Motion for the Design & Build Weekend! We will be challenging design and dev teams to envision hand and gesture control of notes. This could include recipe book flipping, fast sorting, notebook stack visualization, and more.

The best app that uses Leap Motion and Evernote will receive Leap Motion devices and the possibility of being featured in their new app store, Air Space. Explore the Devcup forum for Leap Motion app ideas »

NODE

NODE is a wireless sensor platform that can measure anything from movement and color to gasses, depending on the interchangeable sensors.
Node began on Kickstarter in 2012 and has since added many new sensors including the CHROMA that allows for accurate color scanning, previously only available with expensive spectrometers. The CHROMA brings color matching for paints or fabrics to your smart device and is a must have for contractors, artists and interior architects. Check out nodesensors.com to learn more about the NODE platform. There are countless ways users can create a collection of data in Evernote with Node to help them understand more about the world around them. Can you bring the power of mobile sensors to Evernote?

Every team that develops a working NODE app can keep their NODE, will be featured on the NODE website and will get a free ticket to the upcoming NODEVCON.

Weekend Workshops

Workshops

Collaboration and learning come together at our hackathons, and the main tool we support this ecosystem of innovation is through weekend workshops. Attendees of the Design & Build Weekend are invited to all our open workshops to learn more about the specific technologies involved and jumpstart their projects.

Some highlights for the weekend workshops:

  • Evernote API overview (basic & advanced)
  • HSVL API overview
  • Leap Motion SDK overview
  • Node SDK overview
  • Amazon Web Services getting started
  • Startup pitch training workshop

Design & Build Weekend Hackathon and the Evernote Devcup

Evernote Devcup

All applications built over the weekend are eligible for entry in the Evernote Devcup, our annual developer competition. To learn more about the global competition for apps that integrate with the Evernote API, click here »

RSVP and Join us at Evernote HQ!

To attend our Design & Build Weekend, please RSVP for the event here »

Hackathon

Tagged , , , , , , | Leave a comment

New version of Debian is released

debianOn May 4th 2013, the Debian team released a new version (7.0) code named ‘Wheezy.’ This is a significant update and the Evernote Operations team is very excited about qualifying it for use in the near future. We are currently running version 6.0 code named ‘Squeeze.’

The release announcement is located here: http://www.debian.org/News/2013/20130504

We did experience a slight issue after this release that was self induced. A little background before we get into the issue. We maintain a mirror of Debian for internal use only. This prevents traffic going to the Internet during our machine builds and generally makes the builds happen very fast. We use a project called ‘apt-mirror’ to make this relatively easy to maintain and automate. See: http://apt-mirror.github.io/ The model we have setup for this allows us to pick and choose the sections of the Debian repository we would like to mirror in our own environment. The apt-mirror script runs every night out of cron. Debian refers to the releases using naming such as: stable, oldstable, unstable, and testing. As major releases get pushed by the Debian team, the naming for the old and new release changes. In this case Wheezy went from ‘unstable’ to ‘stable’ and Squeeze went from ‘stable’ to ‘oldstable.’

We discovered Monday morning, after the Wheezy release, that we could no longer build the (now) older version of Debian 6 ( Squeeze). This was a result of the suite changing the name from ‘stable’ to ‘oldstable’ in the ‘Release’ file and how our repository is set up. As we are not mirroring the entire repository, some of it needs to be maintained by hand. More specifically, inside the apt repository the Debian project maintains symbolic links to the various suites. The symbolic link got changed but we did not mirror this change internally. To see this upstream browse ftp://ftp.us.debian.org/debian/dists/ and notice the symbolic links to the suites. Unfortunately this was not entirely obvious to us at first and we had to spend some time debugging the choose-mirror program. This is used during build time to pick the correct repository and version to install. After spending a few minutes looking at the source code, we realize what was happening. The fix was simple. We deleted the current ‘stable -> squeeze’ link and changed it to ‘oldstable -> squeeze’ inside our dists sub-directory. This allowed builds to function as before.

Directory listing of our server to make this clear:

before:

debian/dists# ls -l
total 12
drwxrwxr-x 5 apt-mirror apt-mirror 4096 Jan 30  2012 lenny
drwxrwxr-x 5 apt-mirror apt-mirror 4096 May  6 14:26 squeeze
drwxrwxr-x 5 apt-mirror apt-mirror 4096 Apr  2 08:27 squeeze-updates
lrwxrwxrwx 1 apt-mirror apt-mirror    7 Jan 26  2012 stable -> squeeze

after:

debian/dists# ls -l
total 12
drwxrwxr-x 5 apt-mirror apt-mirror 4096 Jan 30  2012 lenny
lrwxrwxrwx 1 root       root          7 May  6 14:34 oldstable -> squeeze
drwxrwxr-x 5 apt-mirror apt-mirror 4096 May  6 15:13 squeeze
drwxrwxr-x 5 apt-mirror apt-mirror 4096 Apr  2 08:27 squeeze-updates

Header of release file showing suite name change:

debian/dists# cat oldstable/Release
Origin: Debian
Label: Debian
Suite: oldstable
Version: 6.0.7
Codename: squeeze
Date: Sat, 04 May 2013 12:31:36 UTC
[..]

Again we are excited about this new version however it will require qualification work before we will begin rolling this out into our staging and then production environments so we needed to get the Squeeze installs working again quickly.

Tagged , | 1 Comment

Evernote SDK for iOS: Meetups, WWDC, and Devcup

Evernote SDK for iOS Updates

Updates to the Evernote SDK for iOS

In the last few months, we have completely overhauled the Evernote SDK for iOS.

Here’s a quick recap of recent updates:

We have more iOS features coming to the SDK to help with syncing notes and integration with more Evernote apps. Evernote is committed to continue to support the Apple community with platform tools that help build great apps. If you are building an app on the Evernote platform, make sure you submit to the Evernote Devcup.

iOS Apps in the Evernote Devcup

Evernote Devcup

iOS has been a very popular platform for the Evernote Devcup. With all the new features and additions to the iOS SDK, we are hoping to see a new class of iOS apps this year. If you need ideas for Evernote projects, check our discussion forums where users have posted some good concepts for apps.

Here are some examples of iOS apps built by developers for last year’s Devcup:

To see more apps, you can go to the Evernote Trunk, which showcases great Evernote integrations. Evernote users can explore the Trunk as a way to discover new apps that work with Evernote.

Upcoming iOS Events

iOS SDK for Evernote

To continue supporting the iOS community we are hosting some events that you might be interested in. Be sure to stop by if you have any questions on the Evernote SDK or if you want to network with great iOS developers.

  1. Silicon Valley iOS Developers @ Evernote: Meet Ben Zotto, Seth Hitchings, Mattt Thompson and Evernote developers
  2. Hackathon at Evernote: To be announced -  Tentative dates May 31 – June 2
  3. Evernote @ WWDC Developer Meetup: Meet fellow iOS developers and review Devcup apps from Evernote engineers, get your questions answered.

Stay tuned for more iOS news. As always, if you are interested in contributing to the iOS SDK, feel free to open pull requests.

If you have any feedback or questions, please don’t hesitate to reach me at mustafa@evernote.com or @mustafasf.

About Mustafa

Mustafa Furniturewala is an iOS Engineer on the Evernote Platform team. He is responsible for the upkeep and architecture of the Evernote SDK for iOS.

Prior to Evernote, Mustafa was a software engineer at Klout and Citrix, working on a variety of projects from audio virtualization to mobile technologies.

@mustafasfmustafa@evernote.com

1 Comment

Evernote API Workshop in Bogotá, Colombia!

Evernote engineers and designers are traveling to Bogotá, Colombia to connect with the developer & start up community in Colombia. To support local developers, the team from Silicon Valley will be running a master class that covers all aspects of building apps that sync with the Evernote Cloud Platform.

Evernote API Workshop Overview
The Evernote API lets you tap into the functionality offered by the Evernote service and gain access to the millions of users around the world who use it every day. Using the same API that powers all of Evernote’s native apps, you get full access to a user’s Evernote account, allowing you to create new notes and access existing ones.

workshop/hackathon

In this workshop we’ll introduce the API and look at Evernote SDKs, then discuss creating new notes, rendering notes, searching for existing notes and other common operations.

You’ll learn how your application can store its data in Evernote, how to tap into the information that a user has already stored in Evernote, and why Evernote is great for more than just note taking.

Devcup Graphic

Evernote Devcup
In addition to the API overview, we are encouraging all developers to submit their apps the the Evernote Devcup, our annual developer competition for designers and software developers. Any new or existing app that adds smart “Save to Evernote” features is eligible for tons of prizes and our new Accelerator at http://devcup.evernote.com/

Find out more about Evernote’s API at: http://dev.evernote.com.

Note: Workshop attendees will receive 3 months of Evernote Premium. In addition, any developer that submits their project to the Evernote Devcup competition by June 28th will receive $100 of Amazon Web Service credits!

Main topics covered in the Evernote API Workshop:

  •    Learn the fundamentals of the Evernote API
  •    Build a server side web application that connects to Evernote
  •    Incorporate a “Save to Evernote” feature in Android & iOS mobile app
  •    Overview of the Evernote Devcup: our annual developer competition
  •    Walkthrough of the Evernote Accelerator: Our 4 week residency program in San Francisco

Technology covered:

  •    Python & Django
  •    Node.js
  •    iOS development
  •    Android development

Two times available for the workshop:

  • 2pm – 5pm
  • 5pm – 8pm

To attend the Bogotá, Workshop: Order you ticket here >>

For other upcoming meetups, check out our up to date calendar of events: Devcup Calendar

Meet the team running the Workshop:

MustafaMustafa Furniturewala
Mustafa Furniturewala is an iOS Engineer on the Evernote Platform team. He is responsible for the upkeep and architecture of the Evernote SDK for iOS.

Prior to Evernote, Mustafa was a software engineer at Klout and Citrix, working on a variety of projects from audio virtualization to mobile technologies.
Twitter – @mustafasf
___

chris_traganos_200Chris Traganos
Chris Traganos is the head of Dev Relations at Evernote, where he organizes hackathons and API workshops for the developer community. In addition, he is a Senior Web Developer at Evernote, where his focus is on user experience, web standards, and information architecture.  Previously, he was a web developer for Harvard University. As part of the digital communications team, Chris managed the University’s main website (harvard.edu) and the Harvard Gazette online.

Chris holds a BS in Management of Information Systems from the University of Massachusetts. He lives with his family in Silicon Valley.
Twitter – @ctraganos

We look forward to meeting Colombian developers & designers in person
and bringing the Devcup to Bogotá!

Inside look at Evernote

Tagged , , | Leave a comment

2013 Evernote Devcup – Now Open for App Submissions!

Today, we are excited to announce that app submissions are now open for the Evernote Devcup! The Evernote Devcup is our annual developer competition where designers and software developers from around the globe build and submit innovative apps that work with Evernote. With the help of our online community, we will award prizes to the best products that integrate with the Evernote API.

Last month at SXSW in Austin, we announced the Evernote Devcup and prizes for the best apps that combine captivating functionality with beautiful, intuitive design to help Evernote users better capture and recall the important things in their lives. You can view the best of last year’s competition here »

Any product that integrates with the Evernote API is eligible to compete in the Evernote Devcup. Check out the Devcup forums for ideas and finding team members »

Evernote Developer meetups around the world:
To help you get started, the Evernote team will be hosting Devcup Meetups around the world in April through June. Attend one in a city near you to brainstorm ideas, discuss your app with Evernote API experts, and connect with fellow participants.

The Evernote Meetups are listed below:

The Evernote Devcup is open from now until June 28th. Create an app to help 50 million Evernote users do more: register to enter at devcup.evernote.com today!

More news on the Evernote Devcup:

For competition updates, follow @evernote_dev on Twitter, and use the hashtag #devcup when you tweet.

Tagged , , , | 1 Comment

Reactive Cocoa and the Evernote iOS SDK

Async Chaining

The Evernote SDK for iOS has a block based api, so that developers can perform network tasks in the background. Callbacks are a nice way to do async operations but when multiple callbacks are nested, code quickly becomes difficult to read and it can become hard to figure out what the intent of the code is. Callback aggregation helps you get past this problem, and in JavaScript, Promises are gaining popularity as a solution. For Objective-C, lets look at two approaches that help with this problem.

NSOperation

The first approach is to use NSOperation. By using NSOperation dependencies, multiple operations can be aggregated. This approach can be used with the existing Evernote SDK for iOS. In the example below, we find a notebook and then create a note once the notebook is found.

ReactiveCocoa

Our second approach is to use Functional Reactive Programming (FRP),  which is very useful for aggregating callbacks and centralizing error handling by chaining requests together. It also a very powerful way of expressing intent in code. ReactiveCocoa by GitHub is the open source Objective-C version of FRP. Using it will require some changes in the Evernote SDK for iOS - specifically, our API’s will need to return signals. Signals can be subscribed to and subscribers can get events. This is based on top of KVO, but has a much better API (blocks – yay!). Also, it is capable of much more, like running multiple concurrent requests.

Lets see how it can be used in the Evernote SDK for iOS using the same example. Note that this required some trivial changes in the Evernote SDK and this code is experimental. All the Evernote API’s were modified to return signals so that they can be used with ReactiveCocoaRACSubject‘s are great to add signals to existing API’s.

ReactiveCocoa can also be used to add callback support to an existing function, and also to run multiple concurrent requests. This example retrieves 100 notes.

Signals can also be nested to merge results from multiple operations.

FRP and the Evernote SDK for iOS

FRP can be very powerful if you use it throughout your app as a unified way to do async operations. As we saw, the Evernote SDK for iOS would need some changes to be compatible with ReactiveCocoa. At Evernote, we use Thrift to generate native API bindings, so one option would be to update the Thrift Objective-C code generator to optionally generate ReactiveCocoa-compatible code. While we don’t plan to add FRP to the Evernote SDK for iOS in the near future, we are curious to know your thoughts. As always, if you like would like to contribute to the Evernote SDK for iOS, please feel free to open a pull request.

If you are building an app using the Evernote platform, make sure you submit to Devcup. We also plan to have a meetup at Evernote for iOS developers very soon with some great speakers. Stay tuned!

Tagged , , , | Leave a comment

The Herding and Migrating of Sample Code

Here at Evernote, we’re big fans of Github (and Git in general, really). Github hosts all of our SDKs and makes it easy for our developer community to help us produce the best software we can. Plus, who doesn’t love Octocat? Nobody, that’s who.

We also make rather heavy use of Github’s Gist service for hosting code samples to embed in our documentation. If you’ve read through any of our Quick-start Guides or Core Concepts articles, you’ve probably seen that they’re peppered with Gists. This makes us happy.

There was a slight problem, though: as I started producing more documentation and sample code, I was using my personal Github account to create the Gists (upwards of one hundred of them). Wanting to keep our Bus Factor as high as possible in this situation, we decided it would be best to move all of the relevant Gists from my personal Github account to one owned and operated by Evernote. After several lively meetings, we decided on evernotegists (since Gists can’t be owned by an organization).

Having just recently performed this migration, I thought it might be fun to share how I did it.

The Requirements

As I mentioned, we have oodles of these gists spread throughout the Evernote Developer website. So, in a nutshell, my migration solution had to satisfy the following requirements:

  1. Locate all Gists throughout the developer website.
  2. Recreate each Gist belonging to my personal Github account under the evernotegists Github account.
  3. Replace each old Gist URL on our site with the new Gist URL generated in the previous step.

Here’s how I did it.

Gist-gathering with Grep

Using the old Unix stalwart grep, I collected all URLs from the site that began with https://gist.:

grep -r -h -o "https:\/\/gist[^\"]*" *.php . > gisturls.txt

After a quick spot-check to make sure the data looked good (and removing a couple of matches I hadn’t intended to be included in the migration), I had a complete list of all of the Gists that appear on our site.

Gist duplication with Python

This is where the bulk of the work—and magic—happens. Python is where I cut my programmer teeth a little over a decade ago and is the language I know best, so it was the obvious choice for this particular task. Here’s a quick breakdown of the semi-quick and not-overly-dirty solution (which you can view, rather poetically, as a gist):

  • Authenticate with Github’s API using a stored username and password; this will result in an authentication token that will be used for subsequent operations.
  • Read in the list of Gist URLs collected via grep earlier.
  • For each URL in the list:
    • Extract the Gist ID (either a number or an alphanumeric string) from the URL (e.g., http://gists.gitub.com/12345.js would produce an ID of 12345).
    • Grab the Gist from Github’s API and get the owning user, filename and file contents. We’ll use this info to generate the new Gist.
    • Create a new Gist with exactly the same file (name and contents).
    • Save the new Gist URL in a Python dictionary where it’s mapped to the original Gist URL
  • Write the mapping of old to new Gist URLs to a simple text file, one pair of URLs per line, separated by a single space.

This whole operation results in a text file whose contents look like this:

https://gist.github.com/12345.js https://gist.github.com/67890.js

The single remaining step was to do a site-wide search and replace for each URL in our site’s source code…

Vim regular expressions and Perl one-liners

With a large number of subsitutions ahead of me, potentially spread across ~170 PHP files, I had a couple of options:

  1. Write one script to handle all of the substituions in an efficient, robust manner.
  2. Employ a slightly more brutish tactic that would get the job done more quickly, despite making non-trivial concessions in terms of computational efficiency.

I went with option 2.

Using a couple of regular expression-powered search/replaces in my trusty Vim, I turned this line:

https://gist.github.com/12345.js https://gist.github.com/67890.js

Into this:

perl -pi -e ‘s{https://gist.github.com/12345.js}{https://gist.github.com/67890.js}g’ `find . -name '*.php'`

The Vim regex operations used:

  • :%s/^/perl -pi -e 's{/g — replace the beginning of each line with an invocation of perl with a couple of flags and begin the regular expression delimiter (curly braces, in this case).
  • :%s/js /js}{/g — replace the space between the two URLs with closing/opening curly braces.
  • :%s/$/}g' `find . -name '*.php'`/g  — add the closing regex delimiter to the end of the line plus a backtick-wrapped call to the find command.

After doing this globally to each line of my Gists file, I had a huge list of Perl one-liners that would search all of the PHP files within the site for the old Gist URL and replace it with the new one:
perl -pi -e 's{https://gist.github.com/inkedmn/4725142.js}{https://gist.github.com/5313509.js}g' `find . -name '*.php'`
perl -pi -e 's{https://gist.github.com/inkedmn/4732642.js}{https://gist.github.com/5313510.js}g' `find . -name '*.php'`
perl -pi -e 's{https://gist.github.com/inkedmn/4741551.js}{https://gist.github.com/5313511.js}g' `find . -name '*.php'`

This file became replaceGistUrls.sh.

Quasi-inelegant? Maybe. Slower than it could be? Absolutely. But, the whole thing took a couple of minutes to run and did the job it was made to do. Success!

Leave a comment

Evernote SDK for Android v1.1 – Asynchronous API Wrappers, Business & China Support

Evernote SDK for Android

Since the 1.0 release of our Android SDK, we’ve gotten quite a bit of feedback from the community and we’ve been hard at work to make the SDK much easier to use. In this release we’ve added enhanced developer tools and improved the OAuth flow to include automatic Evernote China service selection.

Improving the Android SDK

The main goal of the 1.1 release was to simplify the full Evernote API by providing easy access to the China service YXBJ, business notebooks, and linked notebooks. We also introduced an easy to use asynchronous interface to multithread the Evernote network requests.

The full list of features:

  • Asynchronous wrappers around NoteStore.Client and UserStore.Client
  • Helper objects to work with Business Notebooks and Linked Notebooks
  • Added a ClientFactory to assist creating the various Client objects
  • Automatic Evernote China service selection during login
  • Simplified the singleton initialization process
  • Added sample code that includes note creation, resource creation, notebook selection as well as working with multiple activities
  • Bug fixes

Here’s an example of listing notebooks using the new AsyncNoteStoreClient and the new OnClientCallback interface

These two examples show different ways of listing notebooks: personal notebooks and business notebooks.


ClientFactory clientFactory = mEvernoteSession.getClientFactory()
  .getNoteStoreClient();

client.listNotebooks(new OnClientCallback<List() {
  @Override
  public void onSuccess(final List 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);
  }
});

The first example creates an AsyncNoteStoreClient and uses that to call listNotebooks providing an OnClientCallback. This will run the network operation in a background thread and return the results to the UI thread.


mEvernoteSession.getClientFactory().createBusinessNoteStoreClient(
   new OnClientCallback() {

   @Override
  public void onSuccess(final AsyncBusinessNoteStoreClient client) {
    //This is running in the UI Thread    
    client.listNotebooks(new OnClientCallback<List() {
      @Override
      public void onSuccess(final List 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);
  }
});

The second example creates an AsyncBusinessNoteStoreClient using an OnClientCallback and then uses the result to call listNotebooks providing a second OnClientCallback. This will run the network operation in a background thread and return the results to the UI thread. This nested callbacks are required as both createBusinessNoteStore and listNotebooks are dependent network requests. The createBusinessNoteStoreClient method will authorize a new token for the business account if needed.

If direct access to the NoteStore.Client object is needed, a call to AsyncNoteStoreClient.getClient() will produce it. All calls on this object are synchronous though, so a developer would need to manage their own background threading operations.

Installing the SDK


<dependency>
    <groupId>com.evernote</groupId>
    <artifactId>android-sdk</artifactId>
    <version>1.1</version>
    <type>apklib</type>
</dependency>

If you are using Maven, just add the dependency to your pom.xml. If you are manually installing the library, go to our Github page for instructions.

As Evernote Business grows, it’s going to be more important for your application to work with all of the users’ data. These utilities should help you do just that. New sample code has been added to cover many of these features. Feel free to browse the Github repository and contribute using pull requests or issues. As always, we are here to support you, so reach out on the Evernote Developer Forums with any questions.

We hope this update will make integrating your Android app with Evernote much easier.

About Ty:

Ty Smith Android EngineerTy Smith is a Sr. Android Engineer on the Evernote product team. In addition to working on the core Evernote client, Ty maintains the Android SDK on Github and supports our developer community.

Prior to Evernote, Ty was the lead engineer on Powow Text Messaging and Zagat for Android (before the Google acquisition) at One Louder Apps.

@tylersmithnettsmith@evernote.com

Tagged , , , , , | Leave a comment

New JavaScript SDK for Evernote Developers

Co-written by Mustafa Furniturewala, iOS Software Engineer and
Josh Mangum, Senior Software Engineer

 

Providing developers with great tools is one of our favorite things to do. During the last few months several of our developers needed better access to our Thrift API from JavaScript for our browser extensions and Windows 8 clients. We want you to be able to play with it too.

So we are excited to announce the new JavaScript SDK for Evernote. The SDK supports all the Evernote Thrift API’s. Both the minified version of the Evernote for JS SDK and the uncompressed version is open source and available on Github. It’s based on JavaScript code that translates binary Thrift Protocol into JavaScript objects, and should also be useful to the wider thrift community.

This new thrift library will be a great foundation for building node.js server integrations, browser extensions and PhoneGap/Cordova, Windows 8, and Blackberry apps.

Here’s an example to get the list of notebooks from the Evernote account:


var noteStoreURL = <note store url>;
var authenticationToken = <authentication token>;
var noteStoreTransport = new Thrift.BinaryHttpTransport(noteStoreURL);
var noteStoreProtocol = new Thrift.BinaryProtocol(noteStoreTransport);
var noteStore = new NoteStoreClient(noteStoreProtocol);
noteStore.listNotebooks(authToken, function (notebooks) {
          console.log(notebooks);
     },
     function onerror(error) {
          console.log(error);
     }
);

 

This is from our example iPhone PhoneGap app downloadable here:

Note that the included jsOAuth library is fine for the the PhoneGap app, but because you should not reveal your consumer secret, don’t use the jsOAuth flow where users could see your consumer secret in your code. One alternative is to do the authentication flow natively and pass the authentication token to the browser scope. For browser extensions, you will need to do the authentication on the server side and have the extension request the token from the server.

Our SDK is on Github so that you can send us issues, hack it, send us pull requests and let us know how we can make it better.

Prototyping In the Browser

You can also do rapid development and prototyping in the browser. It’s terrific for doing prototypes for things like PhoneGap and Windows 8, or trying out ideas. Unfortunately, web apps aren’t yet a good fit for live customer applications. Binary data handling is a newish feature for browsers. Chrome 7, IE 10, and Safari 5.1 are needed to use it. Also we haven’t enabled CORS headers on our servers, so you won’t be able to make cross domain requests yet.

For personal use, you can solve the cross origin problem by disabling the web-security check, let’s try with Chrome.

On mac:

$ open -a Google\ sChrome --args --disable-web-security

On Windows use the command prompt and type:

chrome.exe --disable-web-security

and on linux:

google-chrome --disable-web-security

For development you can use your developer token. To get other users involved you’ll need to do a little bit of OAuth flow management on the server. Instructions for doing that are here. Once you get the OAuth token from the server flow, the same example from PhoneGap above will work on the browser.

Using our developer forum, please let us know if you have any questions or find any bugs. We have more updates planned and would love to hear feedback and suggestions.

Tagged , , , , | 7 Comments

Evernote SDK for iOS Updates – Improved login flow, Evernote for iOS integration, and more

Since our last major update, we have made several improvements for developers building iOS apps for Evernote. In addition to developer tools, we have an enhanced login flow for Evernote users already logged into our app.

Extending Evernote for iOS app features to our iOS developers 

Evernote for iOS is a great app with lots of great features. With this SDK release and the latest Evernote for iOS release, we are opening up some of those features for developers to use. Among several features is the ability to create notes (with attachments) using the Evernote for iOS app. Developers can also use the rich text editing features of the app to edit existing notes.

We have also included a ENML to HTML converter to make it easier for you to display formatted notes with photos. Also included in the sample app is a notebook chooser.

Here is the list of all the new features :

  • Two-tap login : Login using the Evernote for iOS app.
  • ENML to HTML Converter : Developers can use this to display notes in their app.
  • Notebook chooser : UI to help you add a Notebook chooser to your app.
  • Use the Evernote for iOS app to view notes.
  • Use the Evernote for iOS app to edit notes.
  • Use the Evernote for iOS app to create a new note (with attachments).
  • Prompt the user to install the Evernote for iOS app (without leaving your app if iOS6)
  • Support for Evernote’s China service is now a seamless experience for developers. Just upgrading to the new SDK will add China support.
  • Sample code on all the above
  • Sample code on how to fetch a large amount of notes

All the new features have sample code in the sample app. Don’t forget, the iOS SDK has support for Evernote Business. There are several utility functions that make it easier to use Business API’s.  With this release, the Evernote SDK for iOS has come a long way. We are very excited to see interesting use cases of the API using these new features.

As always, we encourage developers to contribute to the SDK through our GitHub account using issues or pull requests.  If you have features that you would like to see, please don’t hesitate reach out to us through our Evernote Developer Forums.

Happy building!

Tagged , , , , , , | Leave a comment