Hello
I'm new to this Basic4Android and this is my first post.
I came to Basic4Android because I should realise a a little project (Kiosk mode required) for a small museum. With Basic4Android I made quick progress and user part of the app is almost ready. Now I'm implementing the more 'administrative' part of the app.
I first want to use Surelock for Kiosk mode but as I found this thread it seems possible to realise it with Basic4Android.
I played already with the Kiosk demo and found it quit good especially with the addition of homebutton overwrite described in this thread. But one think is really a show stopper for me until now. In my stausbar one can open notification and settings menu. Surlock close this menu immediately so nothing can happen but Kiosk demo unfortunately doesn't until now. The task-manger is a similar problem but not so critical because if I start an other activity main activity starts again.
I found a interesting solution of this problem in this thread
How to disable recent apps dialog on long press home button | Julien Cavandoli - Blog
which can eventually be integrated in the Kiosk app to make it more secure. (and perhaps even can prevent from power down the device by closing the sytem dialog)
here one comment out of the above thread so you can see on a glance what's that all about
"Locked down all system dialogs on 4.1.1 tablet – « Recent Apps », « Notification Bar », even « Power Off »! They may flash but then go away."
The code of the solution seems very simple but for a Basic4Android beginner I have problems to port it. Probably the reflection library can help but there I'm really a beginner. Pherhaps someone can help.
The code from above thread is
@Override
public void onWindowFocusChanged (boolean hasFocus)
{
super.onWindowFocusChanged(hasFocus);
if( !hasFocus && mEnabled )
{
ActivityManager am = (ActivityManager)getSystemService(Context.ACTIVITY_SERVICE);
am.moveTaskToFront(getTaskId(), ActivityManager.MOVE_TASK_WITH_HOME );
sendBroadcast( new Intent(Intent.ACTION_CLOSE_SYSTEM_DIALOGS) );
}
}
importend is also the following
"
It does require android.permission.REORDER_TASKS, which I hadn’t encountered before (can apps even go through the store with that permission?).
"
I would be very happy if someone can help me to port this peace of code and make Kiosk demo app even more usefull.