Game Development for
Nokia Asha Devices
with Java ME
                      Marlon Luz - INdT
              Nokia Developer Evangelist
                            @marlonluz
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
Training Content
 •   Talk on games
 •   Nokia App Store
 •   Nokia Platforms
 •   Introduction to Java ME Development
 •   Game API
 •   Publishing your game
Mobile Games
               •   Player Experience
               •   Idea
               •   Design
               •   Audio
               •   Coding
Nokia App Store
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
Nokia Platforms




   Java apps   Phones
               Series 40




                           Silverlight, XNA
Mobile Platforms




http://gs.statcounter.com/#mobile_os-ww-monthly-201201-201212
Mobile Platforms




http://gs.statcounter.com/#mobile_os-af-monthly-201201-201212
Mobile Platforms




http://gs.statcounter.com/#mobile_os-as-monthly-201201-201212
Nokia SDK 2.0 for Java
• Emulates the device
  environment
• Location, contactos, etc.
• Emulates mobile events
  like battery, sms, etc.
• IDE Integration
Development
• IDE Installation
• Overview JavaME
• First Project
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;
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)
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
Profiles
• Needed APIs to develop applications for a
  specific set of devices
   •   MIDP
   •   IMP
   •   PBP
   •   ...
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
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
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;
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
MIDlets
 • The platform can change the state from Active to
   Paused at any time


                       startApp()
         Paused                           Active
                       pauseApp()


   destroyApp()                        destroyApp()
                        Destroyed
MIDlets
 • The method destroyApp() of a MIDlet is called when
   the platform needs shutdown a MIDlet


                     startApp()
       Paused                           Active
                     pauseApp()


  destroyApp()                       destroyApp()
                      Destroyed
MIDlets
 • Let´s see how to implement a MIDlet
   #stopTalking
   #startCoding
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
Development process
 Development Station    MyMIDlet.jad


   MyMIDlet.java                Download
                                 /deploy

        javac                              Target Devices

                                Download
   MyMIDlet.class                /deploy

                       MyMIDlet.jar
      preverify


    MyMIDlet.class        jar
Thanks
             Marlon Luz
 ext-marlon.luz@nokia.com
               @marlonluz

Game Development for Nokia Asha Devices with Java ME #1

  • 1.
    Game Development for NokiaAsha 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
  • 5.
  • 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
  • 7.
    Nokia Platforms Java apps Phones Series 40 Silverlight, XNA
  • 8.
  • 9.
  • 10.
  • 11.
    Nokia SDK 2.0for Java • Emulates the device environment • Location, contactos, etc. • Emulates mobile events like battery, sms, etc. • IDE Integration
  • 12.
    Development • IDE Installation •Overview JavaME • First Project
  • 13.
    JavaME Overview • JavaMicro 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 awide 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 APIsto develop applications for a specific set of devices • MIDP • IMP • PBP • ...
  • 17.
    MIDP • Mobile InformationDevice 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 versionsavailable: 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 Javathat 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 applicationmanager 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 • Theplatform can change the state from Active to Paused at any time startApp() Paused Active pauseApp() destroyApp() destroyApp() Destroyed
  • 22.
    MIDlets • Themethod destroyApp() of a MIDlet is called when the platform needs shutdown a MIDlet startApp() Paused Active pauseApp() destroyApp() destroyApp() Destroyed
  • 23.
    MIDlets • Let´ssee 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 DevelopmentStation MyMIDlet.jad MyMIDlet.java Download /deploy javac Target Devices Download MyMIDlet.class /deploy MyMIDlet.jar preverify MyMIDlet.class jar
  • 26.
    Thanks Marlon Luz ext-marlon.luz@nokia.com @marlonluz