语言

Menu
Sites
Language
Problem recognizing the "stationary" activity on a Samsung Galaxy Watch

Hello, I hope you can help me with this issue, I can program my Samsung Galaxy Watch to recognize activities like walking and running, but it will not detect the "stationary" activity - the moment when those activities are supposed to have ended.

My code does not report any errors, and identical code will work when it comes to recognizing walking or running activites.

Code for recognizing the "stationary" activity:

    activity_h ahandle3;

	int result = activity_create(&ahandle3);

	if (result != ACTIVITY_ERROR_NONE) {
		dlog_print(DLOG_ERROR, "mywatch", "Activity Handler Error");
	}
	else
		dlog_print(DLOG_ERROR, "mywatch", "Activity Handler Success");

	int result2 = activity_start_recognition(ahandle3, ACTIVITY_STATIONARY, activity_cb_stat, NULL);

	if (result2 != ACTIVITY_ERROR_NONE)
		dlog_print(DLOG_ERROR, "mywatch", "Activity Error");

 

Code for the callback:

void activity_cb_stat(activity_type_e type, const activity_data_h data, double timestamp, activity_error_e error, void *user_data)
{
    dlog_print(DLOG_ERROR, "mywatch", "!Activity STATIONARY");	

	int result;
	activity_accuracy_e accuracy;

	set_location("WORK_ST?");

	if(type == ACTIVITY_STATIONARY)
	{
		set_location("WORK_STAT");
	}
	else
	{
		set_location("WORK_OTHER");
	}
}

I appreciate any help for solving this issue, or even a workaround to detect the moment a walking or running activity has ended.