语言

Menu
Sites
Language
How can I read sensor data when the display is off?

I am trying to read sensor data in the background.

The device I am using it Galaxy Watch Active.

I expected that native application run in the background even if the display is off, however the sensor callback is not invoked, if the screen is out.

How can I get sensor data while the display is off?

FYI, I am not planning to upload my app to app store.

I am using it for collecting data.

响应

1 回复
GEUNSOO KIM

there are few things you need to care about.

1. add "background" attribue in your manifest file.

2. wake your app using alarm API. the other than Alram API will not work properly.

good luck.