Embedded

Book shelf - Embedded

this book shelf app contains the multiple kwik projects inside. The lua files of each project are embedded in the master app but the assets such as images, audio files of each book are not embedded.They are downloadable from http server. Due to Apple’s regulation, Solar2D does not allow to load the lua files (programming codes) via Internet. The lua files must be embedded in the app but the other assets can be retrieved from http server.

The master app controls which book to be loaded with In App Purchase. Each book project can be built as a single standalone project.

When you like to add new books, you need to update the master app as well to include the new lua files of the new books.

You can create each book as a normal Kwik project but this embedded version is not appropriate the master app to hold hundreds of books.

For Each book project or TOC project, Ultimate configuration of Kwik4 is default. New Universal or other configuration of Kwik3 are not supported.


Sample file

Please download the sample project from here. The sample contains KwikShelf plugin

Please put them into ~/Documents/Kwik folder. BookShelfEmbedded is the master app to control BookTOC, Book01 and Book02.. and you find copy_books script that archive assets.zip in BookServer. BookTOC project offers the thumbnail page and the information page of Books.


Bookshelf Embedded project

this project is not a normal Kwik project. You need a text editor to edit main.lua. All you have to do is just to write the one line of code. App folders contains the build4 files from BookTOC, Book01 and Book04. You can use copy.bat(WIN) or copy.command(MAC) in BookServer to copy them.

    ├─App
    │  ├─book01
    │  ├─book02
    │  └─TOC
    ├─extlib
    ├─lib
    └─plugin
        └─kwikshelf

    build.settings
    config.lua
    main.lua
    copy.command
    copy.bat

main.lua is just one line to load “TOC” of App

require("plugin.KwikShelf").start("TOC", 1)

BookTOC project

page1 - Shelf shows the thumbnail of books and the buttons for purchase and download

page2 - INFO shows a book image and the IAP buttons and information text


Book01 project

page1 - Title. this title - bg.png will be displayed in the thumbnail view of the TOC in Book shelf master

the build4 folders are copied as App/book01 and App/book02 of Bookshelf Embedded project folder


Book02 project

page1 - Title. this title - bg.png will be displayed in the thumbnail view of the TOC in Book shelf master

the build4 folders are copied as App/book02 of Bookshelf Embedded project folder


BookServer

Please use the script to zip the image, audio files as zip files