11-03-2012, 08:26 PM | #1 |
20% cooler.
Posts: 93
Karma: 364674
Join Date: Oct 2012
Location: Poznań, Poland
Device: Kindle Paperwhite 1
|
WAF on Paperwhite
I wanted to play with it, but I can't seem to find anything here related to WAF apps on Paperwhite.
wafapp is gone. But don't worry - it's there, just under different name. It now lives as "mesquite", and WAF apps like browser, store, adviewer etc. are located in /var/local/mesquite Old instructions for getting your own WAF apps running are still working, they just need wafapp->mesquite name adjusting. But there is one thing I can't manage to do - specifying content path of app. It looks like mesquite always looks for index.html and ignores <content src="" /> tag in config.xml. I guess that schema has been changed and does not reflect anymore what is available here: https://www.mobileread.com/forums/showpost.php?p=1941579 Could someone with proper RE knowledge investigate if this is the case? |
11-04-2012, 05:36 AM | #2 | |
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Týr
Posts: 6,586
Karma: 6299991
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI| K4|K3-3G|DXG|K2| Rooted Nook Touch
|
Quote:
Glad it is still there. When I get my hands on a PW I will happily have a dig. That may be a little while though. Nice find mate!! |
|
Advert | |
|
11-05-2012, 11:49 AM | #3 | |
20% cooler.
Posts: 93
Karma: 364674
Join Date: Oct 2012
Location: Poznań, Poland
Device: Kindle Paperwhite 1
|
Quote:
As far as I found it over the Internet, on Touch store app was such an web application with specified remote content URL. Now it's JavaScript based and it launches remote location within an iframe. It's sad, as I really wanted to test that offline caching of the apps (or have I misunderstood something?) |
|
11-05-2012, 11:56 AM | #4 | |
but forgot what it's like
Posts: 741
Karma: 2345678
Join Date: Dec 2011
Location: north (by northwest)
Device: Kindle Touch
|
Quote:
BTW, you can download KT's mmcblk0p1 (main parition) from http://ixtab.tk/kindle-touch-images.php and look into it. Though WAF apps are located in /var/local, in fact, they are copied there by initialization procedure from somewhere at /opt (PW does the same). |
|
09-18-2013, 03:54 PM | #5 |
hub
Posts: 715
Karma: 2151032
Join Date: Jan 2012
Location: Iranian in Canada
Device: K3G, DXG, Kobo mini
|
Is it just me: web browsing in Kindle Touch 5.3.7 is way slower than previous firmware, say 5.2.0! Has anyone noticed mesquite is sluggish compared to WAF?
Also, I want to show the menubar in the mesquite application, e.g.. WebLauncher. How can it be enabled? P.S. I know about https://www.mobileread.com/forums/sho...02710#poststop Last edited by thatworkshop; 09-18-2013 at 04:31 PM. |
Advert | |
|
09-18-2013, 05:50 PM | #6 |
THE NOOB
Posts: 701
Karma: 1545649
Join Date: Jan 2012
Location: Italy
Device: Kindle Touch 5.3.2
|
You can set the visibility of the menu bar in the config.xml file of the WAF. I don't remember the exact option but it's easy to understand.
Anyway, if you just would like to use it without having it always displayed, you can tap on the black status bar (it's a bit tricky) to open it (well, in my Touch it works...). After using it, it will be hidden again! |
09-18-2013, 06:37 PM | #7 | |
hub
Posts: 715
Karma: 2151032
Join Date: Jan 2012
Location: Iranian in Canada
Device: K3G, DXG, Kobo mini
|
Quote:
Code:
hideStatusbar: false P.S. Holy crap, there are so many things in /var/local/mesquite/shared/js Last edited by thatworkshop; 09-18-2013 at 06:55 PM. |
|
09-19-2013, 07:34 AM | #8 |
THE NOOB
Posts: 701
Karma: 1545649
Join Date: Jan 2012
Location: Italy
Device: Kindle Touch 5.3.2
|
Well, I'm not on my kindle now.
Anyway, menu can be handled either by the waf o by the system. I can produce a piece of script to code to show how to customize the menu and the rest of the bar. In t4d meanwhile, you can take a look at the shared folder inside /var/local. If I recall correctly, there is a enum file with all the strings used and, somewhere, there is also the rest of the code. Look for sendMessage... |
09-19-2013, 07:37 AM | #9 |
THE NOOB
Posts: 701
Karma: 1545649
Join Date: Jan 2012
Location: Italy
Device: Kindle Touch 5.3.2
|
I forgot to mention that I suggest to handle the menu inside the WAF even if you'll have to write the code yourself!
(But you still need to write code also if you want the kindle to handle it) |
09-19-2013, 08:08 AM | #10 |
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Týr
Posts: 6,586
Karma: 6299991
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI| K4|K3-3G|DXG|K2| Rooted Nook Touch
|
I think my favourite thing about WAF is the level of voodoo.
It's like the ultimate cthulhu programming environment. |
09-19-2013, 09:45 AM | #11 |
hub
Posts: 715
Karma: 2151032
Join Date: Jan 2012
Location: Iranian in Canada
Device: K3G, DXG, Kobo mini
|
Thanks silver18. I was looking at your Komic, wondering why you decided to use a button as menu and not the conventional menu on top!
Last edited by thatworkshop; 09-19-2013 at 09:58 AM. |
09-19-2013, 10:19 AM | #12 |
THE NOOB
Posts: 701
Karma: 1545649
Join Date: Jan 2012
Location: Italy
Device: Kindle Touch 5.3.2
|
I decided to use a button instead of using the stock menu button because the latter is placed in the menu bar and I don't want to display it.
Anyway, before I started to think about a complete rework of the home page (yep, I'm thinking about it), I placed some bits of code to take control of the menu bar. It is, actually, very easy to do...just a json and a sendMessage. I'll copy here the code asap. Maybe, it is also possible to let the kindle handle it and have the menu filled with stock options (wifi, store...)! What I like about WAFs is that I'm lazy and I don't want to port Komic to a kindlet!! |
09-22-2013, 05:08 PM | #13 |
THE NOOB
Posts: 701
Karma: 1545649
Join Date: Jan 2012
Location: Italy
Device: Kindle Touch 5.3.2
|
Oops, here's the code!
Place these to receive messages from searchbar and from the menu: Code:
kindle.messaging.receiveMessage('searchBarButtonSelected', callbackFunction); kindle.messaging.receiveMessage('systemMenuItemSelected', callbackFunction); Code:
function setupChrome () { var json = { "appId": "yourAppId", "searchBar": { "clientParams": { "profile": { "name": "yourProfile", "buttons": [ { "id": "buttonID", "state": "buttonState", "handling":"buttonHandling" } ] } } }, "systemMenu": { "clientParams": { "profile": { "name": "default", "items": [ { "id": "store", "state": "hidden", "handling":"system", "label":"The damn store", "position":0 }, { "id": "yourFirstMenuItem", "state": "buttonState", "handling":"buttonHandling", "label":"yourFirstMenuItem", "position":1 }, { "id": "yourSecondMenuItem", "state": "buttonState", "handling":"buttonHandling", "label":"yourSecondMenuItem", "position":2 } ], "selectionMode": "none", "closeOnUse": true } } } }; kindle.messaging.sendMessage('com.lab126.pillow', 'configureChrome', json); } So, adding it in first position and hiding it is useful... This is the callbackFunction: Code:
function callbackFunction (property, json){ if ((property == 'searchBarButtonSelected') && (json == 'yourFirstSearchbarItem')){ } if ((property == 'searchBarButtonSelected') && (json == 'yourSecondSearchbarItem')){ } if ((property == 'systemMenuItemSelected') && (json == 'yourFirstMenuItem')){ } if ((property == 'systemMenuItemSelected') && (json == 'yourSecondMenuItem')){ } } Code:
buttons: { back: 'back', store: 'store', home: 'home', forward: 'forward', menu: 'menu', refresh: 'refresh', cancel: 'cancel' }, Code:
buttonStates: { enabled: 'enabled', disabled: 'disabled', hidden: false }, Code:
buttonHandling: { system: 'system', notifyApp: 'notifyapp' } |
09-24-2013, 12:58 AM | #14 |
hub
Posts: 715
Karma: 2151032
Join Date: Jan 2012
Location: Iranian in Canada
Device: K3G, DXG, Kobo mini
|
Thanks silver18 for all this. I'm just starting with WAF programming... Which files each of the codes you posted should go into? index.html, config.xml, etc.
|
09-24-2013, 06:23 PM | #15 |
THE NOOB
Posts: 701
Karma: 1545649
Join Date: Jan 2012
Location: Italy
Device: Kindle Touch 5.3.2
|
I think I forgot something placed in config.xml...it could be the lipc messaging part...
I'll add it asap. BTW, the config.xml is a configuration file with everything needed by the kindle to setup the application environment. You can place all the code in a javascript file linked with the html. I suggest you to write your WAF with a landing page (index.html) and using content windows to show contents. It's a PITA to rewrite everything later... |
Tags |
kindle, mesquite, paperwhite, waf |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
/var/local/waf | Semir | Kindle Developer's Corner | 0 | 08-25-2012 03:53 PM |
WAF and select menu | silver18 | Kindle Developer's Corner | 4 | 05-06-2012 12:19 PM |
WAF Website | aditya3098 | Kindle Developer's Corner | 3 | 03-07-2012 11:53 AM |
WAF Kalc for kindle touch | aditya3098 | Kindle Developer's Corner | 8 | 02-28-2012 11:10 PM |