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

Go Back   MobileRead Forums > E-Book Readers > Sony Reader > Sony Reader Dev Corner

Notices

Reply
 
Thread Tools Search this Thread
Old 09-12-2008, 01:27 PM   #1
mkaluza
Member
mkaluza began at the beginning.
 
Posts: 20
Karma: 27
Join Date: Jul 2008
Device: PRS-505
Framework for integrating applications

Hi.
Finally after some time of writing it is ready enough to be released for preview.
What it provides:
- application-wide, unified, fast logger (I wouldn't get here without it)
* fast - has buffered and sync modes(sync - former trace() - takes ~0.1s per write, so its sloooow, but inevitable for situations where hard reset occurs and buffers are lost)
* appends object/function names into the log if desired
* shows timestamp - good for profiling/optimizing
future: automatic callstack tracing

- text input engine
* modular - T9 (tree index based - under developement) and dumb (no index, as in cellphones without dict) modules available

- object base controls for creating apps
* Edit and TextEdit (under developement) for text input
* TextView for multiline scrollable viewer (it even displays scrollbar )

- windows/modals management
* windows stack (closing one takes you back to the one that opened it)
* all you need to do is call MyDocument.openWindow/openModal/closeWindow/closeModal to change window/dialog box. Wherever you are.
* Modal dialog boxes - select, message, and input box with callbacks for interacting with the user.

- Shell object - all things for running scripts from Igorsk enclosed in an object
- Options object, for easy loading/keeping/saving options
- Few other small things that make life much easier.

Most important thing - my aim was reader integration, so almost everything works when patched into main.xml

It contains two applications - a dictionary, based on those components - actually it was the reason for me to write all this, because I didn't like the way text was input in the existing one.
Another feature of it is that it doesn't cover (most of) book's text(when it runs within the UI), and I plan to move the input to the status line, so that you can see the word you want to look up - after that the translation is displayed fullscreen.
The other app is Five Balls game. I took it (with Clemenseken's permission) to check, how other apps integrate. Apart from few minor path and name changes it was copy-paste job, so it it met one of it's goals quite nicely.

INSTALL:
unzip sd.tgz to the root of sd card, as usuall
rd.tgz must be unzipped to internal memory
wb.tgz and ita.tgz must be unzipped to internall memory (I'll explain why later) - these are indexes and at least one is necessary.

resources.tgz - it contains a patched main.xml and all the acompanying files. You can extract it onto internall memory, run sd autorun, press 1 and follow instructions.
WARNING - this is experimental. Backup internal memory contents before doing it. If you're done, run sd autostart and press2, or hold 9 in main reader menu until message appears or reboot the reader. If you don't do it and write something to internal memory, you end up with corrupted filesystem
WARNING2 - I still have old firmware. I don't suppose it makes any difference, but just for the record.
WARNING3 - if you're not sure what this does internally, don't do it! You have been warned - if you break something, I don't care.

Of course running it from the card it safe - in worst case scenario it'll hang/crash the reader for hard reset, but it should happen - it's fairly well debugged.

It generates quite large amount of logs - logger.log file will grow fast, but if you manage to crash it, it'll help me to determine what went wrong. To disable it, find Logger.prototype.disabled=0; in lib.js and change it to 1;

Of course the problem with the dictionaries/indexes is that they have to be generated. I've got a simple script, but it needs more work.

It's not yet final and it's not yet finished. Some interfaces may change a little when I work on them, and some features need to be added (multiline edit, adding words to t9 dictionaries). It's just to show you how it works and to discuss further development. Of course if someone has time and will, there are some things to do - "installer"-integration into PRScustomizer, a builder/checker for main.xml, dictionary generator (it's a python class now)

I decided to show it as is, because my college starts and I'll have much less time for development (apart from it, I work full time, sometimes sleep and sometimes have private life

If you want to start looking into it - start with dictionary/group.js, autorun.js - they're quite clean and contain the essence of using this stuff
Don't even look into autorun.xml code section. It's garbage, didn't have time to clean it up. The same with init.js - these Hold* functions are old, works 5,6,7 and 9. It's still a have-to-figure-it-out part.

But use mostly SD version...

Ufff... comments are welcome.

happy hacking
Martin.
Attached Files
File Type: gz ita.tar.gz (456.8 KB, 211 views)
File Type: gz wb.tar.gz (7.50 MB, 222 views)
File Type: gz sd.tar.gz (99.6 KB, 222 views)
File Type: gz resources.tar.gz (118.6 KB, 224 views)
mkaluza is offline   Reply With Quote
Old 09-13-2008, 11:50 AM   #2
JeffElkins
PRSCustomizer
JeffElkins is no ebook tyro.JeffElkins is no ebook tyro.JeffElkins is no ebook tyro.JeffElkins is no ebook tyro.JeffElkins is no ebook tyro.JeffElkins is no ebook tyro.JeffElkins is no ebook tyro.JeffElkins is no ebook tyro.JeffElkins is no ebook tyro.JeffElkins is no ebook tyro.
 
JeffElkins's Avatar
 
Posts: 773
Karma: 1416
Join Date: Jan 2008
Device: PRS 505 Blue/iPod Touch/Epic 4G/Nook Classic
Quote:
Originally Posted by mkaluza View Post
WARNING2 - I still have old firmware. I don't suppose it makes any difference, but just for the record.
This is a great effort you're working on, thanks!

I hope you're going to update your firmware...I just did a diff between old and new main.xml and there are lots of changes. I'm afraid dropping an old main.xml into a new firmware would cause breakage
JeffElkins is offline   Reply With Quote
 
Enthusiast
Old 09-13-2008, 02:39 PM   #3
mkaluza
Member
mkaluza began at the beginning.
 
Posts: 20
Karma: 27
Join Date: Jul 2008
Device: PRS-505
And does the sd version works for you? if so, it's very likely that simply generating a diff with my changes (which are actually very minor - just a bootstrap code and a patch into modelChanged, but I suppose I know how to get rid it) against the old fw and applying it to new main.xml would do the job (and there are two unessential lines in applicationStart.xml)

I didn't do the update since I wanted to reach some stable version first, so than I can chase just incompatibility bugs - 5k lines of code makes a lot of space for errors :/ But now I'll probably do the update as soon as I find some windoze pc here

My point in making all this (apart from wanting a notepad on my sony is that I want to make writing applications easy enough for others to start doing it - after all its just jscript and simple xml, and there are many web developers out there that could probably write many things if we just hide the sony-specific parts from them. If more people are interested in this and help me with the project, we could create a kind of sdk, that could include this framework, some docs/tutorials, maybe some syntax checker for xml and js to make creating new apps for sony easier, if not easy. (yeah, I'm a long time linux user/admin and I belive in "The Community" )

Actually, since it's xml, I think that using xslt stylesheets (and some js code) it would be possible to load main.xml into mozilla and display it more-less correctly. I'm only guessing now because I don't really know xslt yet, but this along with some adaptation code (both mozilla to sony(FileSystem object) and sony to mozilla) could create quite a useful emulator... and mozilla has js debugger, which would help a lot... ;]

By the way, I didn't know that so many cool (from programmer's point of view) things can be done in js

greetz
Martin

PS
My dream is to have a sony port of freemind, or something similar
mkaluza is offline   Reply With Quote
Old 09-13-2008, 02:50 PM   #4
JeffElkins
PRSCustomizer
JeffElkins is no ebook tyro.JeffElkins is no ebook tyro.JeffElkins is no ebook tyro.JeffElkins is no ebook tyro.JeffElkins is no ebook tyro.JeffElkins is no ebook tyro.JeffElkins is no ebook tyro.JeffElkins is no ebook tyro.JeffElkins is no ebook tyro.JeffElkins is no ebook tyro.
 
JeffElkins's Avatar
 
Posts: 773
Karma: 1416
Join Date: Jan 2008
Device: PRS 505 Blue/iPod Touch/Epic 4G/Nook Classic
I'm new to js as well. I've coded over the years in many languages, but somehow avoided javascript

I haven't run the sdcard version yet. I'm working on an update to PRSCustomizer, so I hope to play with your app next week. Looking forward to it.
JeffElkins is offline   Reply With Quote
Old 09-16-2008, 02:50 AM   #5
mkaluza
Member
mkaluza began at the beginning.
 
Posts: 20
Karma: 27
Join Date: Jul 2008
Device: PRS-505
Cool. Before you start, PM me and I'll send you latest stable code - especially if you're going to look into libUI.js or dict2.js - I'm unifying all interfaces now and constantly make changes, so it is hard to keep this version here up to date, since I'd have to do it like twice a day.

BTW, I forgot to include the manual
The only thing about the dictionary is that pressing Mark button displays a window with all possible words you can get from this key combination, and holding the Mark button shows change language window. The cool thing about it is, that it's done by the framework - the dict app only specifies when creating an UIEdit object, that it wants to use just those indexes, that have contents connected (well, its not implemented yet and now it just uses all of them, but soon it will be - anyway, both supplied have contents, so there's no problem )
mkaluza 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
Bible Framework ProDigit Workshop 33 04-16-2012 11:49 AM
Ebook reader integrating translation blyde Which one should I buy? 18 08-26-2010 07:08 AM
Integrating Content Server with existing webserver? mmseng Calibre 3 01-14-2010 10:08 PM
Automatic Downloaders Framework -Thomas- iRex 41 10-19-2009 04:55 PM
Integrating Readability/TidyRead with calibre news fetching strico Calibre 1 09-18-2009 12:54 PM


All times are GMT -4. The time now is 11:48 AM.


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