Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FR] Background Support #23

Open
ebabel opened this issue Nov 23, 2017 · 5 comments
Open

[FR] Background Support #23

ebabel opened this issue Nov 23, 2017 · 5 comments

Comments

@ebabel
Copy link
Collaborator

ebabel commented Nov 23, 2017

A background service would be a nice feature to add. So you can pull up maps, texting, camera, or whatever and still be logging.

@ebabel
Copy link
Collaborator Author

ebabel commented Nov 23, 2017

Might make instrumentation testing more difficult though. Gotta get those unit tests working.

@audkar
Copy link
Collaborator

audkar commented Jul 6, 2018

How this should work?
Most straightforward solution I can think is to refactor bt connection/tracking logging from MainActivity to foreground service.
From user perspective this would look like:

  • MainActivity opened.
  • Scan button clicked
  • BT turn ON intent dialog shown (only if BT is off)
  • Foreground service Notification shown. (here bt connection started).
  • X clicked. At this point foreground service stopped, bt connection ended, notification removed.

With this solution would be possible to get rid of WakeLock but trade off is that notification will be always visible until tracking is stopped.

If this solution is OK then I can take this task

@kwatkins
Copy link
Collaborator

kwatkins commented Jul 7, 2018

Hmm... having an always visible notification is fine I think. Constantly show a heads-up like dashboard with the current battery % and maybe speed, if it isn't too notification heavy.

Your method might be just fine, my thoughts when I saw this PR was wrapping the services in an actual Android Service (startService() etc) and passing the data via intents or http://square.github.io/otto/

Goal at the end of the day is to keep the app running, logging, etc - it's annoying that I'll be going, look down at the app, then will be disconnected. And would be great to see all the stats in the lockscreen notification, stretch goal :)

@kwatkins
Copy link
Collaborator

kwatkins commented Jul 17, 2018

I've been using the master build for a couple of days. It's looking good, a few hiccup that I'm trying to track down and replicate - mainly related to power management. If I turn off the screen, BLE disconnects, and also seems to disconnect even with screen on at certain times. Logs are showing the BLE stack sending the disconnect... Sounds like power management stuff (Doze etc), adb commands can test power management triggers etc as well like app standby (https://source.android.com/devices/tech/power/mgmt)

Oh, the battery and speed gauge will freeze at times, stats etc still update. Likely due to the updates coming from different channels. I'm still tracking this one down.

@audkar
Copy link
Collaborator

audkar commented Jul 17, 2018

Ok. If possible can you fill separate issue tickets for 100% identified problems please? I will try to solve them one by one.
In meantime I am going to investigate how app behaves with doze in different android versions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants