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

