2017.05.30 23:02


Tizen Watch Application API


State Diagram

Refer to the following state diagram to see the possible transitions and callbacks that are called while transition.


Required Header

#include <watch_app.h> #include <watch_app_efl.h>

Overview

The Watch Application API provides functions for handling Tizen watch application state changes or system events. Tizen watch application can be shown in the idle screen of the wearable device. This API also provides time utility functions for developting Tizen watch applications. You can develop a watch application that shows exact time using these time utility functions. For low powered wearable device, Tizen watch application supports a special mode that is named 'ambient'. When the device enters ambient mode, Tizen watch application that is shown in the idle screen can show limited UI and receives only ambient tick event at each minute to reduce power consumption. The limitation of UI that can be drawn in the ambient mode depends on the device. Usually, you should draw black and white UI only, and you should use below 20% of the pixels of the screen. If you don't want to draw your own ambient mode UI, you can set the 'ambient-support' attribute of the application as 'false' in the tizen-manifest.xml. Then, the platform will show proper default ambient mode UI.

This API provides interfaces for the following categories:

  • Starting or exiting the main event loop
  • Registering callbacks for application state change events including timetick events
  • Registering callbacks for basic system events
  • Time related utility APIs for watch applications

Registering Callbacks for Application State Change Events

The state change events for Tizen watch application is similar to the Tizen UI applications. See the Application. In Tizen watch application, an ambient changed event is added to support ambient mode. Time tick related events are also added to provide an exact time tick for the watch application.

CallbackDescription
watch_app_create_cb()Hook to take necessary actions before the main event loop starts. Your UI generation code should be placed here so that you do not miss any events from your application UI.
watch_app_control_cb()Hook to take necessary actions when your application called by another application. When the application gets launch request, this callback function is called. The application can get information about what is to be performed by using App Control API from app_control handle.
watch_app_resume_cb()Hook to take necessary actions when an application becomes visible. If anything is relinquished in app_pause_cb() but is necessary to resume the application, it must be re-allocated here.
watch_app_pause_cb()Hook to take necessary actions when an application becomes invisible. For example, you might wish to release memory resources so other applications can use these resources. It is important not to starve the application in front, which is interacting with the user.
watch_app_terminate_cb()Hook to take necessary actions when your application is terminating. Your application should release all resources, especially any allocations and shared resources must be freed here so other running applications can fully use these shared resources.
watch_app_ambient_changed_cb()Hook to take necessary actions when the device enters ambient mode. Your application needs to adopt its UI to be compatibile with the ambient mode. Note that, you only can use very limited colors and pixels of the screen when the device is in the ambient mode. Usually, you should use only black and white to draw the ambient mode UI and use below 20% of the pixels of the screen. If you don't want to draw your own ambient mode UI, you can set the 'ambient-support' attribute of the application as 'false' in the tizen-manifest.xml. Then, the platform will show proper default ambient mode UI.
watch_app_time_tick_cb()This callback is called at each second when your application is visible. This callback is not called when your application is not visible or the device is in ambient mode. You can use this tick to update the time that is being displayed by your watch application.
watch_app_ambient_tick_cb()This callback is called at each minute when the device is ambient mode. You can use this tick to update the time that is being displayed by your watch application while the device is in ambient mode. You should not do a job that takes long time in this callback. You should update the UI as fast as possible in this callback. The platform might make the device to sleep in short time after the ambient tick expires.


출처 : https://developer.tizen.org/ko/development/api-references/native-application?redirect=/dev-guide/2.3.2/org.tizen.native.wearable.apireference/group__CAPI__WATCH__APP__MODULE.html&langredirect=1

저작자 표시
신고

'Computer > Tizen' 카테고리의 다른 글

Watch Application API  (0) 2017.05.30
SIGNATURE_NO_DEVICE_PROFILE [78]  (0) 2017.05.08
[Tizen] 타이젠 Privilege 설정  (0) 2017.02.15


Posted by injunech