Getting started with Maemo 5

Home / Support / Tutorials / Getting Started / Getting started with Maemo 5

Required tools and SDKs

To get started, Download and install the Maemo SDK and follow the instructions. In this example we will also use ESBox as the IDE.

Set up a build environment

To create a new project using ESBox:
- Select File -> New -> Project from the menu.
- Select C++ project, then maemo 5 helloworld.
- Select the relevant targets.
- Fill out the other details where needed, then create the project.
in src/Makefile.am you will have to modify the LDADD and CXXFLAGS lines to look like the following for device targets:

Code (2 lines)
  1. appname_LDADD: $(LIBHILDONMM_LIBS) $(LIBOSSO_LIBS) -ledge -ledgerender -lconic -lXv -L /path/to/edgelib/dist/lib/maemo-5_dev/
  2. appname_CXXFLAGS = $(LIBHILDONMM_CFLAGS) $(LIBOSSO_CFLAGS) -DHELLOWORLD_LOCALEDIR=\"${HELLOWORLD_LOCALEDIR}\"  -D__MAEMO__ -I /path/to/edgelib/dist/include

and the following for simulator targets:

Code (2 lines)
  1. appname_LDADD: $(LIBHILDONMM_LIBS) $(LIBOSSO_LIBS) -ledge -ledgerender -lXv -L /path/to/edgelib/dist/lib/maemo-5_sim/
  2. appname_CXXFLAGS = $(LIBHILDONMM_CFLAGS) $(LIBOSSO_CFLAGS) -DHELLOWORLD_LOCALEDIR=\"${HELLOWORLD_LOCALEDIR}\"  -D__MAEMO__ -D__MAEMO_SIM__  -I /path/to/edgelib/dist/include

If you add or remove files, you will also have to update it in src/Makefile.am

Build a sample application

To turn the default helloworld in an EDGELIB application, remove mywindow.h and mywindow.cpp, and replace main.cpp with the following code:

main.cpp (76 lines)
  1. /////////////////////////////////////////////////////////////////////
  2. // Code/helloworld.cpp
  3. // One of the EDGELIB tutorial samples for Maemo
  4. //
  5. // Copyright (c) 2009-2017 Elements Interactive Mobile B.V.
  6. // http://www.edgelib.com
  7. //
  8. // Show "hello world" on the screen and exit by hitting a key
  9. /////////////////////////////////////////////////////////////////////
  10.  
  11. #include "config.h"
  12. #include "edgemain.h"
  13.  
  14. /////////////////////////////////////////////////////////////////////
  15. // Class definition                                                //
  16. /////////////////////////////////////////////////////////////////////
  17.  
  18. //The main class
  19. class ClassMain : public ClassEdge
  20. {
  21.     public:
  22.         ClassMain(void);
  23.         ~ClassMain(void);
  24.         ERESULT OnDisplayConfig(EDISPLAYCONFIG *config);
  25.         ERESULT OnNextFrame(ClassEDisplay *display, unsigned long timedelta);
  26.         void OnButtonDown(unsigned long bnr, EBUTTONLIST *blist);
  27.         void OnStylusDown(POINT pnt);
  28. };
  29.  
  30.  
  31. /////////////////////////////////////////////////////////////////////
  32. // ClassMain: public                                               //
  33. /////////////////////////////////////////////////////////////////////
  34.  
  35. //ClassMain: constructor
  36. ClassMain::ClassMain(void)
  37. {
  38. }
  39.  
  40. //ClassMain: destructor
  41. ClassMain::~ClassMain(void)
  42. {
  43. }
  44.  
  45. //Configure display
  46. ERESULT ClassMain::OnDisplayConfig(EDISPLAYCONFIG *config)
  47. {
  48.     ClassEStd::StrCpy(config->caption, "Hello World!");
  49.     return(E_OK);
  50. }
  51.  
  52. //Callback: Called every frame
  53. ERESULT ClassMain::OnNextFrame(ClassEDisplay *display, unsigned long timedelta)
  54. {
  55.     display->buffer.DrawFont(0, 0, &display->fontinternal, "Hello World!");
  56.     return(E_OK);
  57. }
  58.  
  59. //Callback: Called when the user pressed a key or button
  60. void ClassMain::OnButtonDown(unsigned long bnr, EBUTTONLIST *blist)
  61. {
  62.     Quit();
  63. }
  64.  
  65. //Callback: Called when the user points the stylus down or clicks the left mouse button
  66. void ClassMain::OnStylusDown(POINT pnt)
  67. {
  68.     Quit();
  69. }
  70.  
  71.  
  72. /////////////////////////////////////////////////////////////////////
  73. // The program entry point                                         //
  74. /////////////////////////////////////////////////////////////////////
  75.  
  76. ClassEdge *EdgeMain(EDGESTARTUP *data){ return(new ClassMain); }

Then update Makefile.am and remove the references to mywindow. After you save the files, the project will automatically build.

Latest forum posts