Hello
My Kiosk App now is grown to a state that I'm able to share my findings
here in the Forum in form of an extend KioskApp demo
Because I find a lot of useful information scattered in the forum from
kindly community members I want to share this code to make it simpler to
create a good kiosk app
The shared code is a stripped down version of my App I wrote for a small museum.
I hope I don't make to much errors during strip down. I certainly tested the
stripped down code but not as much as I did the original code.
My original app was landscape only but I do not find a big problem
in setting the orientation to unspecified. Hope I'm right.
Excuse that the logs are often in German and some subs to.
There are some ini files in the files directory so please take a look in the ini files.
kiosk.ini: forced settings link to allowed app ini file
appstart.ini applauncher ini file and also inifile for allowed apps in kiosk.ini
in this example I start com.android.calendar for other apps
I dump a file of apps to file.dirinternal
"Apps.txt" see WriteAppsDatei
main.ini configures main menue
German lesson for the ini files :
Lautstaerke = volume
Bild = Picture
IMPORTANT: Take a look in the manifest there are a lot of additions
I used a lot of libs to achieve this results .
Needed libs:
ActivityManager
Audio
CiniFile
Core
Dialogs
ICSControls
Jhwifi
OSLibrary
Phone
Reflection
Serial
ToggleWifidata
What are the extensions:
1) Proper management of default Home intent setting/deleting
see therefore the subs
ClearAllHomeAppDefaults
a FakeHome activity is activated and then deactivated to remove all Home
default settings see also PmsetComponentEnabledSettingFakeHome
for more information see
java - Clearing and setting the default home application (SOLVED) - Stack Overflow
CompareWithDefaultHomeActivity
check if app is already default for Home
ClearAppDefaults
clear app own defaults
2) because I was not able to delete recent task list I worked with
a couple of start activities Start0-Start7
That works very well for me no problems with accidentally activating the
original launcher and a long delay
3)already implement an example simple secret exit method with password
see ListView1_ItemLongClick I think you will got the idea
4)Closing system windows to prevent recent task list and notification bar
to pop up. Not totally perfect but for all important settings which
could eventually be changed I support forced settings
5)the timer support some kind of forced settings see kiosk.ini
also works with the transparent activity trick mentioned here in the forum
There also possible to have some dynamic settings for volume (0-100).
Use this code to create a tmp ini file and it should work
Code:
Dim Settings As List
Settings.Initialize
Settings.Add("Lautstaerke="& Menuepunkt.Lautstaerke)
Utils.WriteTmpSettings(File.DirInternal, Settings )
this file is delete during Main resume
see for example ListView1_ItemClick in AppLauncher
6)Power management. My form of power management is certainly kind of specific.
My app works as follows. Always on if unplugged for easy for the visitor.
A short press on power disables only very short time the screen and
the application returns to Main activity with a toast message for the
visitor. If plugged a short press on power disables screen to speed up
charging. Make a search in kioskservice for 'plugged' an you will get it.
7)as long as screen is off the timer interval is slow (in my app only possible when plugged)
8)during kiosk mode delete all screen-shots made see Timer5min
9)unlock screen see CheckLock and SetShowWhenLocked
what's IMHO not possible
prevent reboot from very long press on power
no workaround but Tab reboot to app again
for some good informed kids this could mean some trouble
prevent screenshots with power + volume keys
workaround with delete screenshots see Timer5min
Totally prevent settings change possible in notification bar
workaround with forced settings
Delete recent task list
workaround with start activities
disable gimmicks integrated in status bar from producer like miniapps without rooting
workaround choose a right tab
or root your device
Give it a try.
Post additional questions in this thread and I will try to answer them
IMPORTANT: Exit app with long press on listview 1, longpress on listview 2
password 'pass' see ListView1_ItemLongClick to change this
Thanks again to all people who posts there know how to this forum a
lot of solutions I in this app are from them
greetings
mkh42
versioncode 2 (vc2) (quick fixes which I overlooked during strip down sorry for that)
- fixed path error of ini file
- smaller filesize (reduced jpg size)
*
*