08-11-2008, 07:36 PM | #1 |
Member
Posts: 20
Karma: 27
Join Date: Jul 2008
Device: PRS-505
|
Code to launch autorun from SD without pullin the card out
I'm not sure, but if it was posted here already, then sorry for the mess.
Actually biggest thanks go to llasram for figuring out, how to force memory rescan and therefore initiate card autorun script. The code below, when run, hooks up to bookmark-key-hold action and forces a rescan when the button is held. This allows to avoid pulling the card in and out each time you want to use an app from there (a dict for example). The hook is not permanent - it's cleared upon device reboot (obvious) and also when the device is connected and disconnected from usb - main UI seems to be reinitialized then. (this shows a particularly interesting opportunity - if we mount --bind the directory with main.xml to a dir on a /Data partition and it is rescanned and loaded from a new location, we can gain a bricking-safe way to manipulate main.xml without even the need to reflash the reader, but this I'll check tomorrow) var objs = new Array(); var obj; var n=0; obj=this; while(n<30) { //infinite loop protection - 30 is an arbitrary number objs[n]=obj; if (obj.container) obj=obj.container; else break; n++; } //not a very nice way, but for now I haven't figured out any better objs[n-2].doMarkMenu=function() { this.setVariable("SHD_TIME","XXXXX");//just for fun kbook.model.initialized(); //got this from bookswap, thanks again }; It's of course just a very general demo - it can be made much more versatile and context sensitive. Comments and remarks are welcome, as always. btw. llasram - how did you find it? Object dump didn't show it to me. Martin |
08-12-2008, 12:05 PM | #2 |
Wizard
Posts: 3,671
Karma: 12205348
Join Date: Mar 2008
Device: Galaxy S, Nook w/CM7
|
Thanks for the tip I'll have to try it out.
=X= |
Advert | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
PRS-500 Christmas gift: MahJonG game (starting from SD card via autorun) | Clemenseken | Sony Reader Dev Corner | 9 | 05-16-2011 05:05 AM |
Christmas gift: MahJonG game (starting from SD card via autorun) | Clemenseken | Sony Reader Dev Corner | 19 | 05-06-2011 04:09 PM |
Dictionary for Sony PRS500/5 (autorun from SD card) | Clemenseken | Sony Reader Dev Corner | 155 | 01-06-2011 03:58 PM |
Let's create a source code repository for DR 800 related code? | jraf | iRex | 3 | 03-11-2010 12:26 PM |
PRS-500 Dictionary for Sony PRS500/5 (autorun from SD card) with onscreen keyboard | Clemenseken | Sony Reader Dev Corner | 3 | 07-05-2008 08:33 AM |