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 05-16-2014, 05:39 PM   #181
Cykotitan
Enthusiast
Cykotitan is kind to children and small, furry animalsCykotitan is kind to children and small, furry animalsCykotitan is kind to children and small, furry animalsCykotitan is kind to children and small, furry animalsCykotitan is kind to children and small, furry animalsCykotitan is kind to children and small, furry animalsCykotitan is kind to children and small, furry animalsCykotitan is kind to children and small, furry animalsCykotitan is kind to children and small, furry animalsCykotitan is kind to children and small, furry animalsCykotitan is kind to children and small, furry animals
 
Posts: 44
Karma: 6550
Join Date: May 2013
Location: Bosnia & Herzegovina
Device: Kindle Paperwhite 1 WiFi
I have just found out the code for hiding the options is in place and runs every time the menu is called (kindlemenu.sh calls a different Bash script):
Code:
/mnt/us/extensions/kindlemenu/bin/sh/clean_launchers.sh &
What I'm not sure is, how does it manage to only work part of the time?
Cykotitan is offline   Reply With Quote
Old 05-16-2014, 06:44 PM   #182
knc1
Going Viral
knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.
 
knc1's Avatar
 
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
Quote:
Originally Posted by Cykotitan View Post
I have just found out the code for hiding the options is in place and runs every time the menu is called (kindlemenu.sh calls a different Bash script):
Code:
/mnt/us/extensions/kindlemenu/bin/sh/clean_launchers.sh &
What I'm not sure is, how does it manage to only work part of the time?
That command is being run in the background as a shell job (see: &)

So check if it is being run more than once at a time, or not checking that the prior invocation has completed, or .....
All/Any of those things that can go wrong with the logic of an async task and the main task.
knc1 is offline   Reply With Quote
Old 05-16-2014, 06:55 PM   #183
Cykotitan
Enthusiast
Cykotitan is kind to children and small, furry animalsCykotitan is kind to children and small, furry animalsCykotitan is kind to children and small, furry animalsCykotitan is kind to children and small, furry animalsCykotitan is kind to children and small, furry animalsCykotitan is kind to children and small, furry animalsCykotitan is kind to children and small, furry animalsCykotitan is kind to children and small, furry animalsCykotitan is kind to children and small, furry animalsCykotitan is kind to children and small, furry animalsCykotitan is kind to children and small, furry animals
 
Posts: 44
Karma: 6550
Join Date: May 2013
Location: Bosnia & Herzegovina
Device: Kindle Paperwhite 1 WiFi
Yes, I've just recently learned the meaning of ampersand symbol. The interpreter doesn't wait for the command to finish execution, but instead continues to the next section of code, something like that.

What appears to be the problem here is the script executing too soon, before the Kindle is able to render kindlemenupage.html, the task set by this code:
Code:
(usleep 250000; lipc-set-prop com.lab126.pillow customDialog '{"name": "../../../../mnt/us/extensions/kindlemenu/bin/kindlemenupage", "clientParams": {"dismiss": true}}') &
It appears the above job is delayed by 250 milliseconds!

So what happens if we delay the job responsible for starting clean_launchers.sh?
Code:
(usleep 300000; /mnt/us/extensions/kindlemenu/bin/sh/clean_launchers.sh ) &
The above code appears to execute the script right on time, I tried 250ms but it didn't work out after a cold boot - the script was firing up too soon again!

I would like to hear if there's a better way to achieve the same result, because this doesn't seem too robust (relying on the performance of the Kindle when timing background jobs). Does calling cleanup_launchers.sh via javascript once the DOM elements have loaded sound like a good idea?

Last edited by Cykotitan; 05-16-2014 at 07:03 PM.
Cykotitan is offline   Reply With Quote
Old 05-16-2014, 08:12 PM   #184
knc1
Going Viral
knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.
 
knc1's Avatar
 
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
Until we hear from Aeris on why she did this the way she did (she may have a good reason) . . . .

Perhaps take the '&' out of the lipc-set-prop command (it is probably already async or waits for user input; in either case it probably doesn't need the '&')

With that taken out -
Try with and without the new 'usleep 30000' (and maybe take the '&' out of that command also).

- - - -

I am guessing she was trying to make the menu system as responsive as possible -
but there may be other reasons.
She did put in a lot of time on this project - so it would be nice to hear from her about this problem.
knc1 is offline   Reply With Quote
Old 05-16-2014, 08:50 PM   #185
Cykotitan
Enthusiast
Cykotitan is kind to children and small, furry animalsCykotitan is kind to children and small, furry animalsCykotitan is kind to children and small, furry animalsCykotitan is kind to children and small, furry animalsCykotitan is kind to children and small, furry animalsCykotitan is kind to children and small, furry animalsCykotitan is kind to children and small, furry animalsCykotitan is kind to children and small, furry animalsCykotitan is kind to children and small, furry animalsCykotitan is kind to children and small, furry animalsCykotitan is kind to children and small, furry animals
 
Posts: 44
Karma: 6550
Join Date: May 2013
Location: Bosnia & Herzegovina
Device: Kindle Paperwhite 1 WiFi
This is what remains after the modifications:
Code:
#!/bin/sh
# Clean the screen
lipc-set-prop com.lab126.pillow customDialog '{"name": "../../../../mnt/us/extensions/kindlemenu/bin/html/blank"}'

# Launch Kindle Menu html page
(usleep 250000; lipc-set-prop com.lab126.pillow customDialog '{"name": "../../../../mnt/us/extensions/kindlemenu/bin/kindlemenupage", "clientParams": {"dismiss": true}}')


# kill already running clean_launchers.sh processes, if any
killall clean_launchers.sh

# If Kindle Touch, disable light tray buttons. Disable also
# launcher of Midori and KOreader, if not installed
/mnt/us/extensions/kindlemenu/bin/sh/clean_launchers.sh
So far it seems fine, trying cold start as soon as it reboots...

Results are as follows:

KUAL > Kindle Menu > Enable status bar shortcut > (screen swipe starting from top towards bottom)
Didn't work the first time, worked the second (KOReader and Midori gone)

On the contrary, opening the menu directly yields correct results (KUAL > Kindle Menu > Show Kindle Menu). This is somewhat expected, since the initial problem was only observable in cases where menu is called using the shortcut (gesture).

Edit:
I might have found a way to cover all the aspects of the problem, and the fix requires you to use the code above but add an ampersand to the last job thus making it go to background:
Code:
/mnt/us/extensions/kindlemenu/bin/sh/clean_launchers.sh &
Let me know if this helps anyone!

Last edited by Cykotitan; 05-16-2014 at 09:21 PM.
Cykotitan is offline   Reply With Quote
Old 05-18-2014, 06:30 AM   #186
Aeris
Developer's Corner Mascot
Aeris ought to be getting tired of karma fortunes by now.Aeris ought to be getting tired of karma fortunes by now.Aeris ought to be getting tired of karma fortunes by now.Aeris ought to be getting tired of karma fortunes by now.Aeris ought to be getting tired of karma fortunes by now.Aeris ought to be getting tired of karma fortunes by now.Aeris ought to be getting tired of karma fortunes by now.Aeris ought to be getting tired of karma fortunes by now.Aeris ought to be getting tired of karma fortunes by now.Aeris ought to be getting tired of karma fortunes by now.Aeris ought to be getting tired of karma fortunes by now.
 
Aeris's Avatar
 
Posts: 486
Karma: 1277790
Join Date: Sep 2013
Device: Kindle Paperwhite 5.3.4, Kindle Keyboard 3.4
Sorry for the waiting (I've been a little busy)... I'm over it, gonna fix the issue soon!

Thank you all for reporting!
Aeris is offline   Reply With Quote
Old 05-18-2014, 09:21 AM   #187
knc1
Going Viral
knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.
 
knc1's Avatar
 
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
Quote:
Originally Posted by Aeris View Post
Sorry for the waiting (I've been a little busy)... I'm over it, gonna fix the issue soon!

Thank you all for reporting!
Thanks!

We might have stumbled onto the answer,
but I admit that I was only guessing at the problem area.
knc1 is offline   Reply With Quote
Old 05-18-2014, 01:29 PM   #188
Aeris
Developer's Corner Mascot
Aeris ought to be getting tired of karma fortunes by now.Aeris ought to be getting tired of karma fortunes by now.Aeris ought to be getting tired of karma fortunes by now.Aeris ought to be getting tired of karma fortunes by now.Aeris ought to be getting tired of karma fortunes by now.Aeris ought to be getting tired of karma fortunes by now.Aeris ought to be getting tired of karma fortunes by now.Aeris ought to be getting tired of karma fortunes by now.Aeris ought to be getting tired of karma fortunes by now.Aeris ought to be getting tired of karma fortunes by now.Aeris ought to be getting tired of karma fortunes by now.
 
Aeris's Avatar
 
Posts: 486
Karma: 1277790
Join Date: Sep 2013
Device: Kindle Paperwhite 5.3.4, Kindle Keyboard 3.4
Here you go! Both the issues should be gone now... please test if the new version is ok!

1) The topbar did disappear because after removing it I assumed that koreader was installed and so that it would put it back when closed (in fact, it would have been true if the Koreader icons was properly hidden).

How did I fix it:
I added this line to koreader_launcher.sh:
Code:
lipc-set-prop com.lab126.pillow disableEnablePillow enable
2) The Koreader and Midori icons did show even if they were not installed because the clean-launcher script was executed before the menu was fully loaded (to soon). To fix it, I've dropped the code:
Code:
/mnt/us/extensions/kindlemenu/bin/sh/clean_launchers.sh &
in kindlemenu.sh, in favour of the following in the onload script in kindlemenupage.html:
Code:
nativeBridge.setLipcProperty("com.lab126.system", "sendEvent", "; sh -c '/mnt/us/extensions/kindlemenu/bin/sh/clean_launchers.sh &'");
Spoiler:
The only side effect is that now you will see these two icons for some milliseconds before they are removed. If you are a purist, install both the programs to get rid of that minimal thing too :P FIXED


Let me know if it is everything ok now! And thanks again for reporting, it was a quite annoying bug for users

Last edited by Aeris; 05-19-2014 at 06:23 AM.
Aeris is offline   Reply With Quote
Old 05-18-2014, 08:29 PM   #189
Cykotitan
Enthusiast
Cykotitan is kind to children and small, furry animalsCykotitan is kind to children and small, furry animalsCykotitan is kind to children and small, furry animalsCykotitan is kind to children and small, furry animalsCykotitan is kind to children and small, furry animalsCykotitan is kind to children and small, furry animalsCykotitan is kind to children and small, furry animalsCykotitan is kind to children and small, furry animalsCykotitan is kind to children and small, furry animalsCykotitan is kind to children and small, furry animalsCykotitan is kind to children and small, furry animals
 
Posts: 44
Karma: 6550
Join Date: May 2013
Location: Bosnia & Herzegovina
Device: Kindle Paperwhite 1 WiFi
That is quite the way I imagined, except I couldn't find the exact way to invoke external scripts via JS.

You can avoid getting the delay by moving the nativeBridge code outside of function custom_init, thus making it execute sooner (and hopefully, neither too late or too soon).
Cykotitan is offline   Reply With Quote
Old 05-19-2014, 06:21 AM   #190
Aeris
Developer's Corner Mascot
Aeris ought to be getting tired of karma fortunes by now.Aeris ought to be getting tired of karma fortunes by now.Aeris ought to be getting tired of karma fortunes by now.Aeris ought to be getting tired of karma fortunes by now.Aeris ought to be getting tired of karma fortunes by now.Aeris ought to be getting tired of karma fortunes by now.Aeris ought to be getting tired of karma fortunes by now.Aeris ought to be getting tired of karma fortunes by now.Aeris ought to be getting tired of karma fortunes by now.Aeris ought to be getting tired of karma fortunes by now.Aeris ought to be getting tired of karma fortunes by now.
 
Aeris's Avatar
 
Posts: 486
Karma: 1277790
Join Date: Sep 2013
Device: Kindle Paperwhite 5.3.4, Kindle Keyboard 3.4
You are definetly right, and there's no risk to execute it too soon (because the elements to hide are static)... released a new tiny bugfix
Aeris is offline   Reply With Quote
Old 07-20-2014, 08:20 PM   #191
Aeris
Developer's Corner Mascot
Aeris ought to be getting tired of karma fortunes by now.Aeris ought to be getting tired of karma fortunes by now.Aeris ought to be getting tired of karma fortunes by now.Aeris ought to be getting tired of karma fortunes by now.Aeris ought to be getting tired of karma fortunes by now.Aeris ought to be getting tired of karma fortunes by now.Aeris ought to be getting tired of karma fortunes by now.Aeris ought to be getting tired of karma fortunes by now.Aeris ought to be getting tired of karma fortunes by now.Aeris ought to be getting tired of karma fortunes by now.Aeris ought to be getting tired of karma fortunes by now.
 
Aeris's Avatar
 
Posts: 486
Karma: 1277790
Join Date: Sep 2013
Device: Kindle Paperwhite 5.3.4, Kindle Keyboard 3.4
Maybe it could be useful to UP this thread for new kindle users...
Aeris is offline   Reply With Quote
Old 09-06-2014, 04:27 PM   #192
evil_rock
Junior Member
evil_rock began at the beginning.
 
Posts: 6
Karma: 10
Join Date: Dec 2011
Device: none
Thanks for this app. I love it!
evil_rock is offline   Reply With Quote
Old 03-21-2016, 03:25 PM   #193
pete330
Connoisseur
pete330 ought to be getting tired of karma fortunes by now.pete330 ought to be getting tired of karma fortunes by now.pete330 ought to be getting tired of karma fortunes by now.pete330 ought to be getting tired of karma fortunes by now.pete330 ought to be getting tired of karma fortunes by now.pete330 ought to be getting tired of karma fortunes by now.pete330 ought to be getting tired of karma fortunes by now.pete330 ought to be getting tired of karma fortunes by now.pete330 ought to be getting tired of karma fortunes by now.pete330 ought to be getting tired of karma fortunes by now.pete330 ought to be getting tired of karma fortunes by now.
 
Posts: 66
Karma: 200233
Join Date: Aug 2013
Device: Kindle Paperwhite
Native Kindle Menu for Paperwhite (1 & 2) and Touch

Hi,

I tried Native Kindle Menu today on firmware 5.7.3.1 on my PW3? There are these problems on my device:

-The status bar shortcut does not work.
-Launching apps seems broken: when I tap on an app like GCalculator, the menu closes and the Kindle Home Screen is displayed. I made sure that the apps themselves do work when started via their KUAL menu item, i.e. GCalculator runs fine when started via KUAL.

What does work is displaying the Native Kindle Menu itself when triggered via its KUAL menu item, turning Wifi on/off works too. Launching apps seems broken.

Has anyone else noticed these problems on current firmware versions?
pete330 is offline   Reply With Quote
Old 03-21-2016, 07:05 PM   #194
NiLuJe
BLAM!
NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.
 
NiLuJe's Avatar
 
Posts: 13,477
Karma: 26012492
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
Most likely affects 5.6.5 too, stuff moved around a lot on the UI front (and it's way over my head).
NiLuJe is offline   Reply With Quote
Old 02-10-2017, 01:59 AM   #195
Mr.Samuel
Connoisseur
Mr.Samuel began at the beginning.
 
Mr.Samuel's Avatar
 
Posts: 69
Karma: 10
Join Date: May 2016
Location: Gold Town
Device: kindle paperwhite 3, kindle oasis 2
seems interesting...
Mr.Samuel is offline   Reply With Quote
Reply

Tags
launcher add-ons

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Kindle Touch 5.3.2 - almost Paperwhite! Vroo Amazon Kindle 23 01-21-2013 12:34 PM
here's how to compile a gtk native app for the kindle touch chris_c Kindle Developer's Corner 9 12-21-2012 12:01 AM
Kindle Touch sudoku with menu blackkbot Kindle Developer's Corner 6 05-31-2012 05:58 PM
Troubleshooting kindle touch menu button not response zenmindlei Amazon Kindle 4 03-26-2012 09:28 PM


All times are GMT -4. The time now is 03:54 AM.


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