Aprenda a programar somente o necessário com Mogli: O menino lobo
Game Development for Nokia Asha Devices with Java ME #1
1. Game Development for
Nokia Asha Devices
with Java ME
Marlon Luz - INdT
Nokia Developer Evangelist
@marlonluz
2. WHAT IS THE
CENTER OF
INdT? RESEARCH
& DEVELOPMENT
nonprofit
with focus in development of
new concepts,
products & solutions
for areas related to
mobile tecnologies and internet
3. Training Content
• Talk on games
• Nokia App Store
• Nokia Platforms
• Introduction to Java ME Development
• Game API
• Publishing your game
4. Mobile Games
• Player Experience
• Idea
• Design
• Audio
• Coding
6. Nokia App Store, Series40 & JavaME
120k+ apps, 15m downloads/day
Brasil: 150m downloads (total), 50m in
2012, 500k per day, 56% in Series 40,
73% of purchases are JavaME apps
11. Nokia SDK 2.0 for Java
• Emulates the device
environment
• Location, contactos, etc.
• Emulates mobile events
like battery, sms, etc.
• IDE Integration
13. JavaME Overview
• Java Micro Edition (ME) is the Java for devices with
limited resources
• Java ME brings a common platform for devices like:
• Mobile phones
• Pagers
• PDAs
• Set-top boxes
• Java ME defines a set of configurations, profiles e
optional APIs;
• Java ME enables the developers to create
applications for a large number of devices;
14. Configurations
• Support a wide variety of products that fit within
the scope of J2ME;
• Defines a Java platform for a wide variety of
devices, also defines a JVM (Java Virtual
Machine) and the minimum set of class libraries
available:
• Connected Device Configuration (CDC)
• Connected Limited Device Configuration (CLDC)
15. CLDC
• 128 kilobytes of memory to run Java;
• 32 kilobytes for memory allocation in runtime;
• No user interface;
• Low power processing, battery enabled device;
• 16-32 Mhz Processor
16. Profiles
• Needed APIs to develop applications for a
specific set of devices
• MIDP
• IMP
• PBP
• ...
17. MIDP
• Mobile Information Device Profile;
• MIDP defines the following set of classes:
• Application Lifecycle Package
• User Interface Package
Mobile Information
• Persistence Package
Device Profile
Networking
Persistent
Interface
Storage
• Networking Package
MIDlet
User
APIs
• Language and Utility Packages
CLDC Core classes
CLDC or KVM
18. MIDP
• 3 versions available:
MIDP 1.0 MIDP 2.0
Memory Requirement At least 200KB At least 256KB
High/Low-Level UI
Network API
Persistent Storage API
Game API
Secure networking
Push Registry
Signed MIDlets
19. MIDlets
• Apps Java that run on MIDP devices are known
as MIDlets
• MIDlets are defined in the
javax.microedition.midlet package
• Child of the abstract class
javax.microedition.midlet.MIDlet
• Life cycle defined and managed by methods
implemented in the MIDlet;
20. MIDlets
• An application manager controls the MIDlet running
• The MIDlet behavior is controlled by a life cycle
through methods that a MIDlet has to implement
default constructor()
startApp()
Paused Active
pauseApp()
destroyApp() destroyApp()
Destroyed
21. MIDlets
• The platform can change the state from Active to
Paused at any time
startApp()
Paused Active
pauseApp()
destroyApp() destroyApp()
Destroyed
22. MIDlets
• The method destroyApp() of a MIDlet is called when
the platform needs shutdown a MIDlet
startApp()
Paused Active
pauseApp()
destroyApp() destroyApp()
Destroyed
23. MIDlets
• Let´s see how to implement a MIDlet
#stopTalking
#startCoding
24. JAD and JAR
• JAD (Java Application Descriptor)
• Provides information on the content of a JAR file
• JAR (Java Archive)
• Packaging various kinds of information (classes, images,
audio, data)
• Attributes JAR/JAD
25. Development process
Development Station MyMIDlet.jad
MyMIDlet.java Download
/deploy
javac Target Devices
Download
MyMIDlet.class /deploy
MyMIDlet.jar
preverify
MyMIDlet.class jar