This webinar introduces Nokia Asha software platform 1.0 and what’s new for developers targeting the Nokia Asha 501 phone. It covers the updates to the development tools and the new APIs for Nokia Notifications, Image Scaling, Image Processing, Gestures, and File Dialog. After providing an overview to what’s new, Java™ expert Michael Samarin of Futurice provides coding demonstrations to show how to use the new features to build great apps.
Join the sessions:
14 May - 7 a.m. New York; noon London; 7 p.m. Singapore: http://forumnokia.adobeconnect.com/intro-asha-plat-ssn1/event/event_info.html
22 May - 8 a.m. London; 12:30 p.m. New Delhi; 3 p.m. Singapore: http://forumnokia.adobeconnect.com/intro-asha-plat-ssn2/event/event_info.html
30 May - 8 a.m. San Francisco; 10 a.m. Mexico City; 4 p.m. London: http://forumnokia.adobeconnect.com/intro-asha-plat-ssn3/event/event_info.html
Developer Training and Evangelism
NOKIA ASHA SOFTWARE PLATFORM 1.0
• Java ME MIDP 2.1 CLDC 1.1
• Optional JSRs
• Nokia APIs
• Max JAR file size: 5 Mb
• Max Java Heap: 3 Mb
• Screen Size: 240 x 320
• Very responsive UI, because of
the new underlying OS and new
• Series 40 Binary Compatibility
WHAT’S NEW FOR 3RD PARTY DEVELOPERS
Nokia Asha SDK 1.0
– Nokia Asha 501 Emulator, support for 47 languages
– Nokia IDE 2.0 for Java ME
– Offline Documentation
– Tantalum Library
– HERE Maps API
– On-device debugger over WiFi
UI and graphics
– LCDUI Changes
– New LWUIT for Asha Release
– Image scaling API
– Gesture API: new double tap
– Internationalization API (JSR-238)
– Network State API: SIM, network, WLAN change notifications
WHAT’S NEW FOR 3RD PARTY DEVELOPERS
– AMMS: Tuner, image encoding, image post processing
– Video Recording
– Removed com.nokia.mid.sound.Sound (Nokia UI)
– PKI support.
– Removed APDU / SATSA-APDU
– Contacts API: contact change notifications in phonebook (while MIDlet is active)
– File Select API: use native file browser to select files
– Phone Setting API: retrieve settings + change notifications: flight mode, data connection,
silent mode, etc.
– Nokia Notifications API: subscribe + get payload of notifications
Nokia Asha SDK 1.0
– Nokia Asha 501 Emulator
– Nokia IDE 2.0 for Java ME
– Offline Documentation
NEW ASHA UX
LWUIT FOR NOKIA ASHA SOFTWARE PLATFORM 1.0
• New port of LWUIT, targeting specifically new
• Based on the LWUIT for Series 40 v1.0
• Adds Nokia Asha Software Platform 1.0 Theme
• Adds 8 new components
• Changes and adaptations of existing
components to new Asha platform
• Improved performance especially in themes
• 25 Examples in SDK
• Tantalum is a cross-platform Java library that provides a minimal set of
functionality to easily create concurrent, networked applications: thread
pool, HTTP networking with caching, logging and JSON support from
org.json.me library. It’s a rather of a set of common best practices that
has been validated to work on both Asha and Android, than a heavyweight
• The approach is to strictly separate clean, concurrent, event-driven
background application logic from clean, single thread event-driven user
interface (UI) code. This way you can achieve the best-possible user
experience (UX) on each platform you support by using the best native UI
classes while re-using your application logic across all platforms.
FILE SELECT API
• The File Select API allows MIDlets to use the device’s native file browser to list and select
files. The listing of files can be filtered by URL path and media type, and single as well as
multiple files can be selected.
• The device’s native file browser provides its own UI and handles browsing, listing and
selection of files. The File Select API pauses the thread, which is calling the API, till a file is
selected or the operation is cancelled.
• MIDlets can use the File Select API to:
– Select files to attach to a MMS or email message
– Select files for uploading to a website (publishing, archiving etc.)
– Select documents (PDF, DOC, TXT etc.) for viewing or editing
– Select images for viewing or editing
– Select audio or video clips for playback or editing
• Use the File Select API, if you want to list and select files, but do not want to implement
the file listing and selection functionality by yourself.
• Note: The File Select API can launch only one instance of the device’s native file browser at
USING FILESELECT API
• The File Select API consists of the following classes
(packaged as a part of the Nokia UI API):
– Use the FileSelect class to allow a MIDlet to list
and select files through the native file browser
of the device.
– Use the FileSelectDetail class to allow a MIDlet
to retrieve detailed information, like name,
type, size and URL, about the selected files of
IMAGE SCALING API
• The Image Scaling API allows MIDlets to downscale images by file size or by
dimension (i.e. width and height) with the aspect ratio of the image can be retained if
required. For JPEG images, the output quality can be set before downscaling.
• Actual downscaling process is done outside of JVM, so no extra memory
requirements for 3rd party apps.
• Note: The Image Scaling API cannot upscale an image, and does not allow users to
select any protected images for downscaling due to security or copyright issues.
USING IMAGE SCALING
• The Image Scaling API consists of the following classes
and interfaces (packaged as a part of the Nokia API):
– Use the ImageScaler class to allow a MIDlet to
downscale images in the device.
– Use the ImageScaleConstants class to allow a
MIDlet to use the image scaler definitions
generated by the configuration utility.
– Use the ImageScalerListener interface to allow a
MIDlet to discover status of images being
downscaled in the device.
New Nokia APIs
– FileSelect API
– ImageScaling API
WHAT ARE NOKIA NOTIFICATIONS FOR?
• Real Push Notification service, similar to existing equivalents on Windows Phone,
Android and iOS.
• Provides a way for 3rd party developers to deliver targeted notifications to individual
Asha devices with installed dedicated 3rd party Midlet.
• Notifications are delivered in various forms to device:
– If Midlet is not running and device is locked: notification is delivered to the lock
screen with associated audio / visual / vibration signal;
– If Midlet is not running and device is unlocked: notification is delivered to the
upper notification area (similar to Windows Phone toast notifications) with
associated audio / visual / vibration signal;
– If Midlet is running: notification is delivered directly to the Midlet.
• In order to deliver notification, device must have enabled data connection.
There are two parts:
– Nokia Notifications Service API (REST API);
• Used by 3rd party service in order to contact Nokia Notification
Server and deliver targeted notifications to the individual devices.
– Nokia Notifications Client API (Java ME);
• Used by 3rd party Midlet in order to register for the notifications
delivery and actually receive notifications.
REGISTERING NEW 3RD PARTY SERVICE
• Developer must have valid free Nokia Developer ID;
• Use web based Nokia Developer Consoler at:
• Create and generate with web tool:
– Service ID
– Application ID
– Service Secret
IMPLEMENTING FULL SERVICE
• Once service created, developer can use
Nokia Notifications Client API (Java ME)
in Midlet and register for receiving
notifications by using Service ID and
• When Midlet is registered with service, it
received unique Notification ID. This ID
should be transferred to 3rd party
service as unique identifier of Midlet and
• Using Nokia Notifications Service API
(REST), 3rd party service contacts Nokia
Notification Server and sends actual
notifications with Service ID, Application
ID, Service Secret, Notification ID.
SANDBOX AND PRODUCTION
• Each service will have:
– Sandbox environment;
– Production environment;
– Production environment in
• On device or emulator, developers
can switch environment with special
Environment Selector from Nokia
NOKIA NOTIFICATIONS CLIENT API
– Use the NotificationInfo to retrieve application specific settings from the Notification Enabler.
– Use the NotificationMessage to receive notification messages from a service.
– Use the NotificationPayload to receive notification payload from a service.
– Use the NotificationSession for communicating with the Notification Enabler.
– Use the NotificationSessionListener to get notified when a message or a notification info is received, or when the
notification status changes.
– Use the NotificationState to determine the state of notification session i.e. whether the MIDlet is not connected,
connecting, or connected to receive notifications.
– Use the NotificationEnvironment to specify the Notification Server environment for the Notification Enabler.
– Use the NotificationError to determine errors related to the notification state and exceptions.
– Use the NotificationSessionFactory to create a notification session to communicate with the Notification Enabler.
SEQUENCE OF STEPS FOR MIDLET
Load the session by calling the NotificationSessionFactory and
give the application identity:
private NotificationSession session;
session = NotificationSessionFactory.openSession(midlet,
"example.com", "com.example", this);
Request from session Notification ID and transfer to 3rd party service.
USING NOKIA NOTIFICATION SERVICE API (REST)
curl --digest -u "<SERVICE_ID>:<SERVICE_SECRET>"
curl --digest -u "<SERVICE_ID>:<SERVICE_SECRET>" -d
"toapp=<APPLICATION_ID>" -d "payload=Test"
NOTIFICATION PARAMETERS (1)
– Notification content. Payload can be max 1536 bytes long. System never touches
this part (except for doing compression on the server side and decompression on the
client side) - it is always provided to the recipient application "as is".
– Specifies whether an application that is not already running on the device should be
started when a notification is received. Note that a notification will only be displayed
if the wake up parameter is set TRUE both in the Service API and the Client API.
Default value is TRUE.
– Defines if an alert is to be triggered when notification is received. Valid values TRUE
or FALSE. Default value is FALSE.
– Specifies the content type of payload as a mime-type (for example, application/xml,
text/plain). Maximum length is 255 bytes.
– Defines the message content encoding (for example, Base64). Maximum length is 32
NOTIFICATION PARAMETERS (2)
– Notification title. Maximum length is 140 bytes.
– Notification subtitle. Maximum length is 140 bytes.
– Notification type. Maximum length is 20 bytes.
– Notification icon URI. This URI must point to the resource available publicly in
web. Only PNG format icons are supported. Maximum length is 256 octets.
– If the recipient is not available, this parameter defines the time in seconds the
notification will be stored for the recipient. Maximum value is 1209600.
– ID of the target application.