1

I'm designing an app for an Android device with NO SCREEN! Naturally the problem is that I have no window focus (I have no screen)
hence onPause is called right after onResume.

For testing, I use a controlled PC with a simulated UI layout, but when I lose
screen focus or run without the simulated UI on my device, onPause is called.

I tried some window manager flags to help me but none of them helped me. Anybody tried an app without screen or can help?

Hussein El Feky
  • 6,627
  • 5
  • 44
  • 57
Daniel Givoni
  • 665
  • 6
  • 12

1 Answers1

2

It might be possible to get your job done with an Activity but you would probably make your life unnecessarily miserable. I think what you are looking for is a Service or maybe a BroadcastReceiver. Check the official documentation on Services and Broadcast receivers.

simon
  • 2,896
  • 1
  • 17
  • 22
  • i thought about a server but it is my last choice for now because i have a hole complex app with meny classes,receivers,audios and recordings. – Daniel Givoni Feb 02 '16 at 16:24
  • i'm looking for a solution to "trick" the android OS as if i'm allways on sceen – Daniel Givoni Feb 02 '16 at 16:25
  • @Androidy I don't know if this is even possible. And even if it is, you're probably causing more problems than you solve. If you really want to stick with an `Activity` (which I don't recommend) maybe one of the answers to [this question](http://stackoverflow.com/questions/2704084/how-to-launch-an-activity-without-a-ui) will help you – simon Feb 03 '16 at 10:09