Languages

Menu
Sites
Language
Native gear s3 watchface, detecting user wanted to change watchface or just pause into ambient mode or change to another app
Hi, In some of the watch faces, when we wanted to change it, it can animate to position 10:10 (clock), I try to intercept in the app_pause event, but it seems if user go to ambient mode/open another app this will called also What is the best practice to handle this kind of situation ? NB : Can we grab the long press event ? Seems the system override this Thanks

Responses

6 Replies
Yasin Ali

Hi,

Check this link https://developer.tizen.org/dev-guide/2.4/org.tizen.guides/html/native/app/watch_n.htm
for Watch application life-cycle and Application state change callbacks ).

From your post,
"detecting user wanted to change watchface or just pause into ambient mode or change to another app ",
in this case your application will reside at app_pause state. You may check with code like below:

static void
app_resume(void *data)
{
 dlog_print(DLOG_ERROR, LOG_TAG, "@app_resume");
 /* Take necessary actions when application becomes visible. */
}
static void
app_pause(void *data)
{
 dlog_print(DLOG_ERROR, LOG_TAG, "@app_pause");
 /* Take necessary actions when application becomes invisible. */
}

Hope it will help you.
If you find my post is helpful for you, please mark it as the Best Answer to promote this post to others.

Tizen is me
Thanks for answering, already used those methods before, but like I wrote previously, how to know if pause going to change the watchface and pause because of other things like switch to ambient and opening other app
Yasin Ali

" how to know if pause going to change the watchface and pause because of other things like switch to ambient and opening other app "

- Based on user interaction with WatchFace app_resume(void *data) and app_pause(void *data) will fire. You've to understand that these
are watchface states that changes based on WatchFace interaction. When, as you said, other things like switch to ambient and opening other app happens
then function related to these states will execute.
Hope it will help.
Tizen is me

:) Sorry I dont understand, let me rephrase the question, how can we get the event when the user wanted to change the watchface since app_pause and app_resume also called in different situation as well

 

Or should we tap into the long tap gesture ?

 

Thanks for the patience

Yasin Ali

Yes. Of course you may use  long tap gesture .

Tizen is me
Thanks I'll try it, but I think the gear will overtake the gesture