You Are Here:

Community: Wiki

This page was last modified on 23 September 2009, at 06:27.

Getting started with Maemo development using C

From Forum Nokia Wiki

Reviewer Approved   

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 Wiki Articles

No related wiki articles found

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia 
RDF Facets: qdcZidentifierQSxhttpE3aE2fE2fwikiE2eforumE2enokiaE2ecomE2findeE78E2ephpE2fGettingE5fstartedE5fwithE5fMaemoE5fdevelopmentE5fusingE5fCX qdcZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qdcZtypeQUqfntypeZCommunityContentQ qdcZtypeQUqfntypeZE52esourceQ qdcZtypeQUqfntypeZWebpageQ qdcZtypeQUqfntypeZWikiContentQ qdcZtypeQUqmarsZManagedE52esourceQ qdcZtypeQUqwebZInformationE52esourceQ qdcZtypeQUqwebZPageQ qdcZtypeQUqwebZE52esourceQ qdcZtypeQUqrdfsZE52esourceQ qfnZtopicQUqfnTopicZmaemoQ qfnZtypeQUqfntypeZCommunityContentQ qfnZtypeQUqfntypeZE52esourceQ qfnZtypeQUqfntypeZWebpageQ qfnZtypeQUqfntypeZWikiContentQ qfnZuserE5ftagQSxmaemoX qmarsZlanguageQUxhttpE3aE2fE2fswE2enokiaE2ecomE2flanguageE2d1E2fenX qrdfZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qrdfZtypeQUqfntypeZCommunityContentQ qrdfZtypeQUqfntypeZE52esourceQ qrdfZtypeQUqfntypeZWebpageQ qrdfZtypeQUqfntypeZWikiContentQ qrdfZtypeQUqmarsZManagedE52esourceQ qrdfZtypeQUqwebZInformationE52esourceQ qrdfZtypeQUqwebZPageQ qrdfZtypeQUqwebZE52esourceQ qrdfZtypeQUqrdfsZE52esourceQ
RDF Facets: qfnZuserE5FtagQSxgtkX qfnZuserE5FtagQSxhildonX qfnZuserE5FtagQSxinternetX qfnZuserE5FtagQSxlinuE78X qfnZuserE5FtagQSxmaemoX