0

A little background first. I'm developing an application for corporate devices running on the Android platform. It won't be distributed on the Play store and thus, is unavailable to the general public. The devices are owned by the company and its only purpose is to run this application. So accessing the home screen/notifications/application history/ app drawer are unnecessary and in fact we want to focus the user experience directly on this application.

The current problem I'm facing is preventing access to the notification tray. Simply making the application full screen is not a solution. We do actually need to see the status bar. It's the easiest way to provide network,gps and battery status information to the user.

So far my research has only turned up one solution, which is to go full screen (again, not a solution for this problem,I need the status bar to be visible). I know there's a number of lock screen apps that are able to do this so there must be a way. I just haven't found it yet.

TJ Thind
  • 784
  • 5
  • 17
  • How do you mean disable? If you were to disable it wouldn't you cut off the user from those things you mentioned that you want them to be able to get to from the notification tray? Oh, Do you mean disable to the tray swipe down but leave the collapsed bar present? – FoamyGuy Jun 04 '12 at 19:06
  • Precisely. The user wouldn't be able to pull down the notification tray. But the status bar and the network, battery and gps status icons would still be visible. – TJ Thind Jun 04 '12 at 19:21

2 Answers2

2

I am not sure, but probably that you can't just lock notification bar from the application level. Android app is isolated from the Operating System and another apps, so it is not able to lock OS features.

Solution that came into my head is to make app fullscreen and create Your own status bar with battery level, current time and network status. It is not hard.

Another solution would be to prepare Your own Android distribution :)

Moreover probably You would like to override all buttons (home, back, search) so user is not able to leave your app.

Jacek Milewski
  • 3,304
  • 1
  • 18
  • 17
  • We're on a tight schedule so I was hoping not to reinvent too many wheels. But it is beginning to look like developing my own status bar is the only reliable solution. Looks like I can capture most of that info through sticky broadcasts [except for the GPS](http://stackoverflow.com/questions/2021176/how-can-i-check-the-current-status-of-the-gps-receiver). Already capturing the search,back and menu actions. Home I've still got to get that one. Thanks for your help Jacek! – TJ Thind Jun 04 '12 at 19:42
0

Very likely is not going to be possible on a Stock device, you'd have to root and potentially install your own version of the OS to allow for this behavior. The system was purposefully made to disallow applications from having this type of behavior. The creators of the OS had the general public in mind as users, and they wanted to prevent applications from being able to "lock" the user out of portions of the device.

Much easier solution like @Jacek states is go full screen and make your own View to display whatever info that you do want from the Notifications bar, AFAIK there are public APIs to access all of that information.

FoamyGuy
  • 46,603
  • 18
  • 125
  • 156