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

Go Back   MobileRead Forums > E-Book Readers > More E-Book Readers > HanLin eBook

Notices

Reply
 
Thread Tools Search this Thread
Old 01-12-2010, 04:40 AM   #1
leobueno
Junior Member
leobueno has learned how to read e-booksleobueno has learned how to read e-booksleobueno has learned how to read e-booksleobueno has learned how to read e-booksleobueno has learned how to read e-booksleobueno has learned how to read e-booksleobueno has learned how to read e-books
 
Posts: 5
Karma: 770
Join Date: Oct 2009
Device: hanlin
Leo's Hanlin V3 eBook SDK

After hard work, I've uploaded the first version of Leo's Hanlin eBook V3 SDK. This is the development environment was used for the development of Leo's Void (planetarium) and Leo's Wikipedia Reader. It also includes a programming language Script (similar to javascript) in order to develop applications quickly.

The sources include complete sources of Leo's Void and Leo's Wikipedia Reader.

It is released as a GNU project under the GPL. So the code is open and is available for download at:

http://sourceforge.net/projects/ebooksdk/

[size=14]Development philosophy.[/size]

Native development.

Development in this SDK is mainly done in windows with Visual Studio using an emulation of the device. Once developed and refined the code uses the cross compiler and SDK provided by Jinke (Tools that run on Linux) to compile ultimately for the Hanlin.

The hello world program in this sdk is as native program:

Code:
Code:
//Include the sdk main include 
//This is all the code you make for a Helloword app. 
#include   "../sdk/EBookApp.h" 



IMPLEMENT_EBOOKAPP   //Include this macro in one cpp file to implement the main variables. 

//The hello world app is only a page object. 
class   HelloPage : public EBookApp 
{ 
public: 
//Every page (or control) has two abstract methods that must be overloaded. draw the page and onkey as key event handler. 
   void   draw(EBookPort *port) 
   { 
      port->begin(); 
      port->clear(ColorWhite); 
      port->setFont(50, TextStyleBold); 
      port->drawString(50, 350, "Hello world!", ColorBlack); 
      port->end(); 
   } 
   void   onkey(EBookPort *port, int code) 
   { 
      if (code == KEY_BACK) 
         port->terminate(); 
   } 
}; 

//The main page object. 
static   HelloPage   page; 

//The startup application. In this case do nothing because the app is a static object. 
void      ebookMain(EBookPort *port, int language, std::vector<std::string> &params) 
{ 
} 

//Return the current application 
EBookApp   *ebookApp() { return &page; } 

//Terminate and cleanup application. In this case nothing 
void      ebookTerminate() {}
Includes virtual planetarium sources Leo's Void and Leo's Wikipedia Reader as an example of serious develop.

Ebookscript Development

The development is done in Windows in the simulator to interpret and only needs to load in the Hanlin program source code and the interpreter of ebookscript own.

The language has built sqlite SQL server and is able to control applications using linux inlet and outlet pipes (This is how the shell is controlled and gnuchess).

The hello world program in script is:

Code:
Code:
//Include USPL constants and other stuff 
import   "const.uspl"; 
//Include the debugger. 
import  "debugger.uspl"; 

//The hello world program in EBookScript 
public class Hello extends Page 
{ 
//Draw handler. Every page draw must do a port.begin and port.end. 
   public function draw(port) 
   { 
      port.begin(); 
      port.clear(Const.Color.White); 
      port.setFont(50, Const.TextStyle.Bold); 
      port.drawString(50, 350, "Hello world!", Const.Color.Black); 
      port.end(); 
   } 
//Key handler. If the key is back then terminate. 
   public function onkey(port, code) 
   { 
      switch (code) 
      { 
      case Const.Key.Back: 
         port.terminate(); 
         break; 
//The intro key calls the debugger. The debugger is also invocated in error condition. 
      case Const.Key.Intro: 
         EReader.debugger("hello world!"); 
         break; 
      } 
   } 
/* 
   Main entry point. A static function named main on any class. Notice: every static member 
   main is executed on startup  but is not guaranteed the order execution of these functions. 
   It is highly recomended to define only one main entry point. 
*/ 
   public static function main(args) 
   { 
      EReader.push(new Hello()); 
   } 
}
Hybrid Development

ebookscript has ability to call native functions in shared libraries or dlls. The library can be scheduled to compile as dll and a shared library. An example can be seen in the example of sudoku, in which the solution and generation of Sudoku is done in C and other scripting language.

The language has a number of examples that are in turn useful applications. If all you're interested only in run samples download this file:

ebookscript_hanlin_binaries_1_0.zip

This file contains everything needed to test the examples including a dictionary and a map of Madrid. Extract the folder to a SD and run leoscript.exe

Examples are:

A Chess built as a frontend of gnuchess (It includes a compilation of chess)




A caculator and other programming samples

There is lack of documentation.

Last edited by Nate the great; 01-12-2010 at 08:13 AM.
leobueno is offline   Reply With Quote
Old 01-12-2010, 08:44 AM   #2
keng2000
Researcher and Consultant
keng2000 has a complete set of Star Wars action figures.keng2000 has a complete set of Star Wars action figures.keng2000 has a complete set of Star Wars action figures.keng2000 has a complete set of Star Wars action figures.
 
Posts: 210
Karma: 364
Join Date: Nov 2008
Location: Bangkok, THAILAND
Device: MACBOOKPRO17" HP2400TX SONYUX27
We salute you, LEO....
keng2000 is offline   Reply With Quote
Old 01-12-2010, 11:13 AM   #3
nrapallo
GuteBook/Mobi2IMP Creator
nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.
 
nrapallo's Avatar
 
Posts: 2,958
Karma: 2530531
Join Date: Dec 2007
Location: Toronto, Canada
Device: REB1200 EBW1150 Device: T1 NSTG iLiad_v2 NC Device: Asus_TF Next1 WPDN
Quote:
Originally Posted by leobueno View Post
There is lack of documentation.
And THAT'S the hardest part of programming....

I applaud your efforts and willingness to share your great talent!
nrapallo is offline   Reply With Quote
Old 01-12-2010, 11:15 AM   #4
Faenad
Ad astra per aspera
Faenad will become famous soon enoughFaenad will become famous soon enoughFaenad will become famous soon enoughFaenad will become famous soon enoughFaenad will become famous soon enoughFaenad will become famous soon enoughFaenad will become famous soon enough
 
Faenad's Avatar
 
Posts: 347
Karma: 724
Join Date: Aug 2008
Location: Mexico
Device: PRS-505, PRS-300 & HTC HD2
seems great new for V3 owners, but why put the whole post, including the code, on the front page? A small abstract + a link to this post would have been enough
Faenad is offline   Reply With Quote
Old 01-12-2010, 11:19 AM   #5
Nate the great
Sir Penguin of Edinburgh
Nate the great ought to be getting tired of karma fortunes by now.Nate the great ought to be getting tired of karma fortunes by now.Nate the great ought to be getting tired of karma fortunes by now.Nate the great ought to be getting tired of karma fortunes by now.Nate the great ought to be getting tired of karma fortunes by now.Nate the great ought to be getting tired of karma fortunes by now.Nate the great ought to be getting tired of karma fortunes by now.Nate the great ought to be getting tired of karma fortunes by now.Nate the great ought to be getting tired of karma fortunes by now.Nate the great ought to be getting tired of karma fortunes by now.Nate the great ought to be getting tired of karma fortunes by now.
 
Nate the great's Avatar
 
Posts: 10,367
Karma: 3161371
Join Date: Apr 2007
Location: DC Metro area
Device: Shake a stick plus 1
Quote:
Originally Posted by Faenad View Post
seems great new for V3 owners, but why put the whole post, including the code, on the front page? A small abstract + a link to this post would have been enough
It seemed like a good idea at the time.
Nate the great is offline   Reply With Quote
Old 01-12-2010, 11:20 AM   #6
jswinden
Astrophotographer
jswinden ought to be getting tired of karma fortunes by now.jswinden ought to be getting tired of karma fortunes by now.jswinden ought to be getting tired of karma fortunes by now.jswinden ought to be getting tired of karma fortunes by now.jswinden ought to be getting tired of karma fortunes by now.jswinden ought to be getting tired of karma fortunes by now.jswinden ought to be getting tired of karma fortunes by now.jswinden ought to be getting tired of karma fortunes by now.jswinden ought to be getting tired of karma fortunes by now.jswinden ought to be getting tired of karma fortunes by now.jswinden ought to be getting tired of karma fortunes by now.
 
jswinden's Avatar
 
Posts: 5,214
Karma: 5637420
Join Date: Sep 2006
Location: USA
Device: iPad Mini 2, iPhone 5, Nexus 7.2
Quote:
Originally Posted by Faenad View Post
seems great new for V3 owners, but why put the whole post, including the code, on the front page? A small abstract + a link to this post would have been enough
I agree! This is not the kind of posting that should dominate the front page. Way too long and way too uninteresting for most readers.
jswinden is offline   Reply With Quote
Old 01-12-2010, 11:48 AM   #7
nrapallo
GuteBook/Mobi2IMP Creator
nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.
 
nrapallo's Avatar
 
Posts: 2,958
Karma: 2530531
Join Date: Dec 2007
Location: Toronto, Canada
Device: REB1200 EBW1150 Device: T1 NSTG iLiad_v2 NC Device: Asus_TF Next1 WPDN
Quote:
Originally Posted by Nate the great View Post
It seemed like a good idea at the time.
I think eBook Developers need this kind of exposure and am glad it made Front Page News.

I do agree, though, that (unedited) it's a bit awkward for a Front Page post, but then again editing it to use spoiler tags to hide the code and images would detract from the original poster's enthusiasm. That's my take on this as a pseudo-developer.
nrapallo is offline   Reply With Quote
Old 01-12-2010, 02:19 PM   #8
Lbooker
Addict
Lbooker ought to be getting tired of karma fortunes by now.Lbooker ought to be getting tired of karma fortunes by now.Lbooker ought to be getting tired of karma fortunes by now.Lbooker ought to be getting tired of karma fortunes by now.Lbooker ought to be getting tired of karma fortunes by now.Lbooker ought to be getting tired of karma fortunes by now.Lbooker ought to be getting tired of karma fortunes by now.Lbooker ought to be getting tired of karma fortunes by now.Lbooker ought to be getting tired of karma fortunes by now.Lbooker ought to be getting tired of karma fortunes by now.Lbooker ought to be getting tired of karma fortunes by now.
 
Posts: 297
Karma: 1021312
Join Date: Jun 2009
Device: Sony PRS-T1
Fantastic! Thank you for setting book readers free!
Lbooker is offline   Reply With Quote
Old 01-13-2010, 01:29 PM   #9
alekz
Junior Member
alekz began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Jan 2010
Device: Hanlin V3
Great job, Leo! Congrats!

I tried your SDK, looks like the applications are implemented via file parsers plugins for the 'viewer' application?
There is a way to install plugins via a special .lib or .libs folder on a flash disk, so script applications can be installed
as a plugin to run .uspl files from the 'bookshelf' application without the need for .exe.fb2 approach. It is also possible to embed scripts parser into the firmware.

I tried writing programs as standalone applications for the Hanlin V3 using a mix of V2 SDK, V3 SDK and OpeninkPot tools, but created only a simple program.
There is now Java VM in the latest firmware from Jinke, but again no SDK.
Plan to write some USPL scripts

Everyone who is interested in software for e-Readers is welcome at my web-site: http://eink-apps.com/
(suggestions and comments are welcome )

Last edited by alekz; 01-13-2010 at 01:31 PM.
alekz is offline   Reply With Quote
Old 01-13-2010, 01:58 PM   #10
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 35,985
Karma: 17083916
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Sony Reader PRS-650, iPad, nook STR
Quote:
Originally Posted by Nate the great View Post
It seemed like a good idea at the time.
So why not remove the mess and then clean it up? You know you can do it.
JSWolf is offline   Reply With Quote
Old 01-13-2010, 08:10 PM   #11
LARdT
The LARdT of E-Books
LARdT began at the beginning.
 
LARdT's Avatar
 
Posts: 106
Karma: 46
Join Date: Dec 2009
Device: HANLIN V3ext (Papyre 6.1)
Leo, I've tried to load the example package and it does not work.

Is there something I've to check or any firmware requirements?
LARdT is offline   Reply With Quote
Old 01-14-2010, 07:17 AM   #12
alekz
Junior Member
alekz began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Jan 2010
Device: Hanlin V3
Quote:
Originally Posted by LARdT View Post
Leo, I've tried to load the example package and it does not work.

Is there something I've to check or any firmware requirements?
Just put leoscript.exe.fb2 from bin/arm to ebookscript/workdir and it will work (probably the program looks for scripts only in the same folder).
alekz is offline   Reply With Quote
Old 01-14-2010, 09:07 AM   #13
LARdT
The LARdT of E-Books
LARdT began at the beginning.
 
LARdT's Avatar
 
Posts: 106
Karma: 46
Join Date: Dec 2009
Device: HANLIN V3ext (Papyre 6.1)
Quote:
Originally Posted by alekz View Post
Just put leoscript.exe.fb2 from bin/arm to ebookscript/workdir and it will work (probably the program looks for scripts only in the same folder).

Well, this is how files are:
Code:
          SD:\
              └───script
                             └──autorun.uspl
                                     calculator.uspl
                                     chess.uspl
                                     config.cnf
                                          ...
                                     leoscript.exe.fb2
                                          ...
                                      Trace.log
LARdT is offline   Reply With Quote
Old 02-17-2010, 06:50 AM   #14
leobueno
Junior Member
leobueno has learned how to read e-booksleobueno has learned how to read e-booksleobueno has learned how to read e-booksleobueno has learned how to read e-booksleobueno has learned how to read e-booksleobueno has learned how to read e-booksleobueno has learned how to read e-books
 
Posts: 5
Karma: 770
Join Date: Oct 2009
Device: hanlin
I just upload new version of all executables on sourceforge.

The source is uploaded also.

This new version 2.0 add the features:

There is two kernels of linux. The Old abi (Application Binary Interface) and new abi (gnueabi).

Tirwal, and others firmwares are Old ABI and TIGOR and BUGGINS are GNUEABI

These kernels are not compatible and the binary executable is different.
The dumb rule is: one executable works and the other don't work. Take the good one and delete the other.

The exit to bookshelf is fixed and now is possible run a program, exit and continue working.

Installation is easy. Just extract the zip folder on the root of a SD card and use Bookshelf to navigate. Then select gnueabi_*.exe.fb2 and if this don't work then the *.exe.fb2 must work.

Thank you and sorry for any inconvenience.


https://sourceforge.net/projects/ebooksdk/
leobueno is offline   Reply With Quote
Old 02-20-2010, 03:02 PM   #15
wiffel
Member
wiffel is on a distinguished road
 
Posts: 19
Karma: 72
Join Date: Dec 2008
Device: bebook
Leo,

I did try to build 'hello.exe.fb2' from the SDK and that works OK. When I run it on my BeBook, it works OK. But it keeps on showing the 'rotating arrows' from FBReader while the application is running, which is quite anoying.

Do you have the same behaviour ? Or do you use some other firmware ?
wiffel 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
Leo's Wikipedia Reader for Hanlin leobueno HanLin eBook 28 02-08-2010 12:33 PM
iPhone SDK guide Ebook? rock Reading Recommendations 0 01-28-2010 05:17 PM
Leo's Void for Hanlin leobueno HanLin eBook 9 10-28-2009 08:46 AM
The most open-sourced ebook-reader (SDK+extras)? plisken Which one should I buy? 3 09-18-2009 11:23 AM
Hanlin SDK mrdini HanLin eBook 11 04-12-2009 06:12 AM


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


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