11-02-2009, 05:10 AM | #1 |
Connoisseur
Posts: 63
Karma: 2600
Join Date: Oct 2008
Device: PRS-505
|
Kindle DX Homebrew - Booklet&AWT Event Hook works, a step forward
Today I finally got the time to try on the AWT Event Hook with Amazon's Booklet/KOS framework. To my surprise, it's so easy and just works like a charm.
The idea: 1. Replace the Amazon msp.jar booklet (the minesweep & go game) with user java code. 2. Hook into the AWT event queue in order to load user code upon request (e.g. hot key combination). The implementation: Code is attached. To write a booklet for Amazon KOS (codename for kindle os, i guess? ), one has to implement the following interface: package com.amazon.ebook.framework.a public abstract interface a { public abstract String C(); // Returns the booklet name public abstract void c(); // Initialize the booklet public abstract void B(); // ? Load the booklet ? public abstract void b(); // Handles open file public abstract void A(); // ? /** @deprecated */ public abstract void a(y paramy, Graphics paramGraphics); // painting /* } Upon initializing the KOS framework, kindle will look for all classes in /opt/amazon/ebook/booklets/*.jar and load all classes implementing the above interface. So what I did was simply replacing the msp.jar with my code and let it get loaded. Easiest way to use the code: (I suppose you know scp/mntroot stuffs) 1. Create a CDC project in Netbeans with name 'msp' 2. Import all amazon libraries from /opt/amazon/ebook/lib/, and the attached source code. 3. Build the code. Create /mnt/us/log directory for event logging. 4. Replace /opt/amazon/ebook/booklets/msp.jar (Don't forget to backup!) 5. /etc/init.d/framework restart You'll see all the AWT Events logged in /mnt/us/log Thoughts on future development: 1. Develop a unified 'Application Launcher' (like what in iPhone and Palm ) to load user code from, e.g. /mnt/us/Applications/ with Java classloader. We will be able to start this launcher with key combinations. (Intercept key combination in dispatchEvent()) 2. Replace default key behaviours on kindle. e.g. Use 5-way sticks for page turing. |
11-02-2009, 05:42 AM | #2 |
Addict
Posts: 241
Karma: 2617
Join Date: Mar 2009
Location: Greenwood, SC
Device: Kindle 2
|
Nice!
|
Advert | |
|
11-03-2009, 12:20 PM | #3 |
Junior Member
Posts: 2
Karma: 10
Join Date: Sep 2009
Device: kindle dx
|
really nice job done!
|
11-04-2009, 07:12 PM | #4 |
Junior Member
Posts: 2
Karma: 10
Join Date: Nov 2009
Device: Kindle DX
|
This is really great indeed. I am wondering though why you need to replace msp.jar at all? You are saying the Kindle loads any jar implementing this interface inside /opt/amazon/ebook/booklet, so could it not simply be called event.jar instead?
This would mean a central place for loading apps is not even really necessary... |
11-04-2009, 07:25 PM | #5 |
Junior Member
Posts: 2
Karma: 10
Join Date: Nov 2009
Device: Kindle DX
|
I just verified this and it does indeed get loaded under another filename as well, so there seems to be no need to replace msp.jar.
|
Advert | |
|
11-06-2009, 10:49 AM | #6 |
Connoisseur
Posts: 63
Karma: 2600
Join Date: Oct 2008
Device: PRS-505
|
It's great you verified that. I built the original project with the msp name and was too lazy to change it. As to what I supposed it does work with any name.
|
11-06-2009, 03:11 PM | #7 |
Comparer of the Ephemeris
Posts: 1,496
Karma: 424697
Join Date: Mar 2009
Device: iPad
|
Question for you folks in this thread ...
Have you come across anything that would indicate how I could jump to a book from an HTML document? I've been assuming that the 'Home' page is a dynamically constructed HTML page containing some special <a href=> tag to open books. But maybe it's a Java program? Anyway, if anyone has any clues about how to open a book from HTML I would appreciate learning more. G |
11-08-2009, 05:02 AM | #8 | |
Connoisseur
Posts: 63
Karma: 2600
Join Date: Oct 2008
Device: PRS-505
|
No it's not an HTML document. It's a Java implementation in /opt/amazon/ebook/booklets/Home.jar
There is no way to jump to external books from inside a mobi or text file. Amazon didn't implement this feature in the built-in mobipocket/txt reader(actually the same). One way to do this is to bundle all your html files in a mobi file with MobiPocket Creator. And create links within the mobi bundle. Quote:
|
|
11-08-2009, 04:44 PM | #9 |
Comparer of the Ephemeris
Posts: 1,496
Karma: 424697
Join Date: Mar 2009
Device: iPad
|
Thanks DairyKnight, I appreciate the informative lead.
What I'm trying to do is construct a browser of all the books on my Kindle, so it's not really practical to combine them all into a single file. Here's another angle - is it possible to execute Java code from within an HTML file? If so, maybe I could mimic the launch sequence that Home.jar executes. G |
11-09-2009, 12:35 AM | #10 | |
Connoisseur
Posts: 63
Karma: 2600
Join Date: Oct 2008
Device: PRS-505
|
Java code is simply not support in any Mobi implementation. If you're talking about javascript, it's not in Amazon's implementation.
But you can always write your own booklet to mimic the behavior of Home.jar book browsing. Refer to my other posts for how to do so. Quote:
|
|
11-18-2009, 04:31 PM | #11 |
Member
Posts: 21
Karma: 298
Join Date: Apr 2008
Device: prs500
|
I don't have any to add except to say,
keep up the great work. I check this thread daily and I am really excited about the progress being made. You guys are hacking heroes in my book. |
11-24-2010, 10:52 AM | #12 |
Groupie
Posts: 157
Karma: 1777
Join Date: Sep 2010
Location: Minsk, Belarus
Device: Kindle 4
|
Does anyone tried this method for Kindle 3?
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Kindle DX Homebrew - It works with Java!! | DairyKnight | Kindle Developer's Corner | 4 | 04-26-2011 10:55 PM |
Free Booklet (Kindle) - On Gratitude | koland | Deals and Resources (No Self-Promotion or Affiliate Links) | 0 | 09-22-2010 03:51 AM |
Mac OSX: Idiot-Proof Font Scaling Fix [Step-by-step] | Jelbee | Kobo Reader | 2 | 06-14-2010 12:16 PM |
E-books might be next step in evolution, says S&P research | Alexander Turcic | News | 15 | 10-31-2007 01:34 PM |