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 05:02, 25 July 2013 by hamishwillee (Talk | contribs)

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

Example app stubs with logging framework

From Wiki
Jump to: navigation, search

This article introduces code example stub applications which include a useful framework for creating logs in Java ME, Symbian C++, and Symbian Web Runtime.

Article Metadata



Even with rigorous testing during development, apps can fail after being published. As this will often happen on devices which the app developer can't get hold of, and in locales which they can't reproduce it is desirable to log application behaviour, so that it can be sent back to the developer and used for post-mortem debugging.

This article introduces basic code example stubs for saving logs to a file or displaying them on the device’s screen. The code stubs can be attached to any critical operations that may fail, such as network connectivity. It’s up to the developer to decide what information will be logged.

Stub features

The stub applications contain the following features:

  • Logging information onto the screen
  • Logging information into a file (not the WRT Stub)
  • Displaying a dialog that can be used to query text from the user (not the Java ME Stub)
  • Displaying a message box that can be used to show text to the user
  • A menu with items for executing an example snippet and exiting the application

The stubs

Code snippet testing

These stubs can also be used as the app framework for testing code snippets you plan to display on this wiki.

  1. Download the stub application from below for the technology with which you are implementing the snippet.
  2. Create a copy of the stub application so that the original one remains unmodified for future use.
  3. Implement the functionality that you want to demonstrate with the snippet into the stub application.
  4. Test that the functionality works as intended.
  5. Create a diff file (patch) to describe the modifications you made as described in Using Diffs. Compare the stub you have modified to the original stub. (Download the original stub again from below if you didn't store it previously.)
  6. Post the code snippet and the diff file into Nokia Developer Wiki.
This page was last modified on 25 July 2013, at 05:02.
86 page views in the last 30 days.