Mobile web and HTML inside JavaME with LWUIT
Anyway, that's about it - hope you'll find this new piece of software helpful for your innovative mobile project, any comments and feedback will be appreciated so we can further develop this technology.
Posted by Ofir Leitner at 12:40 PM
Labels: html, j2me, lwuit, sun
16 comments:
ali said...
omg this sounds amaxing!
February 20, 2010 7:44 PM
Nicolas said...
hi Ofir this is awesome.
I'd like to try it, but I don't know how.
I have checked LWUIT sources out but:
* I can't get it compiled in netbean
* nor can I find the HTMLComponent class in the sources
do I miss something here ?
can you please provide more information ?
Can I use the current LWUIT stabe version and import in my project only classes related to HTMLComponent (so I don't have to recompile LWUIT jar) ?
Can you please provide the sample code demonstrated in the video ?
alternatively can you provide the LWUIT beta jar you are using ?
thanks for this work, Nicolas.
March 16, 2010 10:36 AM
Ofir Leitner said...
Thanks Nicolas. The HTMLComponent is already available at the LWUIT SVN under the com.sun.lwuit.html package.
To check out the latest version go to:
https://lwuit.dev.java.net/source/browse/lwuit/
You should see there detailed instructions how to check it out via SVN - the relevant folder is trunk/MIDP/LWUIT
The sources for the MWCParties app are not available but there's a demo project called LWUITBrowser in the same SVN - under the trunk/MIDP/Applications folder
I'm not sure which version you are using currently, but importing only the html package and adding to an existing JAR is probably not going to wokr and even if so, is not a good idea - as HTMLComponent was built on the latest LWUIT and you might be missing some methods or having different functionality, so I suggest to spare the headache and just use the new LWUIT.
March 16, 2010 10:53 AM
Ricardo said...
when we can see some sketchs of javascripts there?
March 23, 2010 6:46 PM
Ofir Leitner said...
JavaScript is not supported in XHTML-MP 1.0, and going beyond that standard is currently not in our roadmap.
The purpose of HTMLComponent is to give an immediate and robust solution for the need to render rich text and use web flows in JavaME apps. Even without JavaScript the component, combined with LWUIT capabilities enables creating a great experience.
One of the strongest use cases is when the developer serves his/her own HTML content, and then since they're in full control, they can write it without JavaScript.
In other cases, when using 3rd parties sites, a lot of the mobile-adapted sites make do without JavaScript or written without it altogether and this includes Facebook, Twitter and many more.
Also to be realistic, implementing JavaScript would require implementing quite an extensive interpreter and is currently way out of scope.
March 23, 2010 6:57 PM
Diego said...
Friend'm desperately looking for the component HTMLComponent but I do not match any in place, it is at https: / / lwuit.dev.java.net/source/browse/lwuit/ver1.3/MIDP/LWUIT/src/com/sun/lwuit /? rev = 913 in the most ecent (1.3) help please send ma a link or anything for me to download the file !!!!!
March 26, 2010 11:59 PM
Ofir Leitner said...
You're looking at the wrong place - under ver1.3 you will find LWUIT drop 1.3 which does not include the component.
Instead look under trunk/midp - you'll find there the latest sources which include HTMLComponent.
March 27, 2010 12:16 AM
Diego said...
Thanks!!!
March 27, 2010 1:03 AM
rgucci said...
How easy is it to include this in the BlackBerry port?
March 29, 2010 12:46 PM
Ofir Leitner said...
Shouldn't be too difficult - like most of LWUIT, HTMLComponent is lightweight, meaning it does not rely on the platform's native implementation - so it should work properly on BlackBerry.
The only part that does rely on the platform is the network operations done in HttpRequestHandler in the LWUITBrowser project (Which is not a part of LWUIT but rather an external project demoing HTMLComponent).
However even this I believe shouldn't give you too many (if any) problems on BB.
March 29, 2010 12:54 PM
rgucci said...
I've done a quick try, and yes it works on the BlackBerry and I can display remote sites like m.google.com, m.facebook.com, etc. The parser croaks a bit on xmlns attribute in HTML tag, but after turning off parsing errors for now, it can display the page.
What I can't seem to find a way to do is to change the focus style for links inside the component (I can't see which link is currently focused!).
And one more thing, when the HTML component gets focus, I can't get the focus out of if to go to other controls in the form.
Any ideas?
March 29, 2010 1:49 PM
Ofir Leitner said...
Since this post is turning into a support forum, let's do this - please repost your question in the LWUIT forum, and I'll answer it there:
http://forums.java.net/jive/forum.jspa?forumID=139
This way also other users can enjoy the knowledge base.
March 29, 2010 1:56 PM
todaterca said...
Which are the mininum requirements for it? I tried LWUITBrowser in this cell (http://www.gsmarena.com/lg_gb230_julia-2910.php) and it didn't work. I can run others LWUIT trunk apps with no problem.
thank you,
Eder
July 6, 2010 12:49 AM
Ofir Leitner said...
LWUIT itself requires 2MB heap space as a minimum requirement. Though it can work depending on what you use with less.
However, HTMLComponent is one of the heavier components and will definitely require you to have that space at least, and depending which pages you use it to view, may require more.
If it doesn't work you can try to set the CLEAN_ON_PAGE_REQUEST in HTMLComponent to true, and then whenever a page loads, the previous page is immediately wiped out of memory.
July 6, 2010 10:15 AM
Daydah said...
Hi Ofir,
I think you're the answer to my probs right now. The Forum link you posted does not work by the way.
I have used LWUIT 1.3 and now LWUIT 1.4 effectively but I have a tiny hill in front of me right now.
I need to be able to send the app user to the registration page by a button click.
Because our device range is very large, I need to send the user to the phone's browser.
Anyhow HTMLComponent can help me do that?
Thanks in advance
May 26, 2011 12:05 PM
Ofir Leitner said...
Yes - you can intercept the link click at HTMLCallback.linkClicked and then instead of returning true - just activate platformRequest on the link and return false.
June 3, 2011 3:08 PM