Example app stubs with logging framework
This article introduces code example stub applications which include a useful framework for creating logs in Java ME, Symbian C++, and Symbian Web Runtime.
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.
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
- Symbian C++ Stub v.1.0
- Symbian C++ Stub v.1.1
- Web Runtime Stub v.1.0
- Web Runtime Stub v.1.1
- Web Runtime Stub v.1.2
- Java ME Stub v.1.0
- Java ME Stub v.1.1 (Retested and found to work for "Full Touch" devices - Series 40 Developer Platform 2.0)
Code snippet testing
These stubs can also be used as the app framework for testing code snippets you plan to display on this wiki.
- Download the stub application from below for the technology with which you are implementing the snippet.
- Create a copy of the stub application so that the original one remains unmodified for future use.
- Implement the functionality that you want to demonstrate with the snippet into the stub application.
- Test that the functionality works as intended.
- 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.)
- Post the code snippet and the diff file into Nokia Developer Wiki.