12-31-2011, 10:36 AM | #1 |
Member
Posts: 16
Karma: 10
Join Date: Dec 2011
Device: Kindle Touch
|
[Touch] getting rid of searchbar
Hi everyone,
I'm pretty sure I'm missing something rather obvious here, but: I'm working on a Kindlet and I'd like to turn off the search bar (with back-button, shop-button, search) while my kindlet is running. It takes up real estate that I'd rather have for my content. regards, lui |
12-31-2011, 10:41 AM | #2 |
Junior Member
Posts: 3
Karma: 10
Join Date: Dec 2011
Device: Kindle Touch
|
I'd sure be interested as well. I can't just tap the top to get rid of it like I do to pull it up.
|
01-01-2012, 06:17 AM | #3 |
(offline)
Posts: 2,907
Karma: 6736094
Join Date: Dec 2011
Device: K3, K4, K5, KPW, KPW2
|
Could you post a minimal sample Kindlet source code along with instructions on compiling and getting it on the Kindle? (I remember that on the K3 the thing needed to be signed, the dev key added on the device etc.)
I'm willing to help in finding the solution, but I don't want to start from scratch by figuring out how to get a Kindlet working in the first place |
01-01-2012, 09:03 AM | #4 |
(offline)
Posts: 2,907
Karma: 6736094
Join Date: Dec 2011
Device: K3, K4, K5, KPW, KPW2
|
Ah whatever, I found some old project for the Kindle and reused that.
Source code and .azw2 are attached. READ ON BEFORE INSTALLING, though: This will NOT work out of the box. From within your Kindlet, you get a com.amazon.kindle.kindlet.KindletContext. The standard implementation of it, com.amazon.kindle.kindlet.internal.StandardKindlet Context, includes three additional methods beyond those defined in the interface: getOrientationController(), getToolbar(), and setScreenUpdateMode(). So while these methods are actually available in the implementation, they are not declared in the interface. This is probably a glitch. Now, you can't just cast the instance to the actual class, because the Kindlet class loader does not allow you to access these. In fact, it'll simply give you a ClassNotFoundException. The (only) classes which you are allowed to access are listed in the resource com/amazon/kindle/kindlet/internal/security/whiteListedClassNames (contained in KindletImplementation-2.0.jar). You will have to break out of this classloader first in order to get full access to your device. This is what the json_simple-1.1.jar is there for. It allows to escape the restrictive class loader, and also allows you to do other nifty things, like gaining additional permissions to write to the file system, read additional properties etc. You have to copy this one into /opt/amazon/ebook/lib as well. This is actually a project which I did for the Kindle 3 about a year ago, but never released it. Now that I see it's actually required to get some fundamental stuff done on the K-Touch, I'll probably make it public. PS: You can use the keystore from here: https://www.mobileread.com/forums/sho...d.php?t=152294 |
01-01-2012, 04:42 PM | #5 |
Member
Posts: 16
Karma: 10
Join Date: Dec 2011
Device: Kindle Touch
|
oh dear... thanks, ixtab! I'd love to see the sourcecode for the json_simple (well.. the breaking free from classloader limitations part at least) though
|
01-01-2012, 05:00 PM | #6 | |
(offline)
Posts: 2,907
Karma: 6736094
Join Date: Dec 2011
Device: K3, K4, K5, KPW, KPW2
|
Quote:
A few more things to note: You will need to bundle the "frontend" jar with your application (see build.xml) of the sample app. Take a look at the SuicidalKindlet and Jailbreak classes in there. You can also start and stop jailbreak mode at runtime (jailbreak.enable() and jailbreak.disable() etc.), or you can subclass Jailbreak to get additional permissions directly when the application launches. Or, from within your own code, you can request them when needed: Code:
jailbreak.getContext().requestPermission(new FilePermission(...)); EDIT (2014-02-02): The source code now has an "official" home. I removed the attachment from this post, please get the sources from the repository. Last edited by ixtab; 02-02-2014 at 01:54 PM. |
|
03-21-2012, 02:15 AM | #7 |
(offline)
Posts: 2,907
Karma: 6736094
Join Date: Dec 2011
Device: K3, K4, K5, KPW, KPW2
|
Update:
If you don't need to change the style at runtime, you can be set it in the .azw2 manifest. This is also working without the jailbreak. Quick example from an ant buildfile: Code:
<manifest> <attribute name="Implementation-Title" value="${product.name}"/> <attribute name="Implementation-Version" value="${product.version}"/> <attribute name="Implementation-Vendor" value="${product.vendor}"/> <attribute name="Main-Class" value="${product.mainclass}"/> <attribute name="Amazon-Cover-Image" value="${product.image}"/> <attribute name="Toolbar-Style" value="none"/> </manifest> More interesting information about supported Kindlet attributes can be found in the com.amazon.kindle.kindlet.internal.install.Metadat a class |
02-27-2014, 04:41 PM | #8 |
Junior Member
Posts: 1
Karma: 22222
Join Date: Feb 2014
Device: PW2
|
Kindlet features
Hello,
it's some time later and I am not sure if somebody else already mentioned it before, but I found some other method to change the visibility of the toolbar. Code:
KindletBooklet booklet = KindletBooklet.getInstance(); BookletContext context = booklet.getBookletContext(); BookletContextExtension contextext = (BookletContextExtension) context; JFrame frame = contextext.Em(); KindleFrameFactory.setPersistentChromeMode(frame,KindleFrameFactory.PersistentChromeMode.NO_HEADER); Code:
KindleFrameFactory.setPersistentChromeMode(frame,KindleFrameFactory.PersistentChromeMode.TITLE_AND_SEARCH) KindleFrameFactory.setPersistentChromeMode(frame,KindleFrameFactory.PersistentChromeMode.TITLE_ONLY) @ixtab: You may use this method also to modify the searchbar in the current version of your collection manager, since it receives the BookletContext. Spoiler:
Last edited by Fapsi; 02-28-2014 at 02:14 PM. |
03-01-2014, 08:00 AM | #9 | |
(offline)
Posts: 2,907
Karma: 6736094
Join Date: Dec 2011
Device: K3, K4, K5, KPW, KPW2
|
Quote:
(I probably won't include this in CM, because CM has to work on a lot of firmwares, and should look more or less the same on all of them. But I'll take a look at it -- and thanks again for the insight and for the hack ) |
|
Tags |
kindlet, search |
Thread Tools | Search this Thread |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Kindle 3, Nook Simple Touch, Kobo Touch and Libra Pro Touch | jbcohen | Which one should I buy? | 4 | 06-18-2011 07:58 PM |
Is there a way to get rid of this annoyance? | TonytheBookworm | Amazon Kindle | 7 | 12-26-2010 08:59 PM |
get rid of all tags - how ? | cybmole | Calibre | 4 | 09-29-2010 08:50 AM |
hi, i am currently getting rid of the | russellmz00 | Introduce Yourself | 6 | 05-25-2010 01:42 PM |
Just to get rid of the message | pshrynk | Introduce Yourself | 10 | 04-17-2009 01:47 AM |