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
Hi,
first of all, tx for the excellent work. I’m evaluating your solution, already using in a prototype and it’s working fine so far.
All I had to do was instantiate your factory:
ImplementationFactory.setInstance(new MobrizImplementationFactory());
Display.init(this);
and than:
MobrizDateField timeField = new MobrizDateField(new Date().getTime() + “”, 10,MobrizDateField.DATE, “dmy”);
myLWUITPanel.addComponent(timeField) ;
tx, I’ll let you know when better tested.
regards,
[]s
Marcos Maia.
Thanks Marcos
Glad it was of use. There are a few holes which were cool for our requirements but probably need fixing for a generic solution.
Let me know if you make any improvements
Regards
Richard
Hi! I like your srticle and I would like very much to read some more information on this issue. Will you post some more?
Thanks very much … not sure I have much more to add on this topic apart from get the LWUIT source code down and see how this fits in. Another guy has done a LCDUI port and someone else has had a real stab at Blackberry.
Cheers
Richard
This is another attempt at a full LCUDI port lcduilwuit.googlecode.com
Buy:Prevacid.Nexium.Actos.Prednisolone.Arimidex.Zyban.100% Pure Okinawan Coral Calcium.Lumigan.Accutane.Mega Hoodia.Zovirax.Synthroid.Valtrex.Retin-A.Petcam (Metacam) Oral Suspension.Human Growth Hormone….
…
BUY FASHION. TOP BRANDS: GUCCI, DOLCE&GABBANA, BURBERRY, DIESEL, ICEBERG, ROBERTO CAVALLI, EMPORIO ARMANI, VERSACE…
████████►BUY VIAGRA◀███████…
████████▲▲▲▲▲▲▲▲▲████████…
abilify side effects in children…
Buydrugs without prescription…
Advair@official.site” rel=”nofollow”>.…
Buynow it…
Ampicillin@official.site” rel=”nofollow”>.…
Buynow it…
..…
Buygeneric drugs…
Augmentin@official.site” rel=”nofollow”>.…
Buywithout prescription…
Clonidine@official.site” rel=”nofollow”>……
Buynow…
celexa@canada.now” rel=”nofollow”>.…
Buynow…
Abilify@official.site” rel=”nofollow”>……
Buynow…
Zocor…
Buygeneric meds…
zestoretic co-q10…
Buywithout prescription…
dog zyrtec…
Buygeneric drugs…
Vytorin…
Buynow…
Zyvox…
Buydrugs without prescription…
lioresal online…
Buygeneric drugs…
Zyprexa…
Buydrugs without prescription…
Rogaine…
Buygeneric meds…
howard county purim carnival 2010…
Buyno prescription…
Risperdal…
Buygeneric pills…
low dose haldol and paxil…
Buygeneric drugs…
Tri@Cyclen.now” rel=”nofollow”>……
Buyno prescription…
Soma@Soma.Soma” rel=”nofollow”>.…
Buyno prescription…
Purim@Purim.Purim” rel=”nofollow”>……
Buygeneric drugs…
Singulair@Singulair.Singulair” rel=”nofollow”>……
Buygeneric pills…
Prozac@Prozac.Prozac” rel=”nofollow”>.…
Buygeneric pills…
Singulair@Singulair.Singulair” rel=”nofollow”>.…
Buygeneric drugs…
Prozac@Prozac.Prozac” rel=”nofollow”>..…
Buyit now…
allegra@print.colorado.springs” rel=”nofollow”>……
Buygeneric drugs…
alternatives@to.premarin” rel=”nofollow”>……
Buygeneric pills…
altace@generic.name” rel=”nofollow”>.…
Buynow it…
buy@generic.LEVITRA” rel=”nofollow”>……
Need cheap generic LEVITRA?…
..…
Buywithout prescription…
Order@Cheap.Coral.Calcium” rel=”nofollow”>……
Buygeneric drugs…
Order@Discount.Coral.Calcium” rel=”nofollow”>..…
Buydrugs without prescription…
Purchase@Discount.Coral.Calcium” rel=”nofollow”>..…
Buynow…
Cheap@Coral.Calcium.Online” rel=”nofollow”>..…
Buygeneric drugs…
Buy@Abana.Online” rel=”nofollow”>.…
Buywithout prescription…
Buy@Discount.Abana” rel=”nofollow”>..…
Buygeneric meds…
Order@Cheap.Abana” rel=”nofollow”>……
Buynow…
Buy@Abilify.Online” rel=”nofollow”>.…
Buywithout prescription…
Buy@Cheap.Abilify” rel=”nofollow”>..…
Buynow it…
Order@Cheap.Abilify” rel=”nofollow”>.…
Buynow it…
Purchase@Cheap.Abilify” rel=”nofollow”>.…
Buydrugs without prescription…