App Development for Nokia Asha Devices with Java ME
Marlon Luz - INdTNokia Developer Evangelist
@marlonluz
WHAT IS THE
INdT?
mobile tecnologies and internet
for areas related to
with focus in development of
new concepts, products & solutions
CENTER OF
RESEARCH & DEVELOPMENT
nonprofit
CENTER OF
RESEARCH & DEVELOPMENT
nonprofit
Training Content
• Nokia App Store• Nokia Platforms• Introduction to Java ME Development• High Level UI components• Data storage• Publishing your App
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
Silverlight, XNA
Java apps PhonesSeries 40
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, contacts,
etc.• Emulates mobile
events like battery, sms, etc.
• IDE Integration
Development• IDE Installation• Overview JavaME• First Project
• 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;
JavaME Overview
• 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)
Configurations
• 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
CLDC
• Needed APIs to develop applications for a specific set of devices• MIDP• IMP• PBP• ...
Profiles
• Mobile Information Device Profile; • MIDP defines the following set of classes:• Application Lifecycle Package• User Interface Package• Persistence Package• Networking Package• Language and Utility Packages
MIDP
CLDC or KVM
CLDC Core classes
Mobile
Info
rmatio
nD
evice
Pro
file
Persiste
nt
Sto
rag
e
Netw
orkin
g
Use
rIn
terfa
ce
MID
let
APIs
• 3 versions available:
MIDP
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
• 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
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
Destroyed
Paused ActivestartApp()
pauseApp()
destroyApp() destroyApp()
default constructor()
MIDlets• The platform can change the state from Active
to Paused at any time
Destroyed
Paused Active
startApp()
pauseApp()
destroyApp() destroyApp()
MIDlets• The method destroyApp() of a MIDlet is called
when the platform needs shutdown a MIDlet
Destroyed
Paused Active
startApp()
pauseApp()
destroyApp() destroyApp()
MIDlets• Let´s see how to code 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 processDevelopment Station
MyMIDlet.java
javac
MyMIDlet.class
MyMIDlet.class
MyMIDlet.jar
MyMIDlet.jad
Target Devices
preverify
jar
Download/deploy
Download/deploy
Recommended