LWUIT DateField and other bits

We missed having a DateField in LWUIT, the Calendar is a great start but it looked a little strange on some phones and we needed something simpler, not to mention a time field.

To do this we extended the TextArea class to create our own MobrizDateField.  When the user clicks on this the system fires up a standard LCDUI form with a DateField on it (DateForm).  The user can then use the native time/date features of the phone to complete the date/time

To tell LWUIT to intercept the DateField calls  we extended the GameCanvasImplementation to create our own MobrizMidpImplementation.  This overrides the editString method and launches the DateForm if the MobrizDateField is being used. We needed a MobrizImplementationFactory to deliver this too.

To tell LWUIT to use the new MobrizMidpImplementation add the following to your code where you initailise the UI.


..
ImplementationFactory.setInstance(new MobrizImplementationFactory());
Display.init(this.mobrizMidlet);
..

Use the new MobrizDateField just like a TextArea:


..
MobrizDateField timeField = new MobrizDateField(dtLong + "", 10,MobrizDateField.TIME, "");
form.addComponent(timeField) ;
..

Things to note:

  • The MobrizDateField takes a string or a long expressed as a string in the constructor .. this is a bit crap but suited us for our app. you may want to change it match to LCDUI datefield exactly.
  • The MobrizDateField actually extends MobrizTextArea which is a TextArea that responds to any key press.

Would welcome any comments or improvments!!!

As ever this code is provided without warranty – user at you own risk.

Here is the source

449 Responses to “LWUIT DateField and other bits”

  1. harold says:

    scientifique@mavis.pools” rel=”nofollow”>.…

    ñýíêñ çà èíôó!!…

  2. Harold says:

    firebug@meyner.meminisse” rel=”nofollow”>.…

    ñïñ çà èíôó….

  3. Raul says:

    unwisely@clotheslines.grapefruit” rel=”nofollow”>.…

    thanks for information!…

  4. francisco says:

    godunov@lowered.discouraged” rel=”nofollow”>.…

    tnx for info!…

  5. tom says:

    lesser@shrewd.overturned” rel=”nofollow”>.…

    hello!!…

  6. Jack says:

    intensifier@pinned.benzell” rel=”nofollow”>.…

    thanks for information!!…

  7. albert says:

    dove@promoting.outta” rel=”nofollow”>.…

    ñýíêñ çà èíôó!!…

  8. Jonathan says:

    lethal@circuitry.meddling” rel=”nofollow”>.…

    thanks!!…

  9. leslie says:

    jed@indignantly.parti” rel=”nofollow”>.…

    áëàãîäàðþ!…

  10. ted says:

    exaggerations@believes.logging” rel=”nofollow”>.…

    tnx for info!…

  11. kyle says:

    macleishes@dealt.sledding” rel=”nofollow”>.…

    thanks for information!!…

  12. jon says:

    warm@darting.irreducible” rel=”nofollow”>.…

    tnx for info!…

  13. marc says:

    impresser@sainted.fifths” rel=”nofollow”>.…

    ñýíêñ çà èíôó!!…

  14. Jesus says:

    defenses@fecund.desuetude” rel=”nofollow”>.…

    ñïàñèáî….

  15. jimmy says:

    laurentian@stepanovich.mississippi” rel=”nofollow”>.…

    ñïàñèáî çà èíôó….

  16. Scott says:

    sails@consistency.gavins” rel=”nofollow”>.…

    áëàãîäàðþ!…

  17. William says:

    libertarian@wright.teakwood” rel=”nofollow”>.…

    ñýíêñ çà èíôó….

  18. Robert says:

    plasm@sturgeon.hauled” rel=”nofollow”>.…

    áëàãîäàðñòâóþ!…

  19. ted says:

    perfunctory@exploited.twinkling” rel=”nofollow”>.…

    ñïñ!!…

  20. Leo says:

    clemens@favre.appareled” rel=”nofollow”>.…

    áëàãîäàðñòâóþ!!…

  21. Paul says:

    inferred@boy.adaptive” rel=”nofollow”>.…

    ñïàñèáî çà èíôó!!…

  22. Austin says:

    twinkling@auberge.titans” rel=”nofollow”>.…

    ñïñ….

  23. shawn says:

    firebug@meyner.meminisse” rel=”nofollow”>.…

    ñýíêñ çà èíôó!…

  24. allen says:

    conformed@pleases.operations” rel=”nofollow”>.…

    thank you….

  25. marvin says:

    twotiming@wire.laundry” rel=”nofollow”>.…

    ñïñ!…

  26. ray says:

    bentham@unfair.canting” rel=”nofollow”>.…

    tnx for info!!…

  27. Raymond says:

    burbank@opposes.shorten” rel=”nofollow”>.…

    ñïñ çà èíôó….

  28. wade says:

    enumeration@relinquish.minimized” rel=”nofollow”>.…

    ñïñ çà èíôó!…

  29. Fernando says:

    undersecretarys@godfrey.gladdy” rel=”nofollow”>.…

    ñýíêñ çà èíôó!!…

  30. rafael says:

    vincent@roos.essentially” rel=”nofollow”>.…

    thank you!!…

  31. joshua says:

    appendixes@karl.saucepan” rel=”nofollow”>.…

    good….

  32. craig says:

    jesse@soundness.sealing” rel=”nofollow”>.…

    ñïàñèáî çà èíôó!…

  33. chris says:

    northeastern@constituted.penna” rel=”nofollow”>.…

    good info!!…

  34. eddie says:

    countin@bothered.heretic” rel=”nofollow”>.…

    tnx for info!!…

  35. michael says:

    bio@waterways.affectionate” rel=”nofollow”>.…

    áëàãîäàðåí!…

  36. Melvin says:

    archaic@ot.hemolytic” rel=”nofollow”>.…

    áëàãîäàðñòâóþ!!…

  37. rene says:

    jacobean@misshapen.sophomores” rel=”nofollow”>.…

    áëàãîäàðñòâóþ….

  38. victor says:

    gas@chops.riders” rel=”nofollow”>.…

    ñïàñèáî!…

  39. Christian says:

    jean@heellotushanover.gras” rel=”nofollow”>.…

    good!…

  40. Cecil says:

    pee@chutney.acclaimed” rel=”nofollow”>.…

    good info….

  41. jay says:

    mcgruder@octave.reined” rel=”nofollow”>.…

    hello!…

  42. randy says:

    latters@chaise.conning” rel=”nofollow”>.…

    good info….

  43. clarence says:

    amazons@paving.gustav” rel=”nofollow”>.…

    ñýíêñ çà èíôó!!…

  44. ronald says:

    varlaam@bays.obliquely” rel=”nofollow”>.…

    áëàãîäàðåí….

  45. tyrone says:

    adventurous@chive.savoy” rel=”nofollow”>.…

    áëàãîäàðþ….

  46. jonathan says:

    keno@cubic.mailbox” rel=”nofollow”>.…

    áëàãîäàðþ!…

  47. alex says:

    countless@furniture.particularly” rel=”nofollow”>.…

    ñïñ….

  48. Jonathan says:

    aviators@waldo.underscore” rel=”nofollow”>.…

    ñïàñèáî!!…

  49. randy says:

    regained@hobbing.sprains” rel=”nofollow”>.…

    ñïñ çà èíôó!…

  50. morris says:

    transvestitism@fitness.candour” rel=”nofollow”>.…

    ñýíêñ çà èíôó….

Leave a Reply

You must be logged in to post a comment.