Search code examples
androidc++qtqt-mobility

Qt Haptic Feedback on android


I'm attempting to get my device to rumble but I'm having very little luck. My environment is HTC Sensation Android 2.3.3 API 10. Using Necessitas Qt Creater as my IDE.

Does nothing at all:

QFeedbackHapticsEffect::playThemeEffect( QFeedbackHapticsEffect::ThemeBasic );

Crashes my application:

QFeedbackHapticsEffect rumble;

rumble.setAttackIntensity(0.0);
rumble.setAttackTime(250);
rumble.setIntensity(1.0);
rumble.setDuration(100);
rumble.setFadeTime(250);
rumble.setFadeIntensity(0.0);

rumble.start();

rumble.stop();

I've specified my .pro file with the following

CONFIG += mobility
MOBILITY += feedback

and I'm using QTM_USE_NAMESPACE with the required headers included.

Edit:

I've set the following permissions:

android.permission.INTERNET
android.permission.WRITE_EXTERNAL_STORAGE
android.permission.VIBRATE

However I still receive a segmentation fault.


Solution

  • According to this:

    http://doc.qt.nokia.com/qtmobility-1.2/index.html#platform-compatibility

    it's not one of the platforms that is feature complete at the current time.