Hi everyone,
I'm trying to add support for a new ebook type to my kindle touch. I've implemented a suitable subclass of BookController, along with some of the stuff that goes along with it (Book, RendererCapabilities, ...).
Packed it all into a jar, signed it and placed it suitably on the kindle.
I added my BookController to /opt/amazon/ebook/config/reader_plugins.xml (referencing the jar's absolute path) and it gets loaded correctly, as is evident by my logging messages appearing in /var/log/messages.
My RendererCapabilities states that the BookController can handle files of type "test"; the getSupportedFileExtensions method is called at the expected time. I placed a few appropriately-named text files (eg. "foo.test") in the documents folder in USB mass storage mode (as i would do with any other ebook).
I also registered the reader booklet as an appropriate handler in /var/local/appreg.db:
Code:
INSERT INTO extenstions (ext, mimetype) VALUES ('test', 'MT:application/x-lui-kindle-test');
INSERT INTO mimetypes (ext, mimetype) VALUES ('test', 'MT:application/x-lui-kindle-test');
INSERT INTO associations (handlerId, interface, contentId, defaultAssoc) VALUES ('com.lab126.booklet.reader', 'application', 'MT:application/x-lui-kindle-test', 'true');
INSERT INTO associations (handlerId, interface, contentId, defaultAssoc) VALUES ('com.lab126.booklet.reader', 'detail', 'MT:application/x-lui-kindle-test', 'true');
That registration seems to have worked, as i can find it from my code:
Code:
ApplicationRegistry ar = (ApplicationRegistry)ReaderSDKImpl.getBundleService(com.amazon.kindle.restricted.device.ApplicationRegistry.class);
String hid = ar.getHandlerIdFor("application", "MT:application/x-lui-kindle-test");
//hid now is "com.lab126.booklet.reader"
So, the system knows that the reader can handle the test files, and the reader knows my BookController can handle the test files.
However, there must be something missing, because the test files don't show up on the home screen.
In contrast, when I declare in my RendererCapabilities that I'm able to handle azw files, my BookController gets invoked when opening azws (which are of course correctly enumerated on the home screen), so it seems to really be a problem with the home screen just not showing my test files.
When i query the content programmatically, the test files also don't show up:
Code:
private void testCatalog() {
CatalogService cs = null;
try
{
cs = (CatalogService)ReaderSDKImpl.getBundleService(com.amazon.kindle.content.catalog.CatalogService.class);
}
catch(ReaderException a)
{
log("cs can't be gotten",a);
}
//com.amazon.kindle.content.catalog.Predicate a = PredicateFactory.equals("location", getPath());
CatalogEntry ces[] = cs.find(null, null, 1024, 0);
log("ces: ".concat(String.valueOf(ces.length)));
for (CatalogEntry ce : ces) {
LString[] titles = ce.getTitles();
String display = titles.length >= 1 ? titles[0].getDisplay() : "unknown";
log("ce: ".concat(display));
}
}
(for this to work i had to adapt /opt/amazon/ebook/security/application.policy, otherwise it would fail becaus it was missing some access rights)
Does anybody have an idea what i'm missing (apart from sleep)?
thanks in advance,
lui