Difference between revisions of "Creating Content Library applications"


From SamyGO
Jump to: navigation, search
(Introduction)
(Requirements)
Line 14: Line 14:
 
* TV-set with Content Library feature and accessible Game category (LE40B650 for example)
 
* TV-set with Content Library feature and accessible Game category (LE40B650 for example)
 
* PC with Ubuntu Linux on ~15GB HDD partition (advanced users can use other systems or other compiling toolchain environment)
 
* PC with Ubuntu Linux on ~15GB HDD partition (advanced users can use other systems or other compiling toolchain environment)
 +
* Text editor with UTF-8 encoding (''gedit'' for example, which is built-in many linux distributions, also in Ubuntu/Gnome)
 
* Basic knowledge of programming in C/C++ language and using GCC compiler
 
* Basic knowledge of programming in C/C++ language and using GCC compiler
 +
 +
 +
== How the application looks like ==
 +
 +
Every application (or Game) consist of at least one binary file (dynamically loaded library file with ''.so'' extension, ''helloword.so'' for example), one XML description file (''clmeta.dat'') and an icon (usually ''png'' graphics with relatively low resolution).
 +
 +
If you want to load your application without Content Library (using ''injectso'' method for example), you will need ''.so'' file(s) only.
 +
 +
Good practice is to place each application inside a directory called with application's name. For example, our ''HelloWord'' application's files could be:
 +
 +
HelloWord        <DIR>
 +
    clmeta.dat    <file>
 +
    helloword.png  <file>
 +
    helloword.so  <file>
 +
 +
where ''clmeta.dat'' file content is:
 +
 +
<?xml version="1.0" encoding="utf-8"?>
 +
<contentlibrary>
 +
  <contentpack id="'''HelloWord'''">
 +
    <category>Game</category>
 +
    <title language_id="English">'''HelloWord'''</title>
 +
    <startpoint language_id="English">./'''helloword.so'''</startpoint>
 +
    <thumbnailpath>./'''helloword.png'''</thumbnailpath>
 +
    <totalsize>1</totalsize>
 +
  </contentpack>
 +
</contentlibrary>
 +
 +
English language is set here. You can prepare different binary modules for different languages. In this example above English version will be used always, regardless on the menu language setting.
 +
 +
All editable text strings have been marked bold. Other entries should remain unchanged. Totalsize value seems to be not used by TV-set.
 +
 +
Note that main binary file (''helloword.so''), pointed in ''clmeta.dat'' file and loaded by Content Library is not a simple executable file. It is a dynamic library with ''Game_Main()'' function which is called first.
 +
 +
 +
== Preparing compiling toolchain environment ==
 +
 +
To be able to create binary file, you must have so-called compiling toolchain. In a simple words, it is a compiler for your source code. Its task is to convert source code text files of your application to the machine code binary files which could be run on TV's CPU.
  
  
Line 20: Line 59:
  
 
TO BE CONTINUED...
 
TO BE CONTINUED...
 +
 +
(PLEASE CORRECT MY ERRORS)
  
 
--[[User:Geo650|Geo650]] 18:58, 27 October 2011 (UTC)
 
--[[User:Geo650|Geo650]] 18:58, 27 October 2011 (UTC)

Revision as of 19:51, 27 October 2011

Introduction

In this section you will learn how to create simple hello-world application which can be run on your TV-set.

To simplify this description, we assume that we're creating an application for LE40B650T2W model. (Other model's owner can update this how-to later)

What is Content Library application?

This is a piece of software that may be run using Content Library feature. To run such application you can call Content Library using CONTENT button, then select Game category, and finally, execute selected application. An example of such application is "WiseStar" game provided by Samsung in their B650 TV-set.


Requirements

  • TV-set with Content Library feature and accessible Game category (LE40B650 for example)
  • PC with Ubuntu Linux on ~15GB HDD partition (advanced users can use other systems or other compiling toolchain environment)
  • Text editor with UTF-8 encoding (gedit for example, which is built-in many linux distributions, also in Ubuntu/Gnome)
  • Basic knowledge of programming in C/C++ language and using GCC compiler


How the application looks like

Every application (or Game) consist of at least one binary file (dynamically loaded library file with .so extension, helloword.so for example), one XML description file (clmeta.dat) and an icon (usually png graphics with relatively low resolution).

If you want to load your application without Content Library (using injectso method for example), you will need .so file(s) only.

Good practice is to place each application inside a directory called with application's name. For example, our HelloWord application's files could be:

HelloWord         <DIR>
   clmeta.dat     <file>
   helloword.png  <file>
   helloword.so   <file>

where clmeta.dat file content is:

<?xml version="1.0" encoding="utf-8"?>
<contentlibrary>
  <contentpack id="HelloWord">
    <category>Game</category>
    <title language_id="English">HelloWord</title>
    <startpoint language_id="English">./helloword.so</startpoint>
    <thumbnailpath>./helloword.png</thumbnailpath>
    <totalsize>1</totalsize>
  </contentpack>
</contentlibrary>

English language is set here. You can prepare different binary modules for different languages. In this example above English version will be used always, regardless on the menu language setting.

All editable text strings have been marked bold. Other entries should remain unchanged. Totalsize value seems to be not used by TV-set.

Note that main binary file (helloword.so), pointed in clmeta.dat file and loaded by Content Library is not a simple executable file. It is a dynamic library with Game_Main() function which is called first.


Preparing compiling toolchain environment

To be able to create binary file, you must have so-called compiling toolchain. In a simple words, it is a compiler for your source code. Its task is to convert source code text files of your application to the machine code binary files which could be run on TV's CPU.


TO BE CONTINUED...

(PLEASE CORRECT MY ERRORS)

--Geo650 18:58, 27 October 2011 (UTC)