Download the free trial version
Basic4android Video
Features
Tutorials and manuals
Showcase
Screenshots

Go Back   Android Development Forum - Basic4android > Basic4ppc (Windows Mobile) > Code Samples & Tips
Documentation Wiki Register Members List B4P Search Today's Posts Mark Forums Read

Code Samples & Tips Share your recent discoveries and ideas with other users.

Creating Kiosk applications

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-01-2007, 05:01 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 13,162
Awards Showcase
Basic4ppc Founder 
Total Awards: 1
Default Creating Kiosk applications

Sometimes there is a need to "protect" the user from itself and not allow him to quit your application.
These kind of applications are called kiosk applications.
There are three things you should do to create a kiosk application:
  1. The application should be full screen so the user will not be able to reach the Today menu.
  2. Override the hardware buttons functionality.
  3. Put a shortcut for your application under \Windows\StartUp
How it's done?
  1. Use FormLib.FullScreen method.
  2. Use the updated Hardware library. Read the keys values from the registry and catch all the keys.
  3. This can be done in the installation package.
    You need to change line 144 of the SetupBuilder from:
    if chkShortCut.Checked = true then FileWrite(c,AppName & ",0," & lstFiles.Item(e) & ",%CE11%")
    to:
    if chkShortCut.Checked = true then FileWrite(c,AppName & ",0," & lstFiles.Item(e) & ",%CE4%")
    This will create the shortcut under \Windows\StartUp instead of \Windows\Programs
See the attached source code for an example of a kiosk application.
Attached Files
File Type: zip Kiosk.zip (34.6 KB, 443 views)

Last edited by Erel : 01-14-2008 at 06:36 AM. Reason: Libraries were updated.
Reply With Quote
  #2 (permalink)  
Old 07-02-2007, 12:00 PM
Newbie
 
Join Date: May 2007
Posts: 4
Default

HI

GOOD
thank you
Reply With Quote
  #3 (permalink)  
Old 06-29-2010, 06:27 AM
Newbie
 
Join Date: Jun 2010
Posts: 4
Default Windows Mobile

Hi,

Should this work on Windows Mobile? If I run Kiosk.sbp on my PDA, I can't catch any key presses. Should this work in PDA editor or do I have to create the installation package?
Reply With Quote
  #4 (permalink)  
Old 06-29-2010, 06:34 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 13,162
Awards Showcase
Basic4ppc Founder 
Total Awards: 1
Default

It works on most devices. However it tries to read the keys from the registry. It is possible that on your device the registry is a bit different.
__________________
Basic4android documentation
Reply With Quote
  #5 (permalink)  
Old 10-22-2010, 06:49 PM
Senior Member
 
Join Date: Oct 2010
Posts: 124
Default

Hey Erel,
This is really cool and I'm looking at adding this code into my application - I tried to do an implementation for working across multiple forms - but it seems the title and menu bar pop up anytime you're moving amonst the forms. Is there anyway to prevent this?

Thanks!
Reply With Quote
  #6 (permalink)  
Old 10-23-2010, 06:01 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 13,162
Awards Showcase
Basic4ppc Founder 
Total Awards: 1
Default

You need to create one FormLib object for each form:
Code:
    flb.New1("Form1",B4PObject(1))
flb.FullScreen(
True)
flb2.New1(
"Form2",B4PObject(1))
flb2.FullScreen(
True)
...
__________________
Basic4android documentation
Reply With Quote
  #7 (permalink)  
Old 10-25-2010, 02:17 PM
Senior Member
 
Join Date: Oct 2010
Posts: 124
Default

Hmm I tried that but the menu and title bar flash up on the screen between form changes. Is there anyway to prevent that ?
Reply With Quote
  #8 (permalink)  
Old 10-26-2010, 11:58 AM
Cableguy's Avatar
Basic4ppc Expert
 
Join Date: Apr 2007
Location: N 41º11'30.30" W 8º39'46.60"
Posts: 2,313
Awards Showcase
Forum Contributer 
Total Awards: 1
Default

Hum, do you really need several Forms?
Is it possible to you to use panels instead?
That way you only set form1 as a FullScreen form, and the "flickering" would not exist, and you can place the same controls on a panel as weel as in a form...Then you only needed to make the right panel visible when needed...

Hope this helps..
__________________
Paulo Gomes - Porto, Portugal - Living/Working in France-Saumur
Mobile Device: Samsung Galaxy S, Android 2.3.4 CUstom ROM
Laptop: Toshiba NB100-130 (running on Win7Ultimate)
B4PPC DLL Version Listing - B4Android DLL Version Listing
Reply With Quote
  #9 (permalink)  
Old 10-26-2010, 03:55 PM
Senior Member
 
Join Date: Oct 2010
Posts: 124
Default

CableGuy - This is a possibility. I didn't even consider that. I'll have to rework some things - but this might work
Reply With Quote
  #10 (permalink)  
Old 11-02-2010, 09:55 PM
Senior Member
 
Join Date: Oct 2010
Posts: 124
Default

Erel - Just found another quirky thing with the kiosk code and I don't know if there's a way around it.

I'm now trying to run my application with your kiosk snippet here on a device with Win CE 5.0 and your kiosk code gets rid of the top bar, but not the bottom task bar. Any idea on how I might hide this as well to achieve the same functionality as on a Windows Mobile device?

Thanks!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
creating chm files Ricky D Questions (Windows Mobile) 2 10-15-2008 11:03 AM
Creating SIP spectra9 Questions (Windows Mobile) 2 05-21-2008 03:32 PM
Distributing your applications Erel Code Samples & Tips 4 10-20-2007 07:41 AM
Help Creating a dll Cableguy Questions (Windows Mobile) 23 08-15-2007 05:30 PM
launch and close other applications dbo33 Basic4ppc Wishlist 4 06-02-2007 07:03 AM


All times are GMT. The time now is 02:34 AM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0