caelum day in rio
DESCRIPTION
TRANSCRIPT
O mundo de smartphones em suas mãos com Google Android
Quem são esses caras?
Daniel Passos
Arquiteto de Software
Instrutor
@passos
Fábio Pimentel
Instrutor
@fabiopimentel
?
Open Handset Alliance
X
Text
http://www.youtube.com/watch?v=ZwzXvRpoPP4
X
JSE1.5 1.5
Symbian
// HelloWorld.cpp//#include "CommonFramework.h"// do the exampleLOCAL_C void doExampleL(){_LIT(KHelloWorldText,"Hello world!\n");console->Printf(KHelloWorldText);}
// HelloWorld.mmp//// Copyright (c) 2000 Symbian Ltd. All rights reserved.//// using relative paths for sourcepath and user includes//TARGET HelloWorld.exeTARGETTYPE exeUID 0//SOURCEPATH .SOURCE HelloWorld.cpp//USERINCLUDE .USERINCLUDE ..\CommonFrameworkSYSTEMINCLUDE Epoc32include//
Windows Mobile
using System;using System.Windows.Forms;
public class HelloWorld {
public static void Main() {
MessageBox.Show( "Hello World!" );
}}
Objective C
// helloworldAppDelegate.h// helloworld
#import <UIKit/UIKit.h>
@class MyView;
@interface helloworldAppDelegate : NSObject { UIWindow *window; MyView *contentView; // Levi: Define textView object UITextView *textView;}
@property (nonatomic, retain) UIWindow *window;@property (nonatomic, retain) MyView *contentView;// Levi: Declare textView as a property@property (nonatomic, retain) UITextView *textView;
@end
// helloworldAppDelegate.m// helloworld
#import "helloworldAppDelegate.h"#import "MyView.h"
@implementation helloworldAppDelegate
@synthesize window;@synthesize contentView;// Levi: Tell the compiler to synthesize relevant accessors@synthesize textView;
- (void)applicationDidFinishLaunching:(UIApplication *)application { // Create window self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] self.contentView = [[[MyView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]] autorelease]; [window addSubview:contentView];
// self.textView = [[[UITextView alloc] initWithFrame: CGRectMake(0.0f, 0.0f, 320.0f, 480.0f)] autorelease]; [textView setEditable:YES]; [textView setText:@"Hello [contentView [window makeKeyAndVisible];}
- (void)dealloc { // Levi: Release the textView [textView release]; [contentView release]; [window release]; [super dealloc];}
@end
Android
package com.android.hello;
import android.app.Activity;import android.os.Bundle;import android.widget.TextView;
public class HelloAndroid extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); TextView tv = new TextView(this); tv.setText("Hello World"); setContentView(tv); }}
Legal! Mas como essa bagaça funciona?
!=
JSE1.5 1.5
JVM
Surface Manager
OpenGLAPI livre utilizada para desenvolvimento de aplicativos gráficos, ambientes 3D, jogos, entre outros.
http://www.youtube.com/watch?v=KtzTL3y4RTA
Media Framework
SQLite
‣ É Software Livre/domínio público e Multiplataforma‣ É um mecanismo de armazenamento seguro com
transações ACID‣ Implementa a maioria do SQL92‣ Suporta bases de dados acima de 2 terabytes‣ Sem dependências externas
WebKit
libc
#include <stdio.h>#include <unistd.h>int main(int argc, char **argv, char**env) { int i; for (i = 0; i < argc; i++) { printf("argv[%d] = %s\n", i, argv[i]); } for (i = 0; env[i] != NULL; i++) { printf("env[%d] = %s\n", i, env[i]); } printf("PATH = %s\n", getenv("PATH")); setenv("HELLO", "world!", 1); putenv("GOODBYE=cruel world!"); printf("HELLO = %s\n", getenv("HELLO")); printf("GOODBYE = %s\n", getenv("GOODBYE")); return 0;}
Activity
# Tela
# Independente
# Pode ser invocada por outra app
Activity
ActivityActivity starts
Activity running
onCreate()
onStart()
onResume()
ActivityReturn to app
Activity destroyed
Activity running
RecebeChamada
onPause()
onStop()
onStart()
onResume()
Pouca Memoria
onDestroy()
Content Provider
# Armazenar e recupera dados
# Consome dados de outras apps
# Expoem dados da sua aplicação
Broadcast receiver
# Responde as mensagens do sistema
Mas como eu faço pra programar?
1.023/09/2008
1.109/02/2009
Cupcake
1.530/04/2009
■ Widget■ Gravação de Video■ Gallery: Video playback (MPEG-4 & 3GP formats)■ Bluetooth: Suporte a Stereo (A2DP and AVRCP profiles),
Auto Pareamento■ Browser: Copy and paste■ Animações em trasições de tela■ Upload YouTube■ Upload Picasa
1.615/09/2009
Donut
■ Voice Search■ Android Market: Facilitaram a busca, screenshots, etc.■ Melhoria no acesso a câmera■ Display: Suporte a resolução WVGA
2.0/2.126/10/2009
Eclair
■ Sincronismo com multiplas contas, inclusive Exchange■ Bluetooth: 2.1■ Camera: Flash, zoom digital, Scene mode, White balance, Color
effect, Macro focus■ Browser: Double-tap zoom, Support for HTML5■ System: Otimização de Hardware■ Display: Suporte a novos tamanhos de tela■ Maps: Google Maps 3.1.2■ Live Wallpapers: Imagens animadas na Home screen
2.220/05/2010
Froyo
■ System: Otimização de memoria e performance■ Chrome's V8 JavaScript engine■ USB tethering & Wi-Fi hotspot■ Discagem por voz e compartilhamento de contatos através de
Bluetooth■ Adobe Flash support■ DPI screens (320 dpi), such as 4" 720p
2.3/2.3.306/12/2010
Gingerbread
■ Display: extra-large (WXGA)■ Suporte nativo a SIP VoIP■ Near Field Communication■ Media: WebM/VP8 & AAC audio encoding
■ Pensado e otimozado para tablets■ System Bar: acesso rápido às notificações, status, e botões de
navegação suave disponível na parte inferior da tela.■ Action Bar: Acesso a opções contextual, navegação, widgets, ou
outros tipos de conteúdo no topo da tela.■ Multitasking:■ Suporte a video chat com Google Talk■ Suporte a multiplos processadores de multiplos nucleos
3.026/02/2011
Honeycomb
■ Conectividade com acessórios por USB■ Suporte a teclados externos■ Suporte a joysticks & gamepads
3.110/05/2011
Honeycomb
??
Ice Cream Sandwich
http://developer.android.com/sdk/eclipse-adt.html
Android Development Tools (ADT)
*http://groups.google.com/group/android-developers/ (Oficial)
*http://groups.google.com/group/androidbrasil-dev
http://developer.android.com
E agora?
FJ-57 |Desenvolvimento móvel com Google Android
Obrigado!
Daniel Passos@passos
Fabio Pimentel@fabiopimentel