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 06-04-2012, 08:24 AM   #1
silver18
THE NOOB
silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.
 
silver18's Avatar
 
Posts: 701
Karma: 1545649
Join Date: Jan 2012
Location: Italy
Device: Kindle Touch 5.3.2
WAFs: useful hints and problems

Hi there!!

I'm opening this thread to sum up hints and problems related to WAFs.
I'd wish it become a place where to share info and help each other solving problems...

First of all, here's a link to Aditya3098's website with a guide and some WAFs.

Here's a small list of what I discovered: click

Now, a small list of problems I encountered:

- update from 5.0.4 to 5.1.0: pinch-to-zoom stopped working. I can make it working creating a new content window but then I get a big mess from the rest of the page!! It can't be turned on even with
Code:
kindle.viewport.setPinchZoomState(true);
- update from 5.0.4 to 5.1.0: alert boxes called in a page different from index.html make the WAF to crash. Only workaround is to call an alert box first in index.html, then in other pages.

And, finally, a question:

Besides HTML standard events (onClick etc...), does the Kindle has a set of built-in events to handle long tap, double tap or similar?
silver18 is offline   Reply With Quote
Old 06-10-2012, 10:11 AM   #2
silver18
THE NOOB
silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.
 
silver18's Avatar
 
Posts: 701
Karma: 1545649
Join Date: Jan 2012
Location: Italy
Device: Kindle Touch 5.3.2
Nice: 153 views, 11 downloads but nobody shared anything...
silver18 is offline   Reply With Quote
Advert
Old 06-10-2012, 10:15 AM   #3
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 silver18 View Post
Nice: 153 views, 11 downloads but nobody shared anything...
You where expecting a collaborative work environment maybe?
knc1 is offline   Reply With Quote
Old 06-10-2012, 10:22 AM   #4
silver18
THE NOOB
silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.
 
silver18's Avatar
 
Posts: 701
Karma: 1545649
Join Date: Jan 2012
Location: Italy
Device: Kindle Touch 5.3.2
Quote:
Originally Posted by knc1 View Post
You where expecting a collaborative work environment maybe?
Same question I ask myself everyday at the University!
silver18 is offline   Reply With Quote
Old 06-10-2012, 10:38 AM   #5
geekmaster
Carpe diem, c'est la vie.
geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.
 
geekmaster's Avatar
 
Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
Quote:
Originally Posted by silver18 View Post
Same question I ask myself everyday at the University!
It would be nice if others collaborate to get your University homework finished on time.

It seems to take quite awhile before others start contributing to things that you started. For example, in the Tools Index, there is a "Newbies Guide to Kindle Development" that I started a LONG time ago, and still no new contributors. It seems that you need to get above a minimum USEFUL content that you add yourself, before others start adding stuff, which I did not achieve in that (mostly empty) guide, apparently.

Last edited by geekmaster; 06-10-2012 at 10:43 AM.
geekmaster is offline   Reply With Quote
Advert
Old 06-10-2012, 10:54 AM   #6
silver18
THE NOOB
silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.
 
silver18's Avatar
 
Posts: 701
Karma: 1545649
Join Date: Jan 2012
Location: Italy
Device: Kindle Touch 5.3.2
Quote:
Originally Posted by geekmaster View Post
It would be nice if others collaborate to get your University homework finished on time.

It seems to take quite awhile before others start contributing to things that you started. For example, in the Tools Index, there is a "Newbies Guide to Kindle Development" that I started a LONG time ago, and still no new contributors. It seems that you need to get above a minimum USEFUL content that you add yourself, before others start adding stuff, which I did not achieve in that (mostly empty) guide, apparently.
I share virtually everything I know but, as I know almost nothing, I'm not so useful to others!
I hope to improve myself, but, till then, this is what I have!
silver18 is offline   Reply With Quote
Old 06-10-2012, 11:48 AM   #7
diba
Addict
diba is generous with chocolatediba is generous with chocolatediba is generous with chocolatediba is generous with chocolatediba is generous with chocolatediba is generous with chocolatediba is generous with chocolatediba is generous with chocolatediba is generous with chocolatediba is generous with chocolatediba is generous with chocolate
 
Posts: 396
Karma: 33660
Join Date: Jul 2011
Device: Kindle 3, Kindle 4, Kindle PW, Nexus7 3G
You are useful to others, be sure. At least for me!
diba is offline   Reply With Quote
Old 09-27-2012, 08:02 AM   #8
silver18
THE NOOB
silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.
 
silver18's Avatar
 
Posts: 701
Karma: 1545649
Join Date: Jan 2012
Location: Italy
Device: Kindle Touch 5.3.2
New update...

Here is what I discovered last time.

How to catch menu and back button:

Code:
kindle.messaging.receiveMessage('searchBarButtonSelected', YOUR_FUNCTION HERE);

function YOUR_FUNCTION HERE (property, json){
	if ((property == 'searchBarButtonSelected') && (json == 'menu')){
       	        do something when menu button is choosed
	}

	if ((property == 'searchBarButtonSelected') && (json == 'back')){
		do something when back button is choosed
	}
}
Place this in config.xml:

Code:
<kindle:messaging>
       	<kindle:app name="com.lab126.pillow" value="yes"/>
</kindle:messaging>
However I can't catch the back button as it seems to be still controlled by the kindle framework (i.e it brings me back to home).

This could be used to read any other message...you just need to find the message (showlog -f) and duplicate the system used by pillow.
Example:
place this in config.xml:
Code:
<kindle:app name="com.lab126.adManager" value="yes" />
and this in javascript:
Code:
kindle.messaging.receiveMessage('adViewerMsgCallback', YOUR_FUNCTION_HERE);


How to increase the available memory for WAFs:

Code:
sqlite3 /var/local/appreg.db "INSERT INTO properties (handlerId, name, value) VALUES ('YOUR_APP_HERE','memUnloadLevel','150000')"

sqlite3 /var/local/appreg.db "INSERT INTO properties (handlerId, name, value) VALUES ('YOUR_APP_HERE','memWarnLevel','71680')"
This changes the warning level and unload level (as used by the browser). It solves the force closing problem when using an heavy WAFs for long time.


Content window & CO:

You can use the index.html page of your WAF as a landing page. Then you can use
Code:
kindle.chrome.createContentWindow(YOUR_PAGE_HERE);
to create a new content window. It can address also local saved pages:
Code:
YOUR_PAGE_HERE = "/mnt/us/hello.html"
Once you created the content window, you can move it foreground or background:
Code:
kindle.chrome.setContentWinDisplay('foreground');
kindle.chrome.setContentWinDisplay('background');
Moving background will bring back your landing page index.html (but it won't trigger the onload event).

EDIT: I forgot to mention that content windows have PINCH-TO-ZOOM (I still don't understand why WAFs can't have it).

Search in wikipedia from a WAF:

You can launch a wiki search this way:
Code:
search = YOUR_SEARCH_HERE
remoteUri = "http://en.wikipedia.org/wiki/"+search;
kindle.appmgr.start('com.lab126.browser?view=' + remoteUri );
Search variable could be retrieved from a classic prompt.
This can obviously used to search everything on the internet using the browser.
You can return to your WAF using the back button.


Miscellaneous:

These should be self explanatory...

Code:
kindle.gestures.ontap = function () {   }
kindle.appmgr.onback = function () {   }
kindle.gestures.onswipe = function () {   }
kindle.appmgr.back()
kindle.appmgr.onforward = function () {   }
kindle.dev.clearApplicationCache()
kindle.dev.clearCookies()
kindle.dev.clearCache()

Now....anyone knows how to create a menu like the one used by the browser?
I tried to study the browser WAF but the menu thing is just...beyond my knowledge...

Last edited by silver18; 09-27-2012 at 08:07 AM.
silver18 is offline   Reply With Quote
Old 09-27-2012, 10:36 AM   #9
eureka
but forgot what it's like
eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.
 
Posts: 741
Karma: 2345678
Join Date: Dec 2011
Location: north (by northwest)
Device: Kindle Touch
I've tried to look at how menu is populated in browser app and found something useful.

Here is patch for enabling orientation menu item in browser (tested on 5.1.2):
Code:
--- /var/local/waf/browser/js/menuItems.js.orig
+++ /var/local/waf/browser/js/menuItems.js
@@ -89,7 +89,13 @@
         // add dynamic items - TODO: Add lock rotation if ever re-implemented
         items.splice(0, 0, createWireless());
         items.splice(2, 0, createArticle());
+        items.splice(2, 0, createRotation());
 
+        var orientationItem = createOrientation();
+        if (orientationItem) {
+            items.splice(2, 0, orientationItem);
+        }
+
         return items;
     };
 
@@ -124,6 +130,32 @@
                 bapp.dialog.hide();
             }
         };
+    };
+
+    var createOrientation = function () {
+      if (settings && settings.orientation && settings.orientation == 'auto') {
+        return null;
+      }
+    
+      var label,
+          state = bapp.getOrient();
+          
+      if (state == 'portrait') {
+        label = 'Landscape Mode';
+        state = 'landscape';
+      }
+      else if (state == 'landscape') {
+        label = 'Portrait Mode';
+        state = 'portrait';
+      }
+      
+      return {
+        label: label,
+        action: function () {
+          bapp.setOrientation(state);
+          bapp.dialog.hide();
+        }
+      };
     };
 
     /**
After patching there will be one or two new items in browser menu:
  • Lock Rotation / Unlock Rotation
  • Portrait Mode / Landscape Mode (it will appear only when rotation is locked by previous menu item!)
Adding of Lock/Unlock Rotation menu item wasn't required in strict sense, but I just wanted to keep original logic.

bapp.setOrientation function (which in fact calls kindle.dev.setOrientation) supports following argument values:
  • auto
  • portrait
  • portraitUp
  • portraitDown
  • landscape
  • landscapeLeft
  • landscapeRight
So, browser can be oriented in any way (if someone will write a little bit of additional code).

I'm not providing detailed instruction on how to make needed changes, because it's a bit "dangerous". It will not crash or brick KT, but could stop future firmware updates to proceed. But, I believe, other forum users willl provide user-friendly instructions. Anyway, make backups of changed files before applying of changes!

(Also these new menu items aren't localized. It could be easily done, though: add new strings at /var/local/waf/browser/locales/<locale>/js/strings.js and then use bapp.strings.<your string> in place of menu label value.)

UPD: oh, credits for discovering kindle.dev.setOrientation and all of it's argument values should go to silver18.

UPD2: on boot (i.e. after reboot) all changes made in files of /var/local/waf and it's sub-direcories will be lost, because upstart job /etc/init/appmgrd.conf will uncoditionally copy there files from /opt/var/local/waf. So, it means that (as simple, but not only solution) changes must be applied to file in /opt/var/local/waf too.

Last edited by eureka; 09-27-2012 at 04:05 PM. Reason: changes to stock WAF app will be lost on reboot
eureka is offline   Reply With Quote
Old 10-08-2012, 07:39 AM   #10
silver18
THE NOOB
silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.
 
silver18's Avatar
 
Posts: 701
Karma: 1545649
Join Date: Jan 2012
Location: Italy
Device: Kindle Touch 5.3.2
While still trying to figure out how to create a menu, I'm here to share a new idea...

Some WAFs use kindle.messaging.sendMessage to send messages to lipc. Here's how the adviewer does it:

Code:
kindle.messaging.sendMessage('com.lab126.adManager', 'adViewerMessage', buildMsgReq(START_BROWSE, params));
As lipc it something outside the WAF, this is used to send messages for logs and for performing actions.
If we could bind our WAFs lipcId to some properties, we could use lipc to run a script from inside a WAF by sending the corresponding message.

The point is I can't find where all services and all properties are declared.

NB We can already do the opposite by reading messages in a WAF from lipc.
This works, for example, for getting interactions with the search bar
silver18 is offline   Reply With Quote
Old 10-19-2012, 11:39 AM   #11
silver18
THE NOOB
silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.
 
silver18's Avatar
 
Posts: 701
Karma: 1545649
Join Date: Jan 2012
Location: Italy
Device: Kindle Touch 5.3.2
This is used to update the titlebar according to the contentWindow title (and when the contentWindow title changes):

Code:
kindle.chrome.onContentTitleChanged = function (title) {

	kindle.chrome.setTitleBar('', title);

}


And this is used to take control on the searchbar buttons (store, back and menu). As described before, we can use those buttons to trigger any function but we need first to take control on them (i.e setting the button to "notifyApp").
We can also disable buttons (they become grayed).

Code:
function setupSearchBar(){

        var json = {
            "appId": "YOUR APP ID HERE",            
            "searchBar": {
                "clientParams": {
                    "profile": {
                        "name": "default",
                        "buttons": [
                            { 
                                "id": "menu",
                                "state": "enabled",
                                "handling":"notifyApp"
                            },                             
                            { 
                                "id": "back",
                                "state": "disabled",
                                "handling":"notifyApp" }, 
                            { 
                                "id": "store",
                                "state": "enabled",
                                "handling":"system"
                            } 
                        ]
                    }
                } 
            } 
        };
        
        kindle.messaging.sendMessage('com.lab126.pillow', 'configureChrome', json);

}
"State" could be enabled or disabled, "handling" could be notifyApp or system.
silver18 is offline   Reply With Quote
Old 10-19-2012, 11:48 AM   #12
silver18
THE NOOB
silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.
 
silver18's Avatar
 
Posts: 701
Karma: 1545649
Join Date: Jan 2012
Location: Italy
Device: Kindle Touch 5.3.2
And again...

Here's how to display the forward button (add this to the json variable shown before)

Code:
{
        "id": 'forward',
        "state": "enabled",
        "handling": "notifyApp",
}
The same way to display the refresh button:

Code:
{
        "id": 'refresh',
        "state": "enabled",
        "handling": "notifyApp",
}
silver18 is offline   Reply With Quote
Old 10-19-2012, 12:04 PM   #13
silver18
THE NOOB
silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.
 
silver18's Avatar
 
Posts: 701
Karma: 1545649
Join Date: Jan 2012
Location: Italy
Device: Kindle Touch 5.3.2
This is a screenshot showing the searchbar modded: back & forward buttons + search + menu button.

Back & forward buttons are enabled/disabled dinamically.

I'm studying about the menu thing...
Attached Thumbnails
Click image for larger version

Name:	screenshot_2012-10-19T18_00_20-0200.gif
Views:	391
Size:	36.3 KB
ID:	94463  
silver18 is offline   Reply With Quote
Old 11-16-2012, 09:18 AM   #14
silver18
THE NOOB
silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.
 
silver18's Avatar
 
Posts: 701
Karma: 1545649
Join Date: Jan 2012
Location: Italy
Device: Kindle Touch 5.3.2
Some more information... This time we're talking about
KINDLE MENU


I packed all relevant files in a zip file. Feel free to modify them!

1) First of all you need to add a menu template in your html page:
Code:
<script id="menuTemplate" type="text/x-jquery-tmpl">
    	<div class='temp-dialog'>
       	       	<div class='header'>
	   	       	<div class='close'/>
            	       	<div class='title'>
                	       	${titleText}
            	       	</div>
       	       	</div>
       	       	<ul class='overlaylist'>
		       	<li id='orientation' class='action'></li>
		       	<li id='bookmarks' class='action'></li>
            	       	<li id='deletions' class='action'></li>
		       	<li id='options' class='action'></li>
		       	<li id='lastread'></li>
       	       	</ul>
   	</div>
</script>
This contains:
- header with title and close button
- overlaylist with all menu entry you need.
You must use an unambiguous id for every entry (here we have orientation, bookmarks, deletions, options and lastread).
If you need to make one entry non-clickable, just remove the action class.


2) Then you need to link jquery.js, jquery.tmpl.js and some other js and css files (menu.js, windowing.js and menu.css):
Code:
<script type="text/javascript" src="resource/Lib/jquery.js"></script>
<script type="text/javascript" src="resource/Lib/jquery.tmpl.js"></script>
<script language="Javascript" src="resource/Javascripts/MenuDialog/menu.js"></script>
<script language="Javascript" src="resource/Javascripts/MenuDialog/windowing.js"></script>
<link rel="stylesheet" type="text/css" href="resource/CSS/MenuDialog/menu.css" />

3) And then you need to bind the onClick event to something in order to display the menu when tapping a button/image/div:
Code:
onClick="new KomicMenu().showMenu();"/>
You can change the function name, but remember to change it also in menu.js.


4) Once you set up everything, you can now enjoy yourself altering the code in menu.js to suit your needings. You can also play with menu.css!


5) Now you just need to change the path to every file according to where you placed the those files.



Download the package here!!!


EDIT: I forgot a nice screenshot!!!
Attached Thumbnails
Click image for larger version

Name:	screenshot_2012-10-25T16_34_53-0200.gif
Views:	377
Size:	26.8 KB
ID:	96244  

Last edited by silver18; 11-16-2012 at 09:21 AM.
silver18 is offline   Reply With Quote
Old 11-19-2012, 07:48 AM   #15
silver18
THE NOOB
silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.
 
silver18's Avatar
 
Posts: 701
Karma: 1545649
Join Date: Jan 2012
Location: Italy
Device: Kindle Touch 5.3.2
Quote:
Originally Posted by silver18 View Post
Some WAFs use kindle.messaging.sendMessage to send messages to lipc. Here's how the adviewer does it:

Code:
kindle.messaging.sendMessage('com.lab126.adManager', 'adViewerMessage', buildMsgReq(START_BROWSE, params));
As lipc it something outside the WAF, this is used to send messages for logs and for performing actions.
If we could bind our WAFs lipcId to some properties, we could use lipc to run a script from inside a WAF by sending the corresponding message.
I'm here again...The biggest problem when using a WAF is the lack of shell scripting.
While I still think the solution posted above is the real solution to this problem, one could also act this way:

1) use inside JavaScript
Code:
kindle.messaging.sendMessage(YOUR_WAF_HERE, YOUR_PROPERTY_HERE, YOUR_MESSAGE_HERE);
2) place in config.xml
Code:
<kindle:app name="YOUR_WAF_HERE" value="yes" />
3) once the sendMessage command is launched, you can see this in showlog -f:
Code:
121119:133711 wafapp[1882]: W lipc:pnr:prop=YOUR_PROPERTY:Property not registered
121119:133711 wafapp[1882]: E com.silver18.komic001:LipcAdapter::setProperty:Failed to set string property YOUR_PROPERTY:
4) One could, hypothetically, run a script in background (using the same starting script used to run the WAF with the launcher) to continuously check the log for the correct property and, if found, do something.

This means, on the other hand, having something running in background (I don't like this!!)
silver18 is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Classic Nook on screen hints? Hellmark Barnes & Noble NOOK 4 08-12-2011 08:54 AM
Tips, Tricks, and Hints Nate the great Amazon Kindle 44 03-22-2011 04:15 AM
The Times hints at release of new Kindle Grumpyreader News 0 06-04-2010 12:36 PM
Q7 - v3.0 firmware - Hints and Tricks rogue_ronin Alternative Devices 8 06-30-2009 02:59 PM
Any hints on first software update? Leaping Gnome Sony Reader 32 12-07-2006 10:22 AM


All times are GMT -4. The time now is 07:02 AM.


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