SecretAgent Mobile Compact Programming
Last updated on: 6/19/2012 1:05 PM
Created on: 11/2/2016 2:22 PM
Minimizing Memory Requirements
Developing this application for the Pocket PC device was my first attempt to do embedded device programming. This meant I did not have a lot of memory to deal with and I didn't want to waste memory either. In addition if I wasn't good with releasing memory and referencing bad pointers than the software would crash which on the device causes it to hang.
I do have the resources to use C++ as the primary language which means I use my class programming skills to make sure all the overhead is taken care of and handled properly. This meant the software needed to be divided up into the proper classes to create a framework that was easy to troubleshoot and debug. I also made use of the document view architecture to keep my logic classes separate from the user interface classes.
To keep memory use as small as possible there are only a small group of options that are required which can be modified by the user. Most of these are stored as numeric values so it doesn't require many bytes to keep the dozen or so options around. The area that needed to be optimized was the class that is the engine for Certificate Explorer. An instance of this class is needed anytime the certificate dialog, the Certificate Explorer window or an archive window is open. In short, most of the application requires this class. As a result, the application creates one and only one instance of the class. While the class is loaded memory is kept to a minimum by only have references to the actually certificates in memory and only loading a certificate when there is a demand to.
Most of the other memory requirements are handled in the cryptographic engine that I am using so that is outside my control and the scope of this document.
Navigate the topics to dicover the lessons uncovered in building for Mobile in the now retired Windows CE/Windows Mobile build.SecretAgent Mobile (SAM) User Interface Size Constraints and Considerations Automatic Data Protection Certificate (Contact) Management Certifications