Este documento fornece um resumo sobre Java ME e MSA para smartphones Nokia. Ele discute brevemente sobre mobilidade, convergência e plataformas móveis antes de introduzir Java ME, JTWI, MSA, JSR-248, JSR-249 e a plataforma Nokia S60. O palestrante também discute suas credenciais e ferramentas de desenvolvimento Java ME.
1. Java para S60 – Java ME e MSA para
Smartphones Nokia
MGJUG - Junho de 2009
Juarez Junior - Arquiteto / Desenvolvedor de Software
2. Palestrante
• Juarez Barbosa Junior
– Arquiteto / Desenvolvedor Java
– SCMAD - Sun Certified Mobile Application
Developer
– Forum Nokia Champion - 2006~2009
– Membro do Nokia Developer Advisory Council
– Um dos coordenadores do MGJUG
juarez.barbosa@gmail.com
3. Agenda
• Mobilidade
• Convergência
• Plataformas Móveis
• Java ME
• JTWI – MSA – MSA 2
• JSR-248 - MSA for CLDC
• JSR-249 - MSA for CDC
• Nokia S60 Platform
• Java ME para Nokia S60
5. Convergência
• Tudo-em-um (All-in-one)
– Câmera Fotográfica (8.0 GSM, 12.0 WCDMA)
– MP3 Player
– Telefone
– Rádio FM / Mobile TV (DVB-H)
– 1st Class Web Browsers
– Email
– Mensagens SMS / MMS / SIP
– Organizador Pessoal
– Conectividade
6. Plataformas Mobile
• Symbian Platform – S60 / UIQ – Symbian C++
– http://www.symbian.com/
– http://www.s60.com/life
– http://www.uiq.com/
• Qualcomm BREW – C, C++, (Java?)
– http://brew.qualcomm.com/brew/en/
• Microsoft Windows Mobile - .NET Mobile
– http://www.microsoft.com/windowsmobile/default.mspx
• NTT FOMA – JME – iAppli, iMode, DoJA
– http://www.doja-developer.net/
7. Plataformas Mobile
• RIM BlackBerry – JME
– http://www.blackberry.com/developers/index.shtml
• Pocket PC, PalmOS – JME
– http://www.vikdavid.com/mobile/
• (Vendor) Mobile Linux, OSDL, LiMo – C, C++
– http://www.osdl.org/lab_activities/mobile_linux
• Java ME – Java Platform
– http://java.sun.com/javame/
8. Java ME – Histórico inicial
• 1999
– Junho - Release da versão EA da KVM para PalmOS durante o
JavaOne
• 2000
– Maio - CLDC 1.0 (JSR 30) spec e RI liberadas incluindo a KVM
– • Junho - MIDP 1.0 (JSR 37) liberada para public review,
implementação EA 1
– • Verão - LG Telecom executa o primeiro deploy J2ME no mundo
(Korea)
– • Setembro - Spec MIDP 1.0, RI liberada, proposta para a Java
APIs for Bluetooth (JSR 82)
– • Novembro – Nokia anuncia primeiro handset com Java, o
Nokia 9210 (PersonalJava+JavaPhone API built-in, MIDP como
add-on)
9. Java ME – Histórico inicial
• 2001
– • Janeiro - NTT DoCoMo disponibiliza o iAppli (baseado no
CLDC) no Japão
– • Fevereiro - CLDC RI 1.0.2 liberada (melhorias KVM);
– • Abril - MIDP 2.0 (JSR 118) e Wireless Messaging API (JSR 120)
– propostas
– • Maio – Nextel é a primeira operadora a disponibilzar o J2ME
(com MIDP) nos EUA
– • Junho - Mobile Media API 1.0 (JSR 135) proposta
– • Julho - CLDC 1.1 (JSR 139) proposta
– • Novembro – Primeiro telefone Nokia Series 60 anunciado, o
Nokia 7650
10. Introdução ao JME
• JME – Java Micro Edition
– Plataforma de desenvolvimento de aplicações Java
para dispositivos móveis, wireless, micro-dispositivos,
embedded devices
– MID – Mobile Information Device - MIDlets
– IM – Information Module - IMlets
– MIDlets – aplicações que executam nos MIDs
– IMlets – aplicações que executam nos IMs
– http://java.sun.com/javame/
11. Introdução ao JME
• Sistemas Operacionais
– Vendor OS - Nokia OS, Motorola OS - closed
– Symbian OS - (S60/UIQ/MOAP) - open
– Mobile Linux – LiMO, OSDL, Qtopia – open or closed
• Java VMs
– Kilobyte Virtual Machine
– CLDC HI - Hotspot Implementation
– Dalvik (Android)
12. Introdução ao JME
• Configurations
– Configuração mínima englobando classes,
características da JVM, conectividade e GUI, conforme
categoria do dispositivo
– CDC – Connected Device Configuration
– CLDC – Connected Limited Device Configuration
• Profiles
– No topo das configurações, APIs específicas conforme
perfil de uma categoria de dispositivos
– MIDP - Mobile Information Device Profile
– IMP - Information Module Profile
13. Arquitetura JME – Software Stack
• Configurations, Profiles, Optional Packs, OEM
APIs (específicas do fabricante), APIs nativas
(podem ser open, dependendo do SO)
14. Introdução ao JME
• Optional Packages
– Pacotes de extensão provendo APIs específicas endereçando
vários aspectos – pode ter várias APIS e implementar todas ou
algumas
• Segurança, JavaCard
• WebServices
• SIP – Session Initiation Protocol
• Bluetooth
• MMS – Multimedia Messaging System
• SMS – Short Messaging System
• 3D – Mobile 3D API
• PIM
• FileConnection (filesystems)
• Sensors
• I18N - Internationalization
15. Introdução ao JME
• Configurations, Profiles, Opt Packs, seus MIDlets
– Configuração mínima englobando classes,
características da JVM, conectividade e GUI, conforme
categoria do dispositiv
• Nokia OS ou Symbian OS
• CLDC 1.0 ou 1.1
• MIDP 2.0
• JSR-75, JSR-82, JSR-135, JSR-179
• JSR-180, etc.
• MIDlets do desenvolvedor
16. Introdução ao JME
• JME Software Stack
– Configurations: CLDC 1.0, 1.1, CDC 1.0, CDC 1.1
– Profiles: MIDP 1.0, MIDP 1.1, IMP 1.0, IMP-NG, FP,
PP, PBP
– Optional Packs: Bluetooth (JSR-82), MMAPI (JSR-
135), WMA (JSRS 120 e 205), WebServices (JSR-
172), 3D-M3G (JSR-184), PIM and FileConnection
(JSR-75), Location API (JSR-179), Mobile
Internationalization API (JSR-238), SIP API for JME
(JSR-180), SATSA (JSR-177), S2DVG (JSR-226),
AMMS (JSR-234), MIA (JSR-238), outros
– JTWI (JSR-185), MSA for CLDC (JSR-248)
17. Introdução ao JME
• MIDlet Suites
– JAR (Java Application Archive) e JAD (Java
Application Descriptor)
– O MIDlet suite engloba:
• MIDlets, classes secundárias
• Recursos (imagens, icones, sons, arquivos
• Arquivo manifest.MF
• Arquivo JAD com informações para o AMS / JAM
19. Ferramentas
• NetBeans
– Excelente, fácil instalação, fácil integração, composição GUI
http://www.netbeans.org/index.html
• Eclipse + EclipseME Plugin
– Razoável, fácil instalação, fácil integração, sem composição GUI
– http://eclipseme.org/
• RIM JDE
– http://www.blackberry.com/developers/downloads/jde/index.
shtml
• MTJ – Projeto liderado pela Nokia – (CLDC+MIDP)
– http://www.eclipse.org/dsdp/mtj/
20. NOKIA Developer Tools
• Series 40 Platform SDKs
– Emulator dos devices Series 40
– Mesma implementação dos devices para as APIs Java
– Múltiplas instâncias e suporte a conectividade
– Agiliza diagnóstico e antecipa problemas
– Feature phones
• S60 Platform SDKs, for Java
– Emulator dos devices MIDP Series 60
– Mesma implementação dos devices para as APIs Java
– Smartphones
21. SCMAD
• SCMAD - Sun Certified Mobile Application Developer
– Section 1: JTWI (JSR 185) and Overview of JTWI-Compliant Wireless
Applications
– Section 2: CLDC 1.0 and 1.1
– Section 3: Security (Both CLDC and MIDP)
– Section 4: Networking
– Section 5: Application Model, Delivery, Lifecycle, and Provisioning
– Section 6: MIDP Persistent Storage
– Section 7: Push Registry
– Section 8: MIDP User Interface (UI) API
– Section 9: MIDP Game API
– Section 10: Media Using MIDP 2.0 and the MMAPI 1.1
– Section 11: Wireless Messaging API 1.1
– http://www.sun.com/training/catalog/courses/CX-310-110.xml
22. SCMAD
• SCMAD - Sun Certified Mobile Application Developer
– JSR 185 - Java Technology for the Wireless Industry (JTWI)
– JSR 30 - Connected Limited Device Configuration (CLDC) 1.0
– JSR 139 - Connected Limited Device Configuration (CLDC) 1.1
– JSR 118 - Mobile Information Device Profile 2.0 (MIDP). MIDP
2.0 superceded MIDP 1.0
– JSR 120 - Wireless Messaging API(WMA) 1.1
– JSR 135 - Mobile Media API (MMAPI) 1.1
• Mobile JSRs – JCP
– http://jcp.org/en/jsr/tech?listBy=1&listByType=platform
23.
24. JTWI
• JTWI (JSR-185) – Java Technology for The
Wireless Industry
– Primeira tentativa – umbrella specification
– Reduzir fragmentação
– Melhorar a compatibilidade e interoperabilidade
– Esclarecer pontos obscuros de algumas JSRs
– Obrigatórias: MIDP 2.0 e WMA 1.1
– Opcionais: MMAPI 1.1
– Configurations: CLDC 1.0, CLDC 1.1
25. MSA
• MSA – Mobile Service Architecture
– JSR-248 - Mobile Service Architecture (CLDC)
– JSR-249 - Mobile Service Architecture 2 (CDC)
– JSR-248 -
http://www.jcp.org/en/jsr/summary?id=248
– JSR-249 -
http://www.jcp.org/en/jsr/summary?id=249
26. MSA
Objetivos alinhados:
Segunda tentativa – reduzir fragmentação
Melhorar interoperabilidade
Next generation Java umbrella specification
Dividida em:
• MSA2 Limited – alinhada com JSR-185
• MSA2 Subset – alinhada com MSA Subset
• MSA2 Full – alinhada com MSA Full
28. MSA 2
– MSA Subset
• MIDP 2.0
• CLDC 1.1
• FileConnection & PIM API (JSR 75), also known as
PDA Optional Packages
• Bluetooth API (JSR 82)
• Mobile Media API (MMAPI) (JSR 135)
• Wireless Messaging API (WMA) (JSR 120)
• Scalable 2D Vector Graphics API (SVG API) (JSR
226)
29. MSA 2
– MSA Full
• Security and Trust Services API (SATSA) (JSR 177)
• Web Services API (JSR 172)
• Location API (JSR 179)
• SIP API (JSR 180)
• Mobile Internationalization API (JSR 238)
• Content Handler API (JSR 211)
• Payment API (JSR 229)
• Advanced Multimedia Supplements (JSR 234)
30. MSA 2
– MSA Full
• Security and Trust Services API (SATSA) (JSR 177)
• Web Services API (JSR 172)
• Location API (JSR 179)
• SIP API (JSR 180)
• Mobile Internationalization API (JSR 238)
• Content Handler API (JSR 211)
• Payment API (JSR 229)
• Advanced Multimedia Supplements (JSR 234)
31. Nokia S60 Platform
– Baseada no sistema operacional Symbian
• Symbian OS 9.5
• Platform Security
• Touch UI
• Symbian OS, Symbian C++, Tool Chain
• Diversos Runtimes – WRT, Python, Perl, BASIC,
Open C, Open C++, Symbian C++, Flash Lite,
.NET
• Java ME!!! :-D
– JRT 1.3, JRT 1.4
32. Symbian Foundation
– 2008: Nokia adquire todas as ações da
Symbian
• Unifica UIQ, MOAP, S60
• Nasce a Symbian Foundation
• www.symbian.org
• Open Source (ameaça Android, Mobile
Linux)
• Primeiro release em Q3 - 2009
33. Java ME para S60
– Suporte para interfaces touch
• Touch UI and Tactile Feedback
– MSA 2 (Full)
– eSWT
– Sensors Framework (JSR-256)
– Novos atributos JAD / System Properties
– IAP Info API
34. Java ME para S60
– Touch UI e Tactile Feedback
– Apresentar as capacidades de interfaces touch
e como elas afetam as novas aplicações Java
ME
– Aspectos de hardware e do dispositivo
– Touch UI – paradigma
– Como a Touch UI afeta as APIs Java
35. Java ME para S60
– Touch UI dá mais liberdade na interação
• 1 ou 2 mãos
• Usabilidade
– As interações baseadas em toque devem ser
analisadas e consideradas no início do
desenvolvimento
36. Java ME para S60
– Conceitos – pointing device
• Stylus touch
• Finger touch
37. Java ME para S60
– Dispositivos e Métodos (Input Methods)
– ITU-T + joystick
– Full keyboard (QWERTY)
– Sem teclas, ou poucas teclas → Touch UI
38. Java ME para S60
– Touch screen - Hardware
– Resistivo (melhor para stylus)
– Capacitivo (melhor para dedos)
– Multi-touch (duas abordagens, entretanto requer hardware
mais avançado)
39. Java ME para S60
– Interação: entrada de texto
– Handwriting recognition
– (HWR)
– Virtual keyboards
– Finger keyboards
40. Suporte para Touch UI nas APIs Java
– MIDP LCDUI
– High-level
• Os componentes da LCDUI já tem por default o
suporte a touch
– Low-level
• Canvas methods
protected void pointerPressed(int x, int y)
protected void pointerReleased(int x, int y)
protected void pointerDragged(int x, int y)
public boolean hasPointerEvents()
public boolean hasPointerMotionEvents()
41. Suporte para Touch UI nas APIs Java
MIDP LCDUI
– CustomItem
• Mesmos métodos que Canvas
• protected final int getInteractionModes() com
bits POINTER_PRESS, POINTER_RELEASE e
POINTER_DRAG
– GameCanvas
• FIRE, UP, DOWN, LEFT, RIGHT, GAME_A,
GAME_B,
• GAME_C, GAME_D
42. Suporte para Touch UI nas APIs Java
MIDP LCDUI
– GameCanvas
– Nokia-MIDlet-On-Screen-Keypad
43. JSR 256 - Mobile Sensor API
Sensors
– Acelerômetro
– Compass
– Proximidade
– etc
44. Muito Obrigado!!!
• Slides e dúvidas -
juarez.barbosa@gmail.com
• Agradecimentos
– UNI-BH – Diretor Bráulio
– Equipe MGJUG – Adriano, Daniel, João Vitor,
Vinicius, Fabiano
– Powerlogic – Paulo Justino
– Squadra – José Maria
– Sun Microsystems
– Participantes do MGJUG (vocês)!!!
45. Trademarks and Copyrights
• As marcas registradas (trademarks) e
direitos autorais (copyrights) para as
tecnologias são propriedade das
empresas apresentadas no tutorial –
Junho de 2009.