Wednesday, March 10, 2010

LWUIT On Nexus One (Android) Device

A colleague of ours just got a new Nexus One device and I just had to try LWUIT on it...
I used Thorsten's port to get started and made some minor UI tweaks using the resource editor. In the process I also added a new LWUIT feature (pure touch) to make the UI behave closer to the way it does on Android/iPhone devices (show focus only when using the keypad and hide it when not using the touch screen).

The result is in the video to your right, which I feel is pretty close to the performance/behavior of native Android applications and in some regards exceeds their capabilities (e.g. Tensile drag on Lists, Text components etc.).

The advantages of working with LWUIT on Android is identical to its advantages in JavaME, you can get fixes for LWUIT and statically link it to your application thus reducing your dependency on platform changes. This by definition makes LWUIT more resistant to platform fragmentation in Android just as it does in JavaME & BlackBerry devices (and hopefully on other devices as well).

9 comments:

  1. Hi Shai,

    Is there some API for use device virtualkeyboard in lwuit apps?
    Or How I change the lwuit virtualkeyboard for use in my language? I am from Brazil...

    Thanks!

    ReplyDelete
  2. Just amazing! LWUIT ports across mobile devices like anything.

    ReplyDelete
  3. This comment has been removed by the author.

    ReplyDelete
  4. Do you by any chance know how to set the display to landscape if the phone has no accelerometer? Maybe something the Display class?
    I own a Samsung 3650 and this kind of thing would be highly appreciated for a small capacitive touchscreen.

    ReplyDelete
  5. I appreciate the information. Java is one of the consistent player from the development industry which has been providing the wider scope for developers to come out with different solutions.

    ReplyDelete
  6. @anson: The android port is under Thorsten's directory in the lwuit-incubator project.

    @linker: That's not feasible in J2ME

    ReplyDelete
  7. I have no idea what space you are talking about?
    Most of the work was in the theme which I can't publish since it contains unlicensed images.

    ReplyDelete
  8. Hi Shai

    I've managed to port a basic lwuit app to Android, and that works perfectly.

    The only problem is that need some help with including the .res file and an image.

    Any help will be appreciated
    Thanx
    Terence

    ReplyDelete
  9. You need to place all your images and resources into the assets directory.

    ReplyDelete