Languages

Menu
Sites
Language
Gestures not working on Tizen Z3 mobile

Hi,

I am trying to use Shake gesture on my Tizen mobile and on creating a gesture handle it returns me GESTURE_ERROR_NOT_SUPPORTED.

But as i know there are many applications which make use of shake event to perform their operations. So can anyone tell me the right way to get the shake event on tizen Z3 mobile.

Below is the code snippet i used

 

    error = gesture_create(&ad->gesture_handle);
    if(error == GESTURE_ERROR_NONE)
    {
        PRINT_MSG("gesture_create = Success (%d)", error);
    }
    else if(error == GESTURE_ERROR_NOT_SUPPORTED)
    {
        PRINT_MSG("gesture_create = GESTURE_ERROR_NOT_SUPPORTED (%d)", error);
    }

    gesture_start_recognition(ad->gesture_handle, GESTURE_SHAKE, GESTURE_OPTION_ALWAYS_ON, gesture_cb, NULL);

Thanks in advance

View Selected Answer

Responses

4 Replies
Mehedi Alamgir

Hi Jasvinder

Gesture Shake event is not supported in Samsung Z3 device. To check if Gestire Shake event is supported or not in Z3 run the following code and check your Log Message.

void isGestureSupported()
{
        bool supported ;

	gesture_is_supported(GESTURE_SHAKE,&supported);	

	if(!supported)
	{
		dlog_print(DLOG_INFO,"TAG","Gesture Not Supported in Current Device");
	}
	else
		dlog_print(DLOG_INFO,"TAG","This Device is Gesture Supported");
}

 

Jasvinder Khurana

HI Mehedi,

 

I have tried your code and Tizen Z3 prints "Gesture Not Supported in Current Device" :(

But as i know there are applications on Tizen Z3 mobile which make use of shake event for some action.

So can you guide me how would they be getting the Shake event. Is it directly by processing Accelerometer data?

If so, is there some code snippet that i can get to produce a shake event from accelerometer data.

Thanks

Mark as answer
Mehedi Alamgir

Well, You can detect shake using Accelerometer data.

You need to compare the current acceleration values on all three axes to the previous ones. If the values have repeatedly changed on at least two axises and those changes exceed a  predefined threshold value, then you can clearly determine shaking.

Check the following links. You will get idea for coding

http://stackoverflow.com/questions/5271448/how-to-detect-shake-event-with-android

Jasvinder Khurana

Hi Mehedi,

Thank you so much for your support, yes i used the same link to detect shake gesture on tizen mobile. :)