simplify this complex world

September 24, 2010

create “hello word” application in onyxboox

Filed under: Catatan Oprekan — effendisusanto @ 4:55 pm

“hello word” application, every programmer should always create this kind of application. For desktop application developer, create “hello word” application should be ‘piece of cake’, we can enjoy the sweetness of this ‘piece of cake’ in less then 5 minutes. but now I spend more then 1 day to create my “hello word” application in onyxboox-ebook reader environment. I dont want to lose this knowledge easily so I’ll write my documentation carefully.

Compiler Hardware : lenovo G400
Operating System    : Ubuntu 9.10
==================================

  • 1’st Step : Install compiler
    $ sudo apt-get install cmake build-essential
  • 2’nd Step : Install the toolchain
    $ cd /tmp
    $ wget http://dev.onyxcommunity.com/sdk/freescale-toolchain.tar.gz
    $ sudo mkdir -p /opt
    $ cd /opt && tar -xvzf /tmp/freescale-toolchain.tar.gz
  • 3’rd Step : Downloading example
    $ cd
    $ wget http://dev.onyxcommunity.com/sdk/quickstart.tar.gz
    $ tar -xvzf quickstart.tar.gz && cd quickstart
  • 4’th Step : fixing the bug on the source cmakelist file exampe
    $ vim  CMakeLists.txt
    Edit the –> set(ONYXLIBS…. parts from
    set(ONYXLIBS onyx_sys onyx_ui onyx_wifi onyx_wpa)
    to
    set(ONYXLIBS onyx_screen onyx_sys onyx_ui onyx_wifi onyx_wpa)
  • 5’th Step : edit the main program on this example
    $vim main.cpp
    ———————————————————————————
    #include <QtGui/QtGui>

    #include “onyx/screen/screen_proxy.h”
    #include “onyx/sys/sys.h”

    int main(int argc, char *argv[])
    {
    QApplication app(argc, argv);
    execl(“/bin/ls”,”ls”);
    QWidget window;
    window.setWindowTitle(“Simple example”);
    QLabel *label = new QLabel (“Hello World!”, &window);
    window.show();
    onyx::screen::ScreenProxy::instance().flush(&window, onyx::screen::ScreenProxy::GC, true,        onyx::screen::ScreenCommand::WAIT_NONE);
    // Tell system manager that it’s not busy now.
    sys::SysStatus::instance().setSystemBusy(false);
    return app.exec();
    }
    ——————————————————————————————————————-

  • 6’th Step : Create a simple executable bash file
    $ sudo mkdir output
    $ vim build.sh
    ———————————————————————————————–
    #!/bin/sh

    cd output
    rm -rf *

    cmake -DBUILD_FOR_ARM:BOOL=ON -DCMAKE_VERBOSE_MAKEFILE=ON ..
    make
    ———————————————————————————————-
    $ chmod +x build.sh

  • 7’th Step : build the application
    $ ./build.sh

Semestinya sich jalan kalo semua beres 😀

2 Comments »

  1. thanks this helped becoz im a n00b

    Comment by Swegger — June 5, 2014 @ 10:19 am | Reply


RSS feed for comments on this post. TrackBack URI

Leave a comment

Create a free website or blog at WordPress.com.