Adding vibration to my missed call alert program (S60)
Used Symbian's HW Resource Manager Vibra API to control the vibrator.
First, include the header and declare a member variable in the application class:
In the 2nd phase constructor, create the instance:
Start the vibrator when necessary:
And remember to destroy it in destructor:
First, include the header and declare a member variable in the application class:
#include <hwrmvibra.h>
. . . . . .
CHWRMVibra* iVibra; In the 2nd phase constructor, create the instance:
......
iVibra = CHWRMVibra::NewL();
...... Start the vibrator when necessary:
......
// vibrate for 5 sec, strongest intensity
iVibra->StartVibraL(5000, 100);
...... And remember to destroy it in destructor:
......
if (iVibra)
{
delete iVibra;
iVibra = NULL;
}
......