August 11, 2004

Singletons in QUALCOMM's BREW

Posted at August 11, 2004 11:10 AM in BREW .
The typical patterns for implementing a singleton require either a global variable or a class member variable. Unfortunately, neither of these constructs is available in BREW when compiling for Over-the-Air (OTA) provisioning. This has driven many developers to experiment with the local thread storage API available in later versions of BREW, bizarre tricks like writing pointers to active data in memory to configuration files, or simply to despair.

Fortunately, there is a better way: leveraging the nature of BREW's IModule interface, which itself is a singleton enforced by BREW at creation time and using it to implement the singleton contract. To do this, you must first understand a little about how BREW instantiates components.

This is a different solution to the same problem presented in a recent developer.com article. This one is geared more for data where the other one is geared more for commands.

Learn more at DevX:

BREW Up a Better Way to Synch Data Between Apps Using a Singleton

Trackback

You can ping this entry by using http://www.mamlambo.com/mt/mt-tb.cgi/341 .

Comments

Post a comment










Remember personal info?