Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries. Thanks for all your past and future contributions.

Revision as of 07:01, 3 May 2013 by hamishwillee (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Code snippets table for common use cases

From Wiki
Jump to: navigation, search
Article Metadata
Series 40
Created: seppo_fn (11 Nov 2008)
Last edited: hamishwillee (03 May 2013)

This table lists common mobile application use cases in some of the more important development frameworks supported by Nokia devices: Qt, Symbian C++, Java ME, and Web Runtime. For each use case, links to corresponding code snippets (CS) are provided. This way developers can more easily find snippets in different programming languages and runtimes.

If you notice that a relevant use case is missing from the list, or a snippet is mapped to a wrong use case, please let us know by adding a Comment at the end of this article. Currently only the code snippets published in the Nokia Developer Wiki are linked to. If you know that a use case is documented somewhere else, you may add your suggestion. We will then evaluate if the resource can be added to the list.


CS123456 Use case possible (link to a snippet provided). - Use case should be possible (no code snippets available).
S60 MobileExt Use case possible with Mobile Extensions for Qt. N/A Use case not possible.

Telephony | Messaging | Networking | Base/System | System information | Profiles | Hardware | Files/Data | PIM | Application Framework | UI | Personalisation | Graphics | Imaging/Camera | Audio/Video | Browsing and Download | Games | Localisation | Help | Location | Development process | Testing/Debugging | Installation

Use case Development Framework
Telephony Qt Symbian C++ Java Web Runtime
making a phone call programmatically S60 MobileExt CS001026 CS000956 N/A
making a phone call (user intervention required) S60 MobileExt - CS000955 N/A
hanging up a phone call N/A CS001383 N/A N/A
retrieving information on a phone call S60 MobileExt CS001063, CS001032 N/A N/A
retrieving log events (e.g., calls) N/A CS000849 N/A CS001231
Messaging Qt Symbian C++ Java Web Runtime
sending an SMS message CS001616 - CS000976, CS000977 CS001242
sending an MMS message CS001616 CS001379 CS000978 CS001239
listening for incoming SMS messages CS001617 CS001381 CS000981, CS000980 CS001236
listing messages in inbox CS001618 - N/A CS001246
removing a message N/A CS001380 N/A CS001241
changing the read status of a message - - N/A CS001365
providing a "send via" functionality N/A - N/A -
playing a message N/A CS001119 N/A N/A
Networking Qt Symbian C++ Java Web Runtime
opening a network connection CS001619 - - -
filtering internet access points - CS000837 N/A N/A
using an already active connection CS001619 CS000825 N/A N/A
Bluetooth Qt Symbian C++ Java Web Runtime
using a device selection UI N/A CS000910 N/A N/A
discovering devices N/A CS000936 CS001211 N/A
discovering services N/A CS000937 CS001213 N/A
service advertising & listening to connections N/A CS000938 CS001212 N/A
defining the transfer protocol (RFCOMM/L2CAP) N/A - - N/A
opening multiple connections N/A - - N/A
opening a socket N/A CS000939 - N/A
closing a socket N/A - - N/A
sending data N/A - - N/A
setting discoverability mode N/A CS000838 CS001310 N/A
prompting to switch on Bluetooth N/A - N/A N/A
deleting bluetooth device from the registry N/A CS001064 N/A N/A
retrieving bluetooth device's local name N/A CS001064 CS001323 N/A
communicating with remote targets N/A CS001034 - N/A
Base/System Qt Symbian C++ Java Web Runtime
using software installer programmatically S60 MobileExt CS000817 N/A N/A
exception handling - CS000882 - N/A
reading and writing persistent settings S60 MobileExt CS000908, CS000909 N/A CS001374
scheduling delayed execution N/A CS000986, CS000987,
CS000988, CS000989,
CS000990, CS000991,
- -
creating parallel execution paths (threads /
active objects)
- CS000867 CS001321 N/A
synchronizing resource access (Symbian:mutex,
semaphore; Java:synchronize)
- CS000969 CS001320 N/A
splitting execution to asynchronous blocks - CS000982,CS000983,
- N/A
cancelling an asynchronous function call - - - CS001177
custom cleanup N/A CS000985 - N/A
using plugins CS001391 CS000834, CS0000835,
- N/A
generating random-value integers CS001350 - - -
using arguments - - - -
using string conversions S60 MobileExt - - -
sorting data types, classes, structs - - - -
System information Qt Symbian C++ Java Web Runtime
checking battery level S60 MobileExt CS000902 CS001201 CS001247
checking network strength S60 MobileExt - CS001202 CS001234
identifying platform version S60 MobileExt CS000933 - -
getting cell id N/A - CS000947 -
retrieving product information S60 MobileExt - - -
checking APIs N/A - CS000960 -
feature discovery S60 MobileExt - - -
checking runtime version - - CS001357 -
checking machine id at run-time N/A - N/A -
checking machine id at installation-time N/A - N/A N/A
checking product (=platform) id at run-time N/A - - -
checking product (=platform) id at installation-time N/A - N/A N/A
retrieving memory information S60 MobileExt - - CS001232
checking memory card existence N/A CS000827 CS001200 CS001232
Profiles Qt Symbian C++ Java Web Runtime
checking current profile S60 MobileExt CS001024 N/A -
changing profile S60 MobileExt - N/A -
editing profile settings S60 MobileExt CS001294 N/A -
Hardware Qt Symbian C++ Java Web Runtime
controlling lights S60 MobileExt CS000912 CS001270, CS000957 CS001248
controlling vibra S60 MobileExt CS000911, CS001164 CS001258 CS001368
Sensors Qt Symbian C++ Java Web Runtime
obtaining the number of sensors N/A CS000886 FNWiki -
displaying information about available sensors N/A CS000887 FNWiki -
displaying sensor data S60 MobileExt CS000914 FNWiki -
listening for rotation sensor data events S60 MobileExt CS000913 - -
listening for accelerometer sensor data events S60 MobileExt CS000888 FNWiki -
reducing accelerometer sensor noise S60 MobileExt CS000915 - -
Files/Data Qt Symbian C++ Java Web Runtime
storing application settings - CS000967 CS001265 -
using databases CS001504,
CS000925, CS000926,
CS000927, CS000928,
CS000929, CS000930
- -
parsing contacts details from informal text - CS000931 - -
managing archives - CS000948, CS000949,
- -
managing media files - CS001036 - -
opening files, handling mime types N/A CS001050, CS001052,
CS001053, CS001054
- CS001371
listing PIM databases N/A - CS000972 -
using resources CS001503 - CS000979, CS001006 -
creating temporary files - - - -
reading and writing files - - FNWiki,
checking file status - - - -
encrypting and decrypting N/A - CS001314 -
shuffling data N/A - - -
PIM Qt Symbian C++ Java Web Runtime
adding a new event N/A - CS001198 CS001233
modifying an existing event N/A - CS001188 CS000942
deleting an event N/A - CS001358 CS001233
showing calendars and events N/A - CS001189,
importing an event N/A CS001027 CS001197 CS001237
exporting an event N/A CS001028 CS001186 CS001237
adding calendars N/A - - CS0012230
deleting calendars N/A - - CS0012230
changing calendar settings N/A CS001038 - -
converting time zones N/A CS000847 CS001199 -
displaying time and date - CS001007, CS001008 CS001311 CS001229
changing clock settings N/A CS001037 N/A -
monitoring alarms N/A CS001120 N/A -
Phonebook / Contacts:
finding/viewing contacts CS001620,
- CS001184,CS001360 CS001235
adding a contact CS001624 - CS001183 CS001238
adding a contact to a group - - - CS001362
managing phonebook groups - - - CS001373
reading and modifying a contact CS001622 - CS001185 CS001240
deleting a contact CS001623 - CS001359 CS001243
organising contacts N/A - - -
importing a vCard N/A CS000900 CS001187 -
exporting a vCard N/A CS000901 CS001210 -
assigning images to contacts S60 MobileExt CS001138 N/A N/A
Application Framework Qt Symbian C++ Java Web Runtime
listing installed applications - - N/A CS001160
launching an installed application CS001354 CS000828 N/A CS001162,
triggering application launch N/A - CS001387 N/A
pausing application on incoming call or message - CS000863, CS000883 CS000975 -
sending application to background CS001519 - - -
detecting focus change - - - -
exiting application CS001626 - - -
loading libraries - CS001009 N/A N/A
getting UI environment pointer N/A CS001057 N/A N/A
UI Qt Symbian C++ Java Web Runtime
adding Symbian S60 Options menu and panes CS001351,
- - CS001402
combining UI with engine CS001613,
- - -
drawing standard borders - CS000862 - -
switching views N/A CS001378, CS000848 CS000973
calculating text width CS001349 - - -
setting label fonts - CS000833 CS001316 -
drawing custom borders - CS000824 - -
adding scrollbars - CS000823 - CS001554
listening for scrollbar events - CS000884 - -
implementing a horizontally scrolling view CS001630 - - -
receiving key events CS001352 N/A CS001315 CS000943
listening for window server events CS001353 - - -
reacting to changes in screen size - - - CS001499
detecting and changing display orientation - - - CS001498,
locking display orientation CS001517 - - -
using indicators - CS000818, CS001121 N/A CS001549,
using progress bars - - - CS001555
using custom controls and elements CS001627,
CS000859, CS000860,
CS000861, CS000868
CS001267 -
creating transparent controls CS001614 - - -
using custom dialogs - CS000870, CS001165 CS000946 -
using custom scrollbars - CS000869, CS000885 - -
using interpolation - CS001166 - -
using listboxes - - CS001266 CS000941
using grids - - - CS000940
using notes - CS000945 CS001312 -
using dialogs - CS001056, CS001062 CS001312 -
using queries - CS001055, CS001059,
CS001060, CS001061
- -
managing layouts CS001308,
- - -
using buttons - - - CS001547
using radio buttons - CS001118 - CS001552
using checkboxes - - - CS001548,
using carousels - - - CS001546
using datepicker component - - - CS001553
catching menu events - CS001117 - CS001364
handling touch UI events - CS001144, CS001145,
CS001146, CS001147,
CS001148, CS001163,
- -
showing text input - - - -
enabling and disabling keypad lock N/A CS000932 N/A N/A
Personalisation Qt Symbian C++ Java Web Runtime
using skins N/A CS001025 N/A N/A
using style sheets CS001502 - - -
accessing screensaver settings N/A CS001039 N/A N/A
setting ringtones N/A CS001294 N/A -
Graphics Qt Symbian C++ Java Web Runtime
adding an application icon CS001351 CS000808 CS000958 -
loading images CS001500 - - CS001245
rotating bitmaps and images CS001514 CS000866, CS001139 CS001263 -
scaling bitmaps CS001347,
CS000984 CS001269 -
converting bitmap to JPEG - CS000906 - -
avoid flickering with double-buffering - CS001049 CS001268 CS001363
creating effects CS001515 - CS001319 -
drawing CS001516 - CS001313, CS001272 -
using animation CS001556, CS001557,
- CS001271 -
changing background colour CS001348,
- N/A -
Imaging/Camera Qt Symbian C++ Java Web Runtime
taking a picture S60 MobileExt CS000904 CS001259 N/A
saving a captured image - CS000905 CS001261 N/A
displaying viewfinder data S60 MobileExt CS000907 - N/A
handling (releasing) camera resource - CS000821 CS001262 N/A
checking if the camera is running - CS000815 - N/A
determining the number of cameras - CS000826 CS001273 N/A
using autofocus S60 MobileExt CS000954 N/A N/A
reading image information - CS000968 - -
Audio/Video Qt Symbian C++ Java Web Runtime
finding audio and video formats N/A CS000899 CS001260 N/A
playing multichannel audio N/A CS000916 - -
managing key sounds N/A CS000951, CS000952,
N/A -
configuring speech encoders (e.g., AMR) N/A CS001030 N/A N/A
converting text-to-speech N/A CS001031 N/A N/A
accessing video encoders N/A CS001065 N/A N/A
using audio adjustments in the audio player N/A CS001130, CS001131,
CS001132, CS001133,
CS001134, CS001135,
Browsing and Download Qt Symbian C++ Java Web Runtime
open html pages and links in browser CS001495 CS001385, CS001386 CS000974 CS001372,
gather and add data from a Web page CS001496,
- - -
Games Qt Symbian C++ Java Web Runtime
detecting collisions - CS000865 CS000959 N/A
Localisation Qt Symbian C++ Java Web Runtime
localising application strings - CS000807 CS001094, CS001095,
localising application help - CS000810 - -
localising application menus - CS000811 - -
localising number format - CS000855 - -
localising currency - CS000856 - -
localising timestamps - CS000857 CS001322 -
using localised images - CS000858 CS001317 CS001369
Help Qt Symbian C++ Java Web Runtime
implementing CS Help N/A CS000809 N/A N/A
localising application help - CS000810 - -
Location Qt Symbian C++ Java Web Runtime
searching for GPS devices N/A CS000822 FNWiki -
finding position S60 MobileExt CS001376, CS001377 FNWiki CS001161
tracking changes in location S60 MobileExt - FNWiki CS001176
calculating the distance - CS001375 - CS001175
launching location settings - CS001035 N/A -
adding a landmark S60 MobileExt - - -
modifying a landmark N/A - - -
exporting landmarks N/A - - -
importing landmarks N/A - - -
Development process Qt Symbian C++ Java Web Runtime
using command line arguments - - N/A -
deploying and exporting files CS001423,
- - -
setting up Qt Mobility CS001615 - - -
Testing/Debugging Qt Symbian C++ Java Web Runtime
displaying error texts - CS000965 - -
resolving error texts - CS000966 - -
Installation Qt Symbian C++ Java Web Runtime
creating dependencies - CS001097 N/A N/A
showing manufacturer disclaimer - CS000934, CS000935 N/A -

Give feedback

Currently only references to the Nokia Developer code snippets are listed. If you know that a use case is documented somewhere else, or if you notice an error, please let us know by adding comment below. You may also add a suggestion for a new, relevant use case.

This page was last modified on 3 May 2013, at 07:01.
418 page views in the last 30 days.