Join Now
Quality Rating:
  • Currently 5.0 / 5
(5.0 / 5 - 1 vote cast)
Expertise Level:
  • Currently 3.0 / 5
(3.0 / 5 - 1 vote cast)

This page was last modified 15:35, 2 April 2008.

Iniciando Desenvolvimento Maemo Usando C

From Forum Nokia Wiki

Original: Getting started with Maemo development using C

Contents

Iniciando o Desenvolvimento Maemo Usando C

Ferramentas

O Scratchbox que é uma ferramenta de complicação cruzada é necessária. Veja [www.scratchbox.org] para mais detalhes. Xephyr é necessário para executar o arcabouço de aplicação e aplicações GUI. Instale o Meamo SDK. Você vai precisar ter um Linux para instalar o SDK, Debian e Ubuntu são recomendados e Xephyr está incluída na maioria das distribuições Linux. Se você deseja instalar o SDK no Windows você precisa emular um ambiente Linux para trabalhar com o Maemo SDK. Para isso você precisa instalar e configurar o VMWARE player.

Criando uma aplicação Helloworld

Após ter instalado todos os pacotes se conecte no scratchbox e selecione o alvo x86 do SDK. Crie uma pasta no seu diretório home do scratchbox e vá para essa pasta. Agora crie o arquivo com o código fonte abaixo.

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 */
}

Further Reading

[[Escrevendo um Plug-in para Maemo]]

Related Discussions
Thread Thread Starter Forum Replies Last Post
n810 tablet: fm radio applicataion steveowens General Discussion 1 2008-06-23 21:35
Python on N91, 90, 70 imiten Python 2 2005-05-28 16:19
Looking for a platform for my application kazuma6666 Mobile Java General 2 2008-02-11 15:09
Does Nokia N800 has Java? mikeaf Mobile Java General 2 2007-01-11 12:42
Question about N810 Internet Tablet and S60 platform milu07 General Discussion 1 2008-04-11 20:52
 
Powered by MediaWiki
     
     RDF Facets:
     
     
     qfnZtypeQUqfnTypeZCommunityContentQ
     qfnZtypeQUqfnTypeZWebpageQ
     qfnZtypeQUqfnTypeZWikiContentQ
     qmarsZlanguageQUxhttpE3aE2fE2fswE2enokiaE2ecomE2flanguageE2d1E2fenX