0

Background

We are handing out phones for people to use while visiting our exhibition, and in those phones we are running a j2me app. The people will be using the device on their own while walking around, and returning it when leaving.

Problem

While our app is made specifically to be easy to use and understand for someone who has never used it before, the phone OS is not... (Currently HTCs with Brew MP)

People are accidentally pressing the front buttons and are thrown back into the menus, or the screen locks and they dont know how to get back.

Solution?

The only solution I can think of is to create a custom Android version that we can use in our phones.

The thing I would like to change is to disable all hardware buttons and special swipes. So people are essentially locked into our app when it is launched.

A few questions comes to mind:

  • How hard it is to get a custom built android version up and running on a device?
  • Does disabling buttons mean I have to dig deep into the kernel, or is it easily accessible?
  • Are some handsets better suited for running custom android? (We are currently planning on using ZTE Blade)
  • Does android come with drivers for GSM/camera/GPS etc for most chipsets, or will that be a problem?

Am I over-complicating things? Perhaps regular apps can override what the buttons do already?

mthurlin
  • 26,247
  • 4
  • 39
  • 46

4 Answers4

0

If I understand you correctly, you are trying to run your app and have the user only be able to access the app, you can uninstall the launcher

0

Have a look at the link below for how to download and compile the android source, as for getting it on the device, I've not worked that bit out yet...

http://source.android.com/source/download.html

My guess is that you're gonna have to hack your device to be able to put your own firmware/rom on it. Ask on the #android-root irc on freenode for advice on that. I've heard of people putting their own roms on that phone so it is possible.

In my personal opinion I think you are hugely over complicating things. You can override the default action of the back button, and obviously the menu button. Not too sure about the home button.

Maybe just go for something super simple and give out / attach a piece of card to the phone with 'How to get back to the app if you're silly enough to quit it' instructions on it? That, or give everyone that leaves the app a bit of a slap and hopefully they shouldn't do it again ;)

jsonfry
  • 2,067
  • 2
  • 15
  • 16
  • Thanks, I know it is possible to root most if not all devices. I'm more interested in the gory details. Like what I can expect from driver support etc in different devices. If I replace the OS on a ZTE Blade, will my own version support the hardware? Do I have to save any kind of drivers from the device first? – mthurlin Jan 18 '11 at 23:34
0

Based on your requirement, I am not sure if you need a custom Android version. If you want to control the app not responding to buttons, there should be other ways.. (I truly believe Android will have that flexibility)

Try this forum thread to start with. Android - Is It possible to disable the click of home button

Community
  • 1
  • 1
GSree
  • 2,890
  • 1
  • 23
  • 25
0

Unless this is a Symbian handset, in which case you cannot block the red key and menu key, you should be able to respond to all the softkeys to prevent it going back even in J2ME, the softkeys are most likely to be mapped to -6 and -7

heres some example code which should help get you started, some phones notably some Samsungs have a third softkey and getGameAction can throw an exception (Sony K700 certainly does) so should be be try caught

   public static boolean isKnownKey(Canvas canvas, int keyCode) 
   {
      return (keyCode >= KEY_NUM0 && keyCode <= KEY_NUM9) ||
         keyCode == KEY_POUND || keyCode == KEY_STAR ||
         canvas.getGameAction(keyCode) != 0;
   }

   public static int KEY_SOFT_LEFT = -6;

   protected void keyPressed(int keyCode) 
   {
      if (!isKnownKey(this, keyCode)) 
      {
         if (keyCode == KEY_SOFT_LEFT)
            leftSoftCommand();
         else
            rightSoftCommand();
      }
      else
         super.keyPressed(keyCode);
   }
kgutteridge
  • 8,727
  • 1
  • 18
  • 23