me-box / databox

Databox container manager and dashboard server
MIT License
94 stars 25 forks source link

sensingkit (android app) only sends data while databox app is visible in foreground #339

Open cgreenhalgh opened 4 years ago

cgreenhalgh commented 4 years ago

this is databox 0.5.2 (plus some fixes) and android app 0.5.7. the sensingkit client in the phone app only sends data when the databox app is in the foreground and screen is on. If the app is moved to the background or the screen is off then it does not send data. (i've tested with light, step count & acceleration) (It does send data with lock screen visible and the app underneath it.)

haddadi commented 4 years ago

I think Kevin shoudl know this.

ktg commented 4 years ago

I do know this. I wrote it that way. Both iOS and Android are making it increasingly difficult to access sensors and data in the background, like location. It was simpler to only have it run in the foreground, and worry about running it in the background in the future.

minoskt commented 4 years ago

There are some ways to do that in iOS. For example, while using Location or Microphone (audio recording) in the background and with the user’s permission you can access all sensors (only exception is iBeacon broadcasting).