JSF Myfaces issues

Wednesday Sep 01, 2010

Mobile phone dev kit woes

Hello I am working on mobile phone support for the MyFaces jsf.js javascripts, and I want to testify here about the absymality of the mobile phone tools and dev environments.

Now here was the task to push the device support down to Blackberry 4.7 and IE Mobile 6.1.

 I knew it was close to impossible, but I was surprised by the turn of events and how bad things really are.

Dont get me wrong the jsf.js scripts work nicely already with a decent mobile browser (aka every Webkit based one), but I knew some mobile browsers were shoddy and some dev tools absolutely absymal, but I was even surprised by the shoddyness and absymality I encountered in soon to be hopefully phased out mobile land in favor of better tools and newer os and browser versions.

First to the things in Microsoft land. My first thought, what was Microsoft thinking to release this alpha code onto its end users. As an old WinMobile user I knew that the wisest bet is to install Opera instantly and never give a second thought to what Microsoft delivered there, but there are obviously lots of corporate users who are again forced to use this abdomination of a browser (well lets say who are beaten by using it probably by the same people who still force them to use IE6).

 What happened, basic things like jsf.ajax.request(this, event, {}) did not work out because ie mobiles engine could not cope with undefined params the usual way so you have to push a

jsf.ajax.request(this, (window.event)?window.event: event, {})

an insert.before on a sibling in the dom routines suddenly is interpreted as appendChild on the parent node due to the state the vm was in. If you run dom deletions or innerHTML suddenly some input elements are not cleared out etc... the list is pretty much endless but some of it might be emulator related I have to recheck on a real device, I still have somewhere around.But seriously I am not sure if Microsoft ever gave this browser a serious testrun through their QA departement this is not even beta quality, what I had seen here. The plus side is, Ajax itself worked on that browser out of the box, but that was pretty much the only thing outside of javascript prototyping functions, they probably backported it from IE6 because it used the same ActiveX initializing calls. And yes their engine did not have problems with prototype inheritance, thank god, because I have been using this stuff left and right for inheritance and automated delegation basepatterns in my code.

Now if you think you simply start the dev tools and debug the stuff, no chance, I Googled around and the Microsoft devs simply said, alerts is the way to go, have fun... At least logging to a div works via a custom div/console.log meta logger I had implemented for MyFaces in dev mode due to the fact that appendChild is working as expected. And it only took me 4 hours to figure out how to get the emulator working to a degree that I could connect to the net with it after finding it in a blog of a third party person who gave the instructions on now to setup a cradle emulator.

 Nice job Microsoft, and btw. getting the emus up and running in Win7 64 is absolutely impossible, those guys have to revert to a WinXP emu running in Win7, because apparently they never ported some of the needed drivers to Win64 land! You learn that the hard way after downloading all the needed emulators and having installed them by getting an error!


 Now to the other land. Blackberry:

The first run on Blackberry 5 took me about the same time it took me to get the Microsoft emulator up and running to get MyFaces scripts running, about 4 hours. The emulator install was a breeze and worked out of the box.

The browser itself did not show any serious flaws most errors occurred at code where I bended the spec in favor of browser dependend behavior in GlobalEval and a user agent detection was missing on my side which might come in handy but might also not be used. So far nice job. But the goal was not Blackberry 5, right, and debugging would be nice? Well to sum it up after about 4-5 hours I had the first protocol tests running, there are still things failing but nothing serious, it was about 4 days less than it took me to reach the same level for WinMobile IE 6.1. But Blackberry 5 was not the original target, right? And there is the new Blackberry 6 which is finally webkit based, so no problems hopefully there anymore.

Well it should be easy, download the Eclipse based dev tools for Windows (which I run in VMWare btw.) download the device emus for the respective device (4.7 and 6) and get going.

One thing I was really missing was the debuggability of the scripts so on to the dev tools and finally have some decent mobile tools at hand.

The development tools for Eclipse come nicely in a bundlet setup program, so I downloaded Eclipse. The setup program then showed me a dialog wich said choose your directory, well after choosing the dialog appeared again. So redownloading the tool might help, same situation again. I googled around, there was an entry of the year 2009 where the bug was reported and they said they were investigating it and going to fix it. So obviously no one was using the setup program that way or no one was using it in Windows 7. So setting the expected os to WinXP might help, it did not. Also the update site did not work on me due to a dependency error which could not get resolved, I will give it with an older Eclipse version a try again later.

 Ok back to logging and emus then, Downloaded the 6 emulator to see if their Webkit port really was up to the task. After 10 minutes of initiallly booting the emu, I started the browser and instantly got a vm error, a second click on another application crashed the VM entirely.

 Ok I decided since the code works on all other webkit based devices it might work on bb6, and if someone really needs some help on this stuff he really has to donate a device to me, period. I am not going to buy a bb6 for myself just for the sake of community work. (I have a working Android device I am happy with, thank you)

 Well back to the original target bb4.7.0, I downloaded the device emu and it started up, browser started without a hitch and no crash, but... I tried to connect to a site, no chance, so no chance to reach my running server.But at least the emulation did not crash on me. Nice job a stable emulator which does not let you debug javascript code. So rince and repeat the same with the 4.7.1 emulator, which I am downloading currently.

In other words... if I cannot get it up and running then forget me, bb5 will be all I am able currently to support on blackberry land others who can get this up and running can take over...




 


 






Comments:

Post a Comment:
  • HTML Syntax: NOT allowed

Calendar

Feeds

Search

Links

Navigation

Referers