0

I am developing an app which requires the gdk program to continue running as-is even after the device is removed from the head. Currently the program is paused when this happens seemingly by default, but I need the program to stay running because it is constantly uploading video. The desired result is that the program will continue to run and upload a video stream even if the glass is removed from the user's head.

What can I do to change this behavior?

thank you.

Rboreal_Frippery
  • 2,016
  • 1
  • 19
  • 22
  • Could you elaborate more? Can you run that task in the background because when the user is not wearing Glass there is no interaction anyway? – pt2121 Sep 19 '14 at 20:20
  • Hello, thank you for the comment. The glass is constantly projecting a video stream and the desired effect is to allow the stream to continue even if the glass is taken off and placed on a table, etc... – Rboreal_Frippery Sep 19 '14 at 20:41

1 Answers1

0

You probably want to perform the long running upload in a background service. Android's activity model makes it such that you can't really depend on the life of the activity to always be in the foreground and you need to use a service for tasks that shouldn't be paused.

Also if you have an activity you want to return to when you put Glass back on, ensure you specify android:immersive="true" within your declared <activity>. Without this, your activity could be completely destroyed when the screen turns off.

Brandon Wuest
  • 206
  • 1
  • 2