Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Readers > Amazon Kindle > Kindle Developer's Corner

Notices

Reply
 
Thread Tools Search this Thread
Old 12-31-2011, 10:36 AM   #1
LittleLui
Member
LittleLui began at the beginning.
 
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
LittleLui is offline   Reply With Quote
Old 12-31-2011, 10:41 AM   #2
PollyN
Junior Member
PollyN began at the beginning.
 
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.
PollyN is offline   Reply With Quote
Old 01-01-2012, 06:17 AM   #3
ixtab
(offline)
ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.
 
ixtab's Avatar
 
Posts: 2,907
Karma: 6736092
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
ixtab is offline   Reply With Quote
Old 01-01-2012, 09:03 AM   #4
ixtab
(offline)
ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.
 
ixtab's Avatar
 
Posts: 2,907
Karma: 6736092
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
Attached Files
File Type: zip hellokindle.RENAME_TO_azw2.zip (28.5 KB, 403 views)
File Type: zip hellokindle-src.zip (2.49 MB, 399 views)
File Type: zip json_simple-1.1.RENAME_TO_jar.zip (28.4 KB, 417 views)
ixtab is offline   Reply With Quote
Old 01-01-2012, 04:42 PM   #5
LittleLui
Member
LittleLui began at the beginning.
 
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
LittleLui is offline   Reply With Quote
Old 01-01-2012, 05:00 PM   #6
ixtab
(offline)
ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.
 
ixtab's Avatar
 
Posts: 2,907
Karma: 6736092
Join Date: Dec 2011
Device: K3, K4, K5, KPW, KPW2
Quote:
Originally Posted by LittleLui View Post
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
There you go. Source project is attached.

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(...));
Et cetera. From a "user" (Kindlet developer) perspective, the frontend is more interesting. From a "hacker" perspective, it may be the backend

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.
ixtab is offline   Reply With Quote
Old 03-21-2012, 02:15 AM   #7
ixtab
(offline)
ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.
 
ixtab's Avatar
 
Posts: 2,907
Karma: 6736092
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>
Allowable values are "none", "transient", and "persistent".

More interesting information about supported Kindlet attributes can be found in the com.amazon.kindle.kindlet.internal.install.Metadat a class
ixtab is offline   Reply With Quote
Old 02-27-2014, 04:41 PM   #8
Fapsi
Junior Member
Fapsi can tie a knot in a cherry stem with his or her tongueFapsi can tie a knot in a cherry stem with his or her tongueFapsi can tie a knot in a cherry stem with his or her tongueFapsi can tie a knot in a cherry stem with his or her tongueFapsi can tie a knot in a cherry stem with his or her tongueFapsi can tie a knot in a cherry stem with his or her tongueFapsi can tie a knot in a cherry stem with his or her tongueFapsi can tie a knot in a cherry stem with his or her tongueFapsi can tie a knot in a cherry stem with his or her tongueFapsi can tie a knot in a cherry stem with his or her tongueFapsi can tie a knot in a cherry stem with his or her tongue
 
Fapsi's Avatar
 
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);
Other Possible values for setPersistentChromeMode are:
Code:
KindleFrameFactory.setPersistentChromeMode(frame,KindleFrameFactory.PersistentChromeMode.TITLE_AND_SEARCH)
KindleFrameFactory.setPersistentChromeMode(frame,KindleFrameFactory.PersistentChromeMode.TITLE_ONLY)
Note: Tried this code on my new Paperwhite 2 with Kindlet 2.2 version, but it mainly uses the standart jars : kaf.jar,kafui.jar, so it could work on other devices.

@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:

Since this is my first post, some off topic:
@all: Many thanks for sharing so many things

Last edited by Fapsi; 02-28-2014 at 02:14 PM.
Fapsi is offline   Reply With Quote
Old 03-01-2014, 08:00 AM   #9
ixtab
(offline)
ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.
 
ixtab's Avatar
 
Posts: 2,907
Karma: 6736092
Join Date: Dec 2011
Device: K3, K4, K5, KPW, KPW2
Quote:
Originally Posted by Fapsi View Post
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);
Other Possible values for setPersistentChromeMode are:
Code:
KindleFrameFactory.setPersistentChromeMode(frame,KindleFrameFactory.PersistentChromeMode.TITLE_AND_SEARCH)
KindleFrameFactory.setPersistentChromeMode(frame,KindleFrameFactory.PersistentChromeMode.TITLE_ONLY)
Note: Tried this code on my new Paperwhite 2 with Kindlet 2.2 version, but it mainly uses the standart jars : kaf.jar,kafui.jar, so it could work on other devices.

@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:

Since this is my first post, some off topic:
@all: Many thanks for sharing so many things
That's awesome, thanks a lot for finding and posting this! And welcome to MR!

(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 )
ixtab is offline   Reply With Quote
Reply

Tags
kindlet, search

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

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


All times are GMT -4. The time now is 07:14 PM.


MobileRead.com is a privately owned, operated and funded community.