Question

I'm looking for a way to access the contents of my kindle using objective-c. Specifically I'd like to:

  • List the documents on the device
  • Add and remove documents
  • Manage collections (add and remove documents, etc..)

I know that Calibre does all this (and more) but it's in Java.

It's the first time I've ever tried to access a device of any type from a Cocoa app. If anyone has any ideas or starting points I'd really appreciate it.

Was it helpful?

Solution

You can probably get by with making basic filesystem calls with NSFileManager, since the Kindle itself usually gets mounted as a disk in /Volumes. You can then pull file metadata that way to get book titles and authors and stuff.

Edit: @Peter Hosey brings a good point:

Note: Don't assume that all mounted volumes are in /Volumes. Administrators can mount any device anywhere, fstab may be set up to mount a specific device in a specific place, and Apple could always radically change the file-system layout. Use NSFileManager's mountedVolumeURLsIncludingResourceValuesForKeys:options: method or Disk Arbitration to find all of the mounted volumes, wherever they are.

Not sure about managing collections, though. This plugin gives Calibre support for doing so, but it looks to be broken with the Kindle Touch. Collections seem to be a Kindle-proprietary thing that are likely stored in that collections.json file. Sounds like the Kindle Touch changed the game, though, and you won't be able to manage collections on it (unless Amazon decides to release some sort of SDK to simplify the whole process, but I wouldn't hold my breath).

The Kindle Touch holds its collections file at /var/local/cc.db, which I'm betting is some sort of SQLite file. Sadly you can only get to it by jailbreaking your Kindle Touch. This tool sounds like it may give you some insight, but since this has changed on the Touch, you're looking at making special cases for collection management based on the device type. Best of luck to you (if you're making a Cocoa-based Kindle manager, I would love to throw money at you when finished)!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top