Android Tutorial Android "Kiosk mode" tutorial

warwound

Expert
Licensed User
Longtime User
FYO, Android L will have a new API that'll make creation of a kiosk mode app far easier.
It'll be called 'Task Locking', there's some info about it here: http://developer.android.com/preview/api-overview.html#TaskLocking


Anyway, back to the present where we have no such API...

Martin.
 

sanjibnanda

Active Member
Licensed User
Longtime User
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
*

Its an excellent work!
+1
I understood the work flow, except the above part, that why you have created these 7 activities and mentioned them in manifest.
could you spare some time to give more information and its functionality.
 

ilan

Expert
Licensed User
Longtime User
i have not read all posts here so i dont know if my question is already answered, so sorry if it is...

will google allow me to upload such an app?? that will always force my app to come to front?
or could it be that my account will be banned by google?
 

Declan

Well-Known Member
Licensed User
Longtime User
When I run the eaxmple: KioskAppExtended_vc2
I get the following error:
B4A version: 5.20
Parsing code. Error
Error parsing program.
Error description: Unknown type: controls
Are you missing a library reference?
Occurred on line: 39 (Main)
Dim ICS As Controls
at this section of code:
B4X:
    Dim ICS As Controls
    ICS.Initialize(Activity, Me)
 

Declan

Well-Known Member
Licensed User
Longtime User
Ok, sorted.

But now I have another problem - when I run the example KioskAppExtended, it stops unexpectedly.
 

Declan

Well-Known Member
Licensed User
Longtime User
What is KioskAppExtended? Which error do you see in the logs?
It is this example: KioskAppExtended_vc2
https://www.b4x.com/android/forum/threads/android-kiosk-mode-tutorial.10839/page-6#post-176432

I am trying to create a Kiosk type app that is the device owner - the device must operate as a "reader" similar to a "Kindle"
I require no phone functionality (making and receiving calls), but I must have WiFi and data connections to a server.
My app will be the only app that the user has access to.
I am running Android 5.
 

Rusty

Well-Known Member
Licensed User
Longtime User
I have an application that has successfully used Kiosk mode to manage activities and it has worked well for years.
I recently added VoiceRecognition (in the Phone library), which seems to create a new activity.
In managing the many activities within my app, it is obvious how to deal with activities named by me.
What is the activity name for VoiceRecognition?
B4X:
    Select Case Main.LastActivity.tolowercase.trim
        Case "vr"
            If IsPaused(Main) Then KioskTimer.Interval = 1000
        Case "licensecheck"
            If IsPaused(LicenseCheck) Then KioskTimer.Interval = 1000
        Case "checkupdates"
            If IsPaused(CheckUpdates) Then KioskTimer.Interval = 1000
I have the above code segment within my kioskservice which runs its kiosktimer.
Note the first Case. The vr or activity name is what I am looking for so the kiosk manager can handle it.
Thanks,
Rusty
 
Last edited:

Christian321

Member
Licensed User
Longtime User
Hi guys,

I just started programming with B4A and was willing to develop a kids game. Thus, the kiosk mode would be essential as kids seem to always manage to send an application to the backround.

I now have a question that will probably be easy for you to answer: I tried your kiosk example and I figured that it shows the same behavior similar to my approaches. I tried two very simple ways:

(1) Without a service, in my Main activity:
B4X:
Sub Activity_Pause (UserClosed As Boolean)
    StartActivity(Me)    
End Sub

(2) With the Starter service (made sticky) using a 300ms timer:
B4X:
Sub Service_Create
   myWatchdogTimer.Initialize("CheckMainForeground", 300)
   myWatchdogTimer.Enabled = True
End Sub
Sub CheckMainForeground_Tick
    If IsPaused(Main) Then StartActivity(Main)
End Sub

Both ways seem to have the same result. In short, what is the difference to your complex solution?
Many thanks in advance.

Update: I finally managed to get KioskAppExtended running and can see the difference...
 
Last edited:

Christian321

Member
Licensed User
Longtime User
What is KioskAppExtended?

Hi Erel,

see here: https://www.b4x.com/android/forum/threads/android-kiosk-mode-tutorial.10839/page-5
Post from: mkh42, Jun 19, 2013
Download File KioskAppExtended_vc2.zip

You might need to create the working directory:
B4X:
File.MakeDir(File.DirRootExternal, "Pictures/Screenshots")

I had to find and download quite a lot of required libs. I attached them as Libs.zip.
KioskModeExtended is more like a launcher than an usual kiosk mode app...

Greetings from Germany,
Christian
 

Attachments

  • Libs.zip
    32.7 KB · Views: 512
Last edited:

Sganga61

Member
Licensed User
Longtime User
Hi
I'm using fine the Kiosk service as suggested by Erel. But now, after upgrading to B4A8, it seems like no more usable....

Any suggestion?
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…