Join Now
Quality Rating:
  • Currently 0.0 / 5
(0.0 / 5 - 0 votes cast)
Expertise Level:
  • Currently 0.0 / 5
(0.0 / 5 - 0 votes cast)

This page was last modified 05:19, 12 December 2007.

Getting started with Maemo development using C

From Forum Nokia Wiki


Further Reading

Writing a Plug-in for Maemo

Getting started with Maemo development using C

Tools

Scratchbox which is a cross compilation tool is required. Check www.scratchbox.org for more details. Xephyr is required to launch the application framework and execute GUI applications. Install the Maemo SDK (( you need to have a Linux OS to install the SDK though Debian and Ubuntu are recommended and Xephyr is included in most of the Linux distributions). Also if you want to install SDK on your windows machine you have to emulate a Linux environment to be able to work with maemo SDK. For that pupose you need to set up the VMWARE player).

Creating a Helloworld application After you have installed all the packages log into the scratchbox then select the x86 SDK target. Create a folder in your scratchbox home directory and then move to that folder. Now create the file with the below source code

include <hildon/hildon-program.h>
#include <gtk/gtkmain.h>
#include <gtk/gtkbutton.h>
 
 
void button_pressed()
{
        int i = 0;
        int p=100/i;
        HildonProgram *program;
        g_print ("%s - %d","Hello World-",p);
        program = HILDON_PROGRAM(hildon_program_get_instance());
 
 
}
 
int main(int argc, char *argv[])
{
        /* Create needed variables */
        HildonProgram *program;
        HildonWindow *window;
        GtkWidget *button;
 
        /* Initialize the GTK. */
        gtk_init(&argc, &argv);
 
        /* Create the hildon program and setup the title */
        program = HILDON_PROGRAM(hildon_program_get_instance());
        g_set_application_name("Hello Wiki!");
 
        /* Create HildonWindow and set it to HildonProgram */
        window = HILDON_WINDOW(hildon_window_new());
        hildon_program_add_window(program, window);
 
        /* Create button and add it to main view */
        button = gtk_button_new_with_label("Hello!");
        gtk_container_add(GTK_CONTAINER(window), button);
 
        g_signal_connect(G_OBJECT(button),"pressed",G_CALLBACK(button_pressed),NULL);
 
        /* Connect signal to X in the upper corner */
        g_signal_connect(G_OBJECT(window), "delete_event",
                        G_CALLBACK(gtk_main_quit), NULL);
 
        /* Begin the main application */
        gtk_widget_show_all(GTK_WIDGET(window));
        gtk_main();
 
        /* Exit */
}
Related Discussions
Thread Thread Starter Forum Replies Last Post
Deployment malda01 Mobile Java Tools & SDKs 1 2002-07-07 20:32
Can not connect to SNAP Emulator gkvoelkl SNAP Mobile 2 2007-08-15 19:55
Develop time zone using netbeans zima85 Mobile Java General 1 2008-03-13 05:45
Nokia Development Kit for Bluetooth Applications janwec Bluetooth Technology 1 2002-11-05 10:17
On device debugging Danack Mobile Java Tools & SDKs 17 2008-05-27 18:58
 
Powered by MediaWiki
     
     RDF Facets:
     
     
     qfnZtopicQUqfnTopicZmaemoQ
     qfnZtypeQUqfnTypeZCommunityContentQ
     qfnZtypeQUqfnTypeZWebpageQ
     qfnZtypeQUqfnTypeZWikiContentQ
     qmarsZlanguageQUxhttpE3aE2fE2fswE2enokiaE2ecomE2flanguageE2d1E2fenX