SystemAPI
Article Metadata
Overview
The SystemAPI was developed to facilitate access to informations about battery’s level and signal’s strength on Symbian OS devices, without the Symbian/C++ code conventions. It's very useful for Qt and OpenC/C++ programmers.
Header
//SystemAPI header
#include "SystemAPI.h"
class Example: public SystemAPIObserver
{
public:
/**
* C++ default constructor
*/
Example();
/**
* Example virtual destructor
*/
virtual ~Example();
/**
* callback functions for receiving data events,
* Inherited from SystemAPIObserver interface
*/
void batteryLevelCheck(BatteryInfo battery, int err) ;
void signalStatusCheck( SignalInfo signal, int err );
private: //ATRIBUTES
SystemAPI* system; //Provide access to SystemAPI methods
BatteryInfo battery; //struct with battery info
SignalInfo signal; // struct with signal info
};
Source
//CPP FILE
//Example header file
#include "Example.h"
Example::Example()
{
system = SystemAPI::create();
system->notifyBatteryChange(this);
system->notifySignalChange(this);
}
Example::~Example()
{
if(system)
{
delete system; //delete system pointer
system = NULL;
}
}


Please include in the article which platforms are able to run this code example.
-- Wiki administration