3
  1. Is it possible to prevent an Android app. from closing?
  2. Is it possible to do this without modifying the OS?

I don't want the app. to close unless the user authenticates with a password or some other mechanism. I don't want any system settings changed without authentication either.


I want to use an Android tablet in stores and offices. I don't want customers messing with the OS or breaking stuff. So, I want the tablet locked to one app. until an administrator authenticates.

I don't want any modifications to the tablet, but I do want one app. to be functional.

Jay
  • 9,314
  • 7
  • 33
  • 40
  • is this some sort of Android Screensaver? Can you elaborate on its functionality to determine if it would work well as a service instead? Slayton's idea sounds like the way to go without more info – jordanhill123 Feb 05 '12 at 00:18
  • @jordanhill123, I updated my question to address this. Thanks. – Jay Feb 05 '12 at 00:27
  • see my answer, you have access to Android's source for their locking mechanism, you could extend it to your application like the WaveSecure app – jordanhill123 Feb 05 '12 at 00:32

2 Answers2

1

Something like this with enhancements? Source of Android's lock screen or How to lock the Screen customly? Just like WaveSecure in Android

Maybe take a look at this source code and use it to extend the functionality of your app to lock to just your program.

The WaveSecure App requires entering a password before it allows access to the phone.

Edit: http://developer.android.com/guide/topics/admin/device-admin.html might give you the options you want too.

Community
  • 1
  • 1
jordanhill123
  • 4,142
  • 2
  • 31
  • 40
  • My understanding of the "lock screen" is that it locks the device from being used completely. I want one app. to be usable, and everything else to be locked. Sorry for the confusion. I updated the question to explain it a bit better. – Jay Feb 05 '12 at 00:32
  • @Jay http://developer.android.com/guide/topics/admin/device-admin.html maybe this might help – jordanhill123 Feb 05 '12 at 00:34
  • Forgive me, I do not have an Android phone or tablet so I am not very familiar with it. I'm trying to figure-out how it works. So you're saying that the lock screen is an actual application running in its own process like every other app? And I should be able to copy the locking code in the lock screen app? – Jay Feb 05 '12 at 00:38
  • I believe so...it looks like other apps have extended and modified its functionality – jordanhill123 Feb 05 '12 at 00:39
  • It also looks like the Wave Secure app has replaced the Android locking mechanism itself so it must be an application all on its own. – jordanhill123 Feb 05 '12 at 00:42
0

Sure you can keep an App running without it being on the screen after all how do you think the GMail app continues to receive new emails even though the app isn't open.

I suspect what you are really asking about Activities and if you can keep one open when the user navigates away. The answer is simply no. Only 1 activity is active at a time on your phone and there is no way to change this. However there is a great solution: Services.

Think of Services as View-less activites. Users never see them or interact with them as they don't have a UI. They run in the background and can use used to do all sorts of good stuff like download data, uploading photos, checking email, etc...

slayton
  • 20,123
  • 10
  • 60
  • 89
  • That is not what I mean. I want to prevent the user from making any modifications to the system without authenticating first. I want to prevent the users from running and installing other apps. without authenticating. I want to lock the user into one app. until he authenticates. – Jay Feb 05 '12 at 00:20