Evernote Backup Update

Progress on the Evernote backup is moving along quite nicely and I expect to be releasing our first beta with Evernote integration to our beta testers later this afternoon or early tomorrow morning. I am excited to hear their initial reactions and feedback on how to make it better.

Because Evernote is not intended to backup bible notes I had to get creative with the note tags that Evernote does offer, and I think I came up with a simple yet effective system that does not intrude on a user’s experience when using Evernote for notes outside of BibleReader.

Every note has associated with it a category, a verse reference, and an icon. I used tags to store this information, so a note referencing John 3:16 will have a tag [Verse:Jn 3:16]. If that note is in a folder such as “Bible Studies” I create a tag [Category:Bible Studies] and associate the tag with the note. Also it should be noted that in order to keep a user’s notes separate from their bible notes I create a notebook in Evernote called “Bible Notes” and place all the notes we sync from BibleReader in that notebook.

We are trying to make this as open and as generic as possible so that end users do not feel like their notes are forever tied to Olive Tree and so that hopefully other bible programs such as Accordance can make use of the Evernote system and we can have desktop to mobile note synchronization.

Tags: , ,

Waiting for BibleReader 4.09?

Stephen and I put a lot of time into iPhone’s BibleReader 4.09 which was partially released last week in the App Store. I say partially because of the way in which we post our application to the app store. Due to the limited search capabilities of the app store and because users looking for a specific resource such as the NIV or ESV Study Bible may miss the finer details of these resources in the BibleReader app we release bundled applications. These bundled applications are the same application but bundled with some specific resource such as the NIV. This makes it easier for the person who is looking for the NIV to learn that Olive Tree’s BibleReader has access to the NIV Bible. Thus we have several bundled applications including but not limited to the ESV, ESV Study Bible (a personal favorite), Amplified, NLT Study Bible (another great bundle) and so on. Each of these bundles is powered by the same underlying software just sold separately for the reasons I mentioned above.

This typically is not an issue but with our latest release things got a bit more complicated. This latest release includes a new way of purchasing resources from Olive Tree using an iPhone feature known as in-app purchasing. Due to the complexity of implementing the new system and the app approval process we decided to hold off on submitting the update for all our bundled apps and just submit the Amplified and a new BibleReader app known as BR Free (See BibleReader price change for more on that). The Amplified was our test case for the new purchasing system. Things went as well as we had hoped so we submitted the rest of our bundled apps shortly after receiving news that Apple had approved the Amplified Bible bundle.

This brings me to the reason I am writing this blog… I know many of you are anxious to get your hands on the latest release and I am excited to get it into your hands, and guess what its possible. If you are currently running one of our bundled resources all you need to do is get an Olive Tree account (if you don’t have one already) and from within the BibleReader 4.08 go to the Settings page and tap the “Olive Tree Account” item where you will find a place to enter your Olive Tree login info and a “Synchronize books” button which will sync your purchases from iTunes with the Olive Tree server. Once this step has been completed we will have an accounting of your purchases that you made with us, allowing us to allow you to re-download those titles into any of our iPhone BibleReaders including the new BR Free. Simply install BR Free onto your iPhone, go to the Library page, find the “My Account” tab. Note: You may be prompted to enter your iTunes password at this point; you can enter it but you will still need to perform the next step. Now tap the “Syncronize books with your Olive Tree account” where you will be prompted for your account information enter it and wait for the synchronization to happen, if it worked your purchased items will appear in a section labeled “Books in your Olive Tree account”. All your past purchases will show up in the reader and you can download them and start enjoying 4.09.

I must warn you however this BR Free does not allow for doing in app purchases as it is Apple’s policy that only paid apps can have in app purchasing. So you must either wait for the generic BibleReader app that is now $0.99 to be approved, or make purchases directly from OliveTree.com.

If this sounds like a lot of work, it really isn’t but if you need some incentive to try it allow me to whet your taste buds. BibleReader 4.09 includes:

  • Full screen support
  • Auto-rotation locking
  • New color options
  • Nicer looking note popups
  • A focus visual that subtly gives you a queue as to which window currently has focus.

Overall the app performs better, looks better and has quite a few new features. As I said at the start of this post, Stephen and I put a lot of time into this release and that is no understatement. We also had a great beta testing team help us iron out several of the kinks and bugs along the way. Many of our testers put in several hours per beta release to ensure that your experience was top notch, we all really owe them a debt of gratitude. :-)

If you still want to hold out and wait for your specific version of BibleReader to be approved, you can 😉 but be warned it may be another week before it is.
Yours In Christ,


iPhone BibleReader notes backup teaser

BibleReader to Evernote backup

BibleReader to Evernote backup

My life lately has been notes backup and Evernote. Its been fun, and I wanted to give those who are missing out on my fun a little teaser of some of the progress I am making on the notes backup. To see a sample of a note that currently exists in both the iPhone app and the Evernote servers click the image to the left.

Notice that the note contains greek, because Evernote supports unicode we believe we should have no problem preserving greek and hebrew in your notes.

So far I can push actual notes from the iPhone to the Evernote servers. I have most of the backup framework laid out and now I am just plugging in the pieces. The hardest part is going to be in keeping the two in sync, and gracefully dealing with outages either with the the Evernote service or network.

I can say that so far I am very impressed with the Evernote service both in its network communication’s responsiveness and in the elegance of the service as a whole. If you have not checked out Evernote yet, I would say go check it out. (No Evernote did not pay me to say that)

Stay tuned for more as I work through the implementation of this…

Notes Backup – update

After having such a successful day yesterday with Evernote I was anxious to get started fleshing out the details of our notes backup implementation. I spent most of the morning beefing up the login code for the Evernote servers. Making sure that we handle all errors without the app just crashing if it encounters one. Then I started looking into the right way to plug in notes backup into BibleReader. It took everything I had in me not to just start hacking away and writing code, but being that I am still a relatively new employee at Olive Tree I am still finding my way through our code base and understanding the structure of how notes are handled by our software. Being that we develop for more than one platform whatever I do needs to be easily plugged into those other ports at some point. We also want to implement a ‘pluggable’ system so that other backup methods can be used as well in the future. So, while I was hoping for a beta by the end of next week, it may be a little longer than that, but it will definitely be worth the wait, I promise. 😉

Tags: , ,

Evernote – Bible Notes Preview

I spent the day having fun with the Evernote API and these are some screenshots showing notes I was able to send from our BibleReader application. Hoping to have a beta out next week.

Showing two notes uploaded from within the BibleReader app.

Showing more detail on a single note uploaded from BibleReader - note the tags are used to keep track of catagory, verse reference, and icon.

Tags: ,

Evernote API Cocoa Example

Disappointed by the lack of Evernote love for the iPhone SDK I decided to port their python example to Cocoa. This code snippet should work with Cocoa and Cocoa Touch.

#import "EvernoteBackup.h"

#import "THTTPClient.h"
#import "TBinaryProtocol.h"
#import "UserStore.h"
#import "NoteStore.h"

@implementation EvernoteBackup

- (void)Test
	NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
	// Keep this key private
	NSString *consumerKey = [[[NSString alloc] 
		initWithString: @"YOUR_CONSUMER_KEY_HERE" ] autorelease];
	NSString *consumerSecret = [[[NSString alloc] 
		initWithString: @"YOUR_CONSUMER_SECRET_HERE"] autorelease];
	// For testing we use the sandbox server.
	NSURL *userStoreUri = [[[NSURL alloc] 
		initWithString: @"https://sandbox.evernote.com/edam/user"] autorelease];
	NSString *noteStoreUriBase = [[[NSString alloc] 
		initWithString: @"http://sandbox.evernote.com/edam/note/"] autorelease];
	// These are for test purposes. At some point the user will provide his/her own.
	NSString *username = [[[NSString alloc] 
		initWithString: @"YOUR_USERNAME_HERE"] autorelease];
	NSString *password = [[[NSString alloc] 
		initWithString: @"YOUR_PASSWORD_HERE"] autorelease];

	THTTPClient *userStoreHttpClient = [[[THTTPClient alloc] 
		initWithURL:userStoreUri] autorelease];
	TBinaryProtocol *userStoreProtocol = [[[TBinaryProtocol alloc] 
		initWithTransport:userStoreHttpClient] autorelease];
	EDAMUserStoreClient *userStore = [[[EDAMUserStoreClient alloc] 
		initWithProtocol:userStoreProtocol] autorelease];
	EDAMNotebook* defaultNotebook = NULL;

	BOOL versionOk = [userStore checkVersion:@"Cocoa EDAMTest" :
						[EDAMUserStoreConstants EDAM_VERSION_MAJOR] :
						[EDAMUserStoreConstants EDAM_VERSION_MINOR]];

	if (versionOk == YES)
		EDAMAuthenticationResult* authResult = 
			[userStore authenticate:username :password 
				:consumerKey :consumerSecret];
		EDAMUser *user = [authResult user];
		NSString *authToken = [authResult authenticationToken];
		NSLog(@"Authentication was successful for: %@", [user username]);
		NSLog(@"Authentication token: %@", authToken);

		NSURL *noteStoreUri =  [[[NSURL alloc] 
			initWithString:[NSString stringWithFormat:@"%@%@", 
				noteStoreUriBase, [user shardId]] ]autorelease];
		THTTPClient *noteStoreHttpClient = [[[THTTPClient alloc] 
			initWithURL:noteStoreUri] autorelease];
		TBinaryProtocol *noteStoreProtocol = [[[TBinaryProtocol alloc] 
			initWithTransport:noteStoreHttpClient] autorelease];
		EDAMNoteStoreClient *noteStore = [[[EDAMNoteStoreClient alloc] 
			initWithProtocol:noteStoreProtocol] autorelease];

		NSArray *notebooks = [[noteStore listNotebooks:authToken] autorelease];
		NSLog(@"Found %d notebooks", [notebooks count]);
		for (int i = 0; i < [notebooks count]; i++)
			EDAMNotebook* notebook = (EDAMNotebook*)[notebooks objectAtIndex:i];
			if ([notebook defaultNotebook] == YES)
				defaultNotebook = notebook;
			NSLog(@" * %@", [notebook name]);

		NSLog(@"Creating a new note in default notebook: %@", [defaultNotebook name]);

		// Skipping the image resource section...

		EDAMNote *note = [[[EDAMNote alloc] init] autorelease];
		[note setNotebookGuid:[defaultNotebook guid]];
		[note setTitle:@"Test note from Cocoa Test."];
		NSMutableString* contentString = [[[NSMutableString alloc] init] autorelease];
		[contentString setString:	@"<?xml version=\"1.0\" encoding=\"UTF-8\"?>"];
		[contentString appendString:@"<!DOCTYPE en-note SYSTEM \"http://xml.evernote.com/pub/enml.dtd\">"];
		[contentString appendString:@"			<en-note>Here is the Olive Tree Test note.<br/>"];
		[contentString appendString:@"			</en-note>"];		
		[note setContent:contentString];
		[note setCreated:(long long)[[NSDate date] timeIntervalSince1970] * 1000];
		EDAMNote *createdNote = [noteStore createNote:authToken :note];
		if (createdNote != NULL)
			NSLog(@"Created note: %@", [createdNote title]);

	[pool drain];


Again your mileage may vary but I think this gives you the gist of how to talk to the Evernote servers.

Tags: , ,

Evernote API and iPhone SDK Setup

I was surprised by the lack of details on this topic so I decided to post my experiences with getting Evernote’s API setup in an iPhone application.

Note: Don’t forget to ask for an Evernote API key.

Steps for geting Evernote API compiling for the iPhone.

1. Grab thrift cocoa runtime:

$> svn co http://svn.apache.org/repos/asf/incubator/thrift/trunk/lib/cocoa/src/ thrift-cocoa

2. Grab latest Evernote API from http://www.evernote.com/about/developer/api

$> wget http://www.evernote.com/about/developer/api/evernote-api-1.xx.zip

3. Unzip Evernote API

$> unzip evernote-api-1.xx.zip

4. Go into the evernote cocoa source directory and replace every occurance of <Cocoa/Cocoa.h> with <UIKit/UIKit.h>

$> cd evernote-api-1.13/src/cocoa
$> perl -pi -e 's/<Cocoa\/Cocoa.h>/<UIKit\/UIKit.h>/g' *.h
$> perl -pi -e 's/<Cocoa\/Cocoa.h>/<UIKit\/UIKit.h>/g' *.m

5. Open XCode and add a ‘3rdParty’ group with the group “Evernote” beneath it

6. From the 3rdParty group click “Add existing files” and select the thrift-cocoa folder.

7. Expand the thrift-cocoa folder and delete the references to the folder server and everything contained within it.

8) Expand the transport folder and delete TSocketClient.m & TSocketClient.h (Evernote does not appear to need these and they won’t build with the iPhone SDK.)

9. From the “Evernote” group click “Add existing files” and select the cocoa folder under evernote-1.xx/src/cocoa

10. Try to build the system. I am using 1.13 and for whatever reason the cocoa is borked and needs some massaging. If you get errors like ‘EDAM_MIME_TYPES’ undeclared (first use in this function) then you have two choices. Install boost and thrift idl and run the thrift files in evernote-api-1.xx/src/thrift through thrift and it should generate good files otherwise you need to look at the errors and determine if you can fix them using some simple replacements as I have done below…

# Replaces the erroneous EDAM_ with EDAMEDAM_
$> perl -pi -e 's/ EDAM_/ EDAMEDAM_/g' EDAMLimits.m
$> perl -pi -e 's/ EDAM_/ EDAMEDAM_/g' Types.m
$> perl -pi -e 's/ EDAM_/ EDAMEDAM_/g' UserStore.m
# But this breaks the function definitions so I refix them here.
$> perl -pi -e 's/\+ \(int32_t\) EDAMEDAM_/\+ \(int32_t\) EDAM_/g' EDAMLimits.m
$> perl -pi -e 's/\+ \(NSString \*\) EDAMEDAM_/\+ \(NSString \*\) EDAM_/g' EDAMLimits.m
$> perl -pi -e 's/\+ \(NSSet \*\) EDAMEDAM_/\+ \(NSSet \*\) EDAM_/g' EDAMLimits.m
$> perl -pi -e 's/\+ \(NSString \*\) EDAMEDAM_/\+ \(NSString \*\) EDAM_/g' Types.m
$> perl -pi -e 's/\+ \(int16_t\) EDAMEDAM_/\+ \(int16_t\) EDAM_/g' UserStore.m

Your mileage will vary. 😉

Tags: , ,

Philippians 4

Two things stand out to me this morning, and the first thought motivates the second.

First at the end of Phil 4:5 Paul says “the Lord is at hand” meaning He is coming at any moment. Having this mindset should drive our every deed and thought. We should be mindful that the Lord is at hand, but so often I forget that and do what I want to do anyway. What if the Lord did return when I was in a moment of disobedience. How would I feel at that moment, yet I brush it off as not very likely. I need to be mindful of His return, that it is imminent.

Second I am reminded in verses Phil 4:8-9 that we are to think on things that are good. I think if I could have these two ideas at the forefront of my mind each day the struggles I have with sin would be easier to manage and fight off. How many times have I done what I knew was wrong because I did not have the Lord’s imminent return in mind and was not thinking on things that were Holy and righteous.

Lord help my thoughts today that they would be pure and upright, pleasing to you. Help me to be reminded continually that your return is coming, that you are coming for your church and I want to be counted worthy when you do return. Help me see You in all that I do.

Tags: ,

Galatians 5:16

As I was reading this passage this morning something struck me that has not struck me before about this reading. Paul is not saying Do not walk in the flesh and you are automagically walking in the Spirit. He very clearly says the opposite, walk in the Spirit and you will not gratify the desires of the flesh, i.e. walk in the flesh. 5:16

I so often think that because I am not doing bad things I am walking in the Spirit but here I am reminded I need to walk in the Spirit rather than walk not walk in the flash.

Lord help me to walk in the Spirit today. Help me to understand practical ways in which I can do this. Help me to see when I am walking in the flesh or when I am relying on my not walking in the flesh rather than walking in the Spirit.

Tags: ,