Marlon Luz ext-marlon.luz@nokia.com JavaME no mundo real: novas ferramentas Java para Série 40 da...

Post on 07-Apr-2016

219 views 2 download

Transcript of Marlon Luz ext-marlon.luz@nokia.com JavaME no mundo real: novas ferramentas Java para Série 40 da...

1

Marlon Luzext-marlon.luz@nokia.com

JavaME no mundo real: novas ferramentas Java para Série 40 da Nokia

2

OviLoja - Oportunidade global

175MAparelhos Symbian

C/ Qt & Web

500MAparelhos Série 40

C/ Java ME

+

Série 40

4

Série 40 – Mudança de paradigma - INokia C3 – Série 40QWERTYWi-FiAplicativosPlano de DadosE-mailJava ME MIDP 2.1

5

Série 40 – Mudança de paradigma - II

Nokia X3 -02Touch screenWi-FiAplicativosCâmera de 5mpxE-mailJava ME MIDP 2.1

6

On-Device Debugging for Series 40

7

On-Device Debugging for Series 40

• Acrescenta a habilidade de depurar aplicações diretamente no telefone

• Funciona em dispositivos com a versão Série 40 6th Edition e 6th Edition FP1

• Funciona com Eclipse e NetBeans

8

On-Device Debugging for Series 40

• Depurador completo, incluindo breakpoints e valor de variáveis

• Suporte de monitoramento a nível de usuário

• Aplicações anexadas ao depurador remotamente

• Sobre conexão IP ou Bluetooth• Debug em apenas um click na

IDE

9

Demo

On-Device Debugging for Series 40

10

Mapas no Série 40

11

Java ME Location API – Agora com Mapas

• Fornece acesso ao poderoso servidor Ovi Maps

• Funcionalidades incluídas:–Mapping– Searching– Routing

12

Java ME Location API – Agora com Mapas

• Licença de Desenvolvedor: 1000 requisições/IP em 24 hs

• Licença Registrada: 50000 requisições/IP em 24 hs (c/ ads)

• Licença Premium será anunciada em breve

13

Mostrando um Mapaimport com.nokia.maps.map.MapCanvas;

public class MapMIDlet extends MIDlet {

protected void startApp() throws MIDletStateChangeException {

Display display = Display.getDisplay(this); MapCanvas mapCanvas = new MapCanvas( display );

display.setCurrent(mapCanvas); }

protected void destroyApp(boolean unconditional) throws MIDletStateChangeException { }

protected void pauseApp() { }

}

14

Mostrando Objetos em um Mapa

// mapFactory comes from MapCanvas

MapFactory mapFactory = mapCanvas.getMapFactory();GeoCoordinate coord = new GeoCoordinate( 10, 10, 0 ); MapStandardMarker marker =

mapFactory.createStandardMarker(coord, 10, null );map.addMapObject( marker );

15

Fazendo uma Busca

// mapFactory comes from MapCanvas

SearchManager searchManager = SearchManager.getInstance();searchManager.geocode("Germany,Berlin", null );Location[] locations = searchManager.getLocations();

//loop through locations[] showing them on a map

MapFactory mapFactory = mapCanvas.getMapFactory();

for(int i=0; i < locations.length; i++) {MapStandardMarker marker = mapFactory.createStandardMarker(locations[i].getDisplayPosition(), 10, null );map.addMapObject( marker );

}

16

Criando Rotas// mapFactory comes from MapCanvas

SearchManager searchManager = SearchManager.getInstance();searchManager.geocode("Germany, Berlin", null );Location[] locations = searchManager.getLocations();

MapFactory mapFactory = mapCanvas.getMapFactory();

WaypointParameterList waypoints = new WaypointParameterList();

waypoints.addLocation(locations[0]);waypoints.addLocation(locations[1]);

RouteManager rm = RouteManager.getInstance();RoutingMode[] modes = { new RoutingMode() }; rm.calculateRoute(waypoints, modes);

17

Demo

Mapas no Série 40

18

Gestures API

19

Gestures API

• Gestos• Single Tap• Long Press• Long Press Repeated• Drag• Drop• Flick

20

Suporte a touch com Java ME

• Métodos de Canvasboolean Canvas.hasPointerMotionEvents()void pointerPressed(int x, int y)void pointerDragged(int x, int y)void pointerReleased(int x, int y)

21

Como usar a Gesture API – Passo 1

• Crie uma GestureInteractiveZone// Create a GestureInteractiveZone for all Gesture Types

GestureInteractiveZone giz = new GestureInteractiveZone( GestureInteractiveZone.GESTURE_ALL );

// set bounding rectangle of zone.giz.setRectangle( x, y, width, height);

22

Como usar a Gesture API – Passo 2

• Crie uma GestureListener// Define a GestureListenerClass GestureCanvas extends Canvas implements GestureListener

{protected void paint(Graphics g) { … }

public void gestureAction( Object container, GestureInteractiveZone zone, GestureEvent event) {...}

}

23

GestureAction em mais detalhes

public void gestureAction( Object container, GestureInteractiveZone zone, GestureEvent event) {

switch( event.getType() ) {case GestureInteractiveZone.GESTURE_TAP:...; break;case GestureInteractiveZone.GESTURE_LONG_PRESS:case GestureInteractiveZone.GESTURE_LONG_PRESS_REPEATED:case GestureInteractiveZone.GESTURE_DRAG:case GestureInteractiveZone.GESTURE_DROP:case GestureInteractiveZone.GESTURE_FLICK:}

}

24

Demo

Gestures API

25

Marlon Luzext-marlon.luz@nokia.com

Obrigado!!!