This micro guide is the first of a colection dedicated to c++ dvelopers that want to prodcuce a more robust code.
These suggestions are only a quick guide based on our experience as mobile developers.

1) Ensure that your application responds to system shutdown events.

2) Ensure that your application responds to incoming system events. Remember that your application is operating on a multitasking enviromnment and for this reason you need to pay attention to focus gained/lost events to ensure that the software responds correctly when the user receives a high priority notification (i.e. an incoming call).

3) Your application has to handle with care the memory in order to avoid crashes and runtime errors. In order to avoid errors is mandatory to test the application not only on the emulator but test it frequently also in the target devices.

4) When it’s possible allocate objects on the heap rather than on the stack.

5) Close gracefully the application when system resources are unavailable especially when you encounter Ram issues.

6) Always remember to set member HBufC variables to null after deleting them if your purpose is to re-allocate to the same variables.

7) Remember that function whit a trailing “C” on their name automatically put the object on the CleanupStack and that if you put manually these objects on the stack they will be present twice.

8) Remembr always thea Symbian OS constructor must never Leave. If a C++ construcor Leaves there is no way to cleanup the partially cosntructed object because there is no pointere to it.

9) When passing or returnig an object to a function ensure that if you take ownership of the object you delete it! Symbian uses the convetion that pointers in a method indicates transfer of owbershio to the caller while references indicate that the ownership of the passed object remains with the origina owner.

10) Take care when implementing framework classes in your application. You should always derive from the platform specific framework
provided.

About the author

Giorgio Natili Giorgio Natili is Adobe community expert, a W3C member and an agile practitioner. He is head of his own company GNStudio, which has been operating in the web development filed for the past 9 years. His field of expertise focus on Adobe Flash, Fireworks, Dreamweaver, Coldfusion Flash Media Server, Flex and their integration, as well as accessibility both in html and Flash.

More recently his interests have broadened to include developing mobile applications and e-learning tools. He strongly believes in the need to spread new web-technologies by ‘evangelizing’ in the Italian development communities.

If you enjoyed this article, you might also like...

  • No Related Post

Post comment

About MobileRevamp

The aim of this community is to share as much as possible information related to the mobile development using all the social networks and the new capabilities of the NET to make easier find updated contents and to create a deep feeling of connection between developers.

Photostream

IMG_0276IMG_0275IMG_0274IMG_0273IMG_0272IMG_0271

Updates

    Archives

    Recent Comments

    Adobe Mobile UGs

    Authors