Is it possible to keep Tizen application alive non stop

前端 未结 2 1636
日久生厌
日久生厌 2020-12-05 15:51

recently I’ve started developing for Tizen OS. My application is created only for wearable and only for specific device which is Samsung Gear Sport (Tizen 3.0 on board). Mai

2条回答
  •  广开言路
    2020-12-05 16:08

    If you target the native Service App API 3.0 get the following:

    device_power_request_lock(POWER_LOCK_CPU, 0);
    sensor_listener_set_option(listener,  SENSOR_OPTION_ALWAYS_ON);
    sensor_listener_set_attribute_int(listener, SENSOR_ATTRIBUTE_PAUSE_POLICY, SENSOR_PAUSE_NONE);
    

    And don't forget to set a Background Category (sensor + location if needed) in the Manifest because otherwise Tizen will kill your app after ~ 10 min.

    Of course hardly any of this is properly documented...

提交回复
热议问题