how to develop cool apps for nokia asha smartphones

42
Developing cool applications for Asha Touch smartphones 1 Michael Samarin, Director of Developer Training and Evangelism, Futurice

Upload: nokia-developer

Post on 12-Jan-2015

3.380 views

Category:

Technology


6 download

DESCRIPTION

This webinar presentation takes you through the features of the Series 40 platform for Asha smartphones, which enable the coolest apps to be developed. To start, the features of the UI based on either LCDUI or LWUIT for Java are reviewed. Then there is a discussion on how you port apps from Android — looking at the key issues you need to consider. The presentation then concludes by reviewing the options for 2D and 3D graphics, in particular how they help develop outstanding games. Numerous demonstrations are included, along with links to the source code and installation files, so you can try the apps yourself and use the code in your own apps. Join the next session: 4 April - 8 a.m. London; 12:30 p.m. New Delhi; 3 p.m. Singapore - http://forumnokia.adobeconnect.com/cool-asha-ssn2/event/event_info.html

TRANSCRIPT

Page 1: How to develop cool apps for Nokia Asha smartphones

Developing cool applications for Asha Touch smartphones

1 Michael Samarin, Director of Developer Training and Evangelism, Futurice

Page 2: How to develop cool apps for Nokia Asha smartphones

New look for LCDUI Components

2

Page 3: How to develop cool apps for Nokia Asha smartphones

3

LCDUI Displayable

Screen Canvas

With chrome Full screen Form List Alert Text box

Choice Group

Date Field

Text Field

Gauge

String Item

Image Item

Custom Item

Spacer

Implicit choice Exclusive choice Non-exclusive choice

Page 4: How to develop cool apps for Nokia Asha smartphones

Full Touch UI Status bar

Header bar

Action button 1

Main content area

Navigation bar

Back button Category bar

View title

Action button 2 (options)

» Screen › 240 x 400 px

› 3:5 aspect ratio

› Previous QVGA = 3:4

» New › Action buttons

› Category bar

› Back button

4 Michael Samarin, Director of Developer Training and Evangelism, Futurice

Page 5: How to develop cool apps for Nokia Asha smartphones

IconCommand Action button 1

Category bar

» Extends LCDUI Command class

› Adds: Icon

› Built-in system icon

› Own icon (unselected, [selected])

› Back button always has default icon

› Not possible to override!

5 Michael Samarin, Director of Developer Training and Evangelism, Futurice

Page 6: How to develop cool apps for Nokia Asha smartphones

CategoryBar

44 x 44 icon

» View switching › One element always highlighted

› Mandatory & automatic back button

» Icons › Max: 15 icons (+ back)

› Portrait: 4 visible, landscape: 6 visible

› Excess (> 15) icons not shown

› Size: 44 x 44 edge-to-edge. Make actual icon smaller!

6 Michael Samarin, Director of Developer Training and Evangelism, Futurice

Page 7: How to develop cool apps for Nokia Asha smartphones

Demo: Building Full Touch LCDUI

7 Michael Samarin, Director of Developer Training and Evangelism, Futurice

Page 8: How to develop cool apps for Nokia Asha smartphones

Series 40 UI Visualization

8 Michael Samarin, Director of Developer Training and Evangelism, Futurice

https://projects.developer.nokia.com/s40uivisualisation

Page 9: How to develop cool apps for Nokia Asha smartphones

Demo: Series 40 UI Visualization

9 Michael Samarin, Director of Developer Training and Evangelism, Futurice

Page 10: How to develop cool apps for Nokia Asha smartphones

LWUIT • Lightweight UI Toolkit - as read in LWUIT Developer Guide: “widget library inspired by

Swing but designed for constrained devices such as mobile phones and set-top boxes”.

• Comprehensive UI Library - rich set of easily customizable UI components, such as Lists, Table, Calendar etc.

• Pluggable and customizable look&feel with Themes.

• Transitions, animations, layout management

• Scalability and portability across platforms

• http://www.oracle.com/technetwork/java/javame/javamobile/download/lwuit/index.html

10 Michael Samarin, Director of Developer Training and Evangelism, Futurice

Page 11: How to develop cool apps for Nokia Asha smartphones

LWUIT for Series 40 • https://projects.developer.nokia.com/LWUIT_for_Series_40

• Changes and optimizations for Series 40:

• TextArea, TextField, List, Button, Form, new components

• MenuBar – softkeys behavior in full touch, touch & type, non touch

• Nokia UI Guestures, Themes

• Comprehensive developer’s guide and examples

• http://www.developer.nokia.com/Resources/Library/LWUIT

11 Michael Samarin, Director of Developer Training and Evangelism, Futurice

Page 12: How to develop cool apps for Nokia Asha smartphones

12 Michael Samarin, Director of Developer Training and Evangelism, Futurice

Page 13: How to develop cool apps for Nokia Asha smartphones

Demo: Simple LWUIT UI

13 Michael Samarin, Director of Developer Training and Evangelism, Futurice

Page 14: How to develop cool apps for Nokia Asha smartphones

14 Michael Samarin, Director of Developer Training and Evangelism, Futurice

LWUIT Examples Projects for Series 40

• LWUIT Slide Puzzle:

• https://projects.developer.nokia.com/LWUIT_Puzzle

• LWUIT Tourist Attractions:

• https://projects.developer.nokia.com/LWUIT_TouristAttractions

• LWUIT CategoryBar Demo:

• http://projects.developer.nokia.com/LWUIT_CategoryBarDemo

Page 15: How to develop cool apps for Nokia Asha smartphones

Demo: LWUIT Slide Puzzle

15 Michael Samarin, Director of Developer Training and Evangelism, Futurice

Page 16: How to develop cool apps for Nokia Asha smartphones

Demo: All LWUIT Examples

16 Michael Samarin, Director of Developer Training and Evangelism, Futurice

http://youtu.be/xu0UNJJPdYU

Page 17: How to develop cool apps for Nokia Asha smartphones

Porting and Guide for Android Developers:

• http://www.developer.nokia.com/Develop/Porting

Porting Resources at Nokia Developer

17 Michael Samarin, Director of Developer Training and Evangelism, Futurice

Page 18: How to develop cool apps for Nokia Asha smartphones

Ranges and Differences Feature Android Phone Asha Touch Phone CPU 600+ MHz 200-1000 MHz Display tech Capacitive Resistive or Capacitive Touch interaction Multi-point touch Single-touch and Multi-point touch

Display resolution 240x320 upwards 240x320, 240x400 Sensors GPS, Proximity, Acceleration GPS, Acceleration Multitasking Yes No Background processing Yes No Low-level API access Yes Limited UI Definition Declarative or programmatical Programmatical Ready-to-use UI components Android UI Standard LCDUI, LWUIT

Battery life Fair Excellent Development platforms Windows, Mac, Linux Windows IDEs Eclipse Eclipse, Netbeans Application size limitations 50MB + 4GB 2MB + Persistent Storage

Page 19: How to develop cool apps for Nokia Asha smartphones

Memory Considerations • On Series 40 Memory Limitations:

• Application JAR file size can’t exceed 2 MB.

• Java Heap Size is 2 or 4 MB.

• Use Nokia Device Matrix for checking: http://www.developer.nokia.com/Devices/Device_specifications/

• Brings challenging decisions, especially to visually rich games, with many bundled graphical resources.

• Option: post-download of needed resources and caching in RMS.

19 Michael Samarin, Director of Developer Training and Evangelism, Futurice

Page 20: How to develop cool apps for Nokia Asha smartphones

Apps particularly favorable for porting include

• Content-intensive applications, showing lots of textual content and making use of vertical scrolling.

• Single-purpose tools utilizing network connectivity: Content aggregators, RSS/News readers; Location-aware applications featuring maps.

• Various business applications.

• Casual games (puzzle, 2D arcade), children's apps (drawing, coloring, touch interaction, soundboards).

20 Michael Samarin, Director of Developer Training and Evangelism, Futurice

Page 21: How to develop cool apps for Nokia Asha smartphones

Application category

Portability and considerations

Games: Arcade, Action, Racing, Sports

Generally portable. Certain touch interactions might need to be redesigned. Use of images for graphics might need to be optimized. Many of these games can also be ported for non-touch devices: also lower-resolution ones, by downscaling the graphics.

Games: Brain, Puzzle, Cards, Casual

Generally portable. As these games are not usually graphically intensive, porting would be mostly converting the game logic and adjusting graphics for new resolutions. Depending on the type of the game, a wide range of Series 40 devices can be targeted, including non-touch ones.

Books, Comics, Education, News/Magazines

Generally portable. Biggest challenge is likely scaling the graphical content. While a wide range of devices can be targeted, a particularly sweet spot for these applications would be the full touch devices with lots of screen estate.

Business, Finance, Productivity

Generally portable, except for productivity tools related to platform personalisation. These applications can be made to work on a wide variety of screen sizes and input types. Porting is mostly adjusting views and converting the application logic. Also adjusting to non-touch devices is usually possible.

Communication, Social

Generally not portable: VoIP, tethering, ringtone and caller ID applications not feasible in Series 40. Messenger applications are limited to foreground processing.

Page 22: How to develop cool apps for Nokia Asha smartphones

Application category Portability and considerations

Entertainment, Health, Lifestyle, Medical, Shopping, Sports

Generally portable. Applications can be made to work on a number of screen sizes and non-touch devices. Most porting work is done with adjusting the UI and converting application logic. Background processing is not available to e.g. record GPS location on the background.

Media & Video Generally not portable. Simple video playback possible, but support varies across devices. See Video Formats in the Developer Wiki.

Music & Audio Generally portable, e.g. streaming music from online, with the exception of lack of background processing. Online streaming services generally work well where good network connetions are available, regardless of the input paradigm used. Porting work is required for application UI and audio streaming code.

Photography Portable, with reservations: camera accessible via JSR-234, no access to native code might make filters difficult to implement. This category is best viewed on the larger screen sizes, i.e. touch and type and full touch devices.

Tools, Widgets, Live Wallpapers, Personalisation, Libraries

Generally not portable: replacements for platform functionalities, virus scanners etc. not relevant in Series 40.

Page 23: How to develop cool apps for Nokia Asha smartphones

Navigation Logic: Android to Asha Tabs, Dashboard, Back

Page 24: How to develop cool apps for Nokia Asha smartphones

Porting • Consider Co-Development, instead of classic “porting” • Make clear separation between business logic and UI • It is possible to make libs reusable between platforms • JARs from Series 40 with platform independent Java code

are reusable directly on Android • Understand difference in application life cycle: Android

“Activity” vs. Midlet; Android Background Execution vs. Midlet instant kill

24 Michael Samarin, Director of Developer Training and Evangelism, Futurice

Page 25: How to develop cool apps for Nokia Asha smartphones

Examples:

25 Michael Samarin, Director of Developer Training and Evangelism, Futurice

• Tantalum Cross Platform Library • http://projects.developer.nokia.com/Tantalum

Page 26: How to develop cool apps for Nokia Asha smartphones

Demo: Android porting Frozen Bubble

26 Michael Samarin, Director of Developer Training and Evangelism, Futurice

Page 27: How to develop cool apps for Nokia Asha smartphones

27 Michael Samarin, Director of Developer Training and Evangelism, Futurice

Series 40 Graphics APIs • 2D Game Development

• Game API, part of the MIDP 2.0 standard, java package: javax.microedition.lcdui.game

• http://www.developer.nokia.com/Resources/Library/Java/#!developers-guides/ui-and-graphics/game-api.html

• 3D Game Development

• Mobile 3D Graphics API, optional JSR-184 also known as M3G

• http://www.developer.nokia.com/Resources/Library/Java/#!developers-guides/ui-and-graphics/mobile-3d-graphics.html

Page 28: How to develop cool apps for Nokia Asha smartphones

28 Michael Samarin, Director of Developer Training and Evangelism, Futurice

• javax.microedition.lcdui.game • GameCanvas • Layer • LayerManager • Sprite • TiledLayer

Game API Package (MIDP)

Page 29: How to develop cool apps for Nokia Asha smartphones

29 Michael Samarin, Director of Developer Training and Evangelism, Futurice

•GameCanvas • Double buffered • Convenient for minimizing code of

game loop • Methods for querying status of keys

Page 30: How to develop cool apps for Nokia Asha smartphones

Demo: 2D GameBuilder Plugin

30 Michael Samarin, Director of Developer Training and Evangelism, Futurice

Page 31: How to develop cool apps for Nokia Asha smartphones

Demo: DrumKit Coding

31 Michael Samarin, Director of Developer Training and Evangelism, Futurice

Page 32: How to develop cool apps for Nokia Asha smartphones

Demo: DrumKit Full Video

32 Michael Samarin, Director of Developer Training and Evangelism, Futurice

http://youtu.be/41xQTfNWQeI

Page 33: How to develop cool apps for Nokia Asha smartphones

Demo: CarRacing

33 Michael Samarin, Director of Developer Training and Evangelism, Futurice

Page 34: How to develop cool apps for Nokia Asha smartphones

34 Michael Samarin, Director of Developer Training and Evangelism, Futurice

Mobile 3D Graphics API JSR-184 or M3G

• Object-Oriented 3D • Scene Graph based • Optional MIDP JSR • Very compact API • Very fast development • Optimized for small memory

and budget CPU • Excellent implementation on

Series 40

Page 35: How to develop cool apps for Nokia Asha smartphones

35 Michael Samarin, Director of Developer Training and Evangelism, Futurice

Lightweight API, only 30 classes

AnimationController AnimationTrack Appearance Background Camera CompositingMode Fog Graphics3D Group Image2D

IndexBuffer KeyframeSequence Light Loader Material Mesh MorphingMesh Node Object3D PolygonMode

RayIntersection SkinnedMesh Sprite3D Texture2D Transform Transformable TriangleStripArray VertexArray VertexBuffer World

Page 36: How to develop cool apps for Nokia Asha smartphones

36 Michael Samarin, Director of Developer Training and Evangelism, Futurice

Modes

• Immediate mode • Similar to OpenGL ideology

• Retained mode • Scene Graph based • Entire Scene Graph can be

restored from file • Well defined M3G format

• Can be freely mixed

Page 37: How to develop cool apps for Nokia Asha smartphones

37 Michael Samarin, Director of Developer Training and Evangelism, Futurice

Scene Graph

World

Background

Group

Mesh

Morphing Mesh

Skinned Mesh

Group

Group

Sprite 3D

Sprite 3D User Object

Camera

Light

Page 38: How to develop cool apps for Nokia Asha smartphones

Demo: Monkey Face

38 Michael Samarin, Director of Developer Training and Evangelism, Futurice

Page 39: How to develop cool apps for Nokia Asha smartphones

Demo: 3D Racing and Sensors

39 Michael Samarin, Director of Developer Training and Evangelism, Futurice

Page 40: How to develop cool apps for Nokia Asha smartphones

Demo: 3D Maze

40 Michael Samarin, Director of Developer Training and Evangelism, Futurice

http://youtu.be/6WZcW_tD35U

Page 41: How to develop cool apps for Nokia Asha smartphones

Demo: All Games

41 Michael Samarin, Director of Developer Training and Evangelism, Futurice

http://youtu.be/NHhkFgxKX2g

Page 42: How to develop cool apps for Nokia Asha smartphones

42 Michael Samarin, Director of Developer Training and Evangelism, Futurice

Thank you!