Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Good article... but really depressing

 
Erik Kaellgren
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Write Once, Run Anywhere" not working for phones
"Though MIDP is used in half the world's 1.4 billion phones for downloading other bits of software, writing a program that can run on any handset still isn't possible. From CNetNews.com"
link: http://news.com.com/Write+once%2C+run+anywhere+not+working+for+phones/2100-1037_3-5788766.html

I'm currently working on a project where I have to manipulate the content of a TextField. To my surprise the behavior on the WKF21 emulator and the Nokia 6-series emulator is completely different. It works fine on the first and gives me a NullPointerException on the second.
And it's nothing I can do about it. And maybe on a Motorola handset or Samsung it will be something else.
It's really depressing

The only solution I can see today is to use a Canvas everywhere and do it yourself. And that is a thing I do not want to do or have time to do. It's like coding 15 years ago.

Other people annoyed about this "wild west" behavior from the manufactures?

Write Once, Run Once

Cheers
Erik Kaellgren
 
Debojit Nag
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Really,I am also facing a related problem in my project. I am working with Nokia series-40 phones. But it changes the menu item according to its' feature,ie, independent of the code. for instance it takes out the uppermost menu item as the middle soft key, which is not the case for default emulators.

Whatever.Cheers!
Debojit
 
lexander Bosco
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
erik seems we gat d same problem u could check my post below urs.
am havin the same texfields problem on differnt phones
6600 they come out like normal textfields on some others like 6230 and 6820 they appear like "[..]" then u now have to select the "edit" soft button before it comes up and after editing u select ok and it goes back to the "[...]" state but this time with the text u inputed in it like .."[urname]" .
have u experinced this kinda thing before?
J1
 
Erik Kaellgren
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
jyfhalord1

I might have this wrong, but if not...
In MIDP1.0 when entering text in a TextField, you'll have to do that in another "window" and the click OK. You can see this behavior with the SUN emulator WTK104.
On the contrary, with MIDP2.0 the TextField stays in place and you can enter text like a normal text editor.
These has some consequences though if you your class implements the ItemStateListener interface.
If you want to catch the changes when a user enters text, it works fine with MIDP2 but not with MIDP1 mainly because the text is entered in another "window".
You can easily try that with a simple midlet that uses a simple TextField.


public void itemStateChanged(Item item){
System.out.println("in itemStateChanged " + item.getLabel());
System.out.println("Text " + textField.getString());
}

Hope this explains you problem.

Cheers
Erik Kaellgren
 
lexander Bosco
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
not really
what i mean is on midp2.0 using nokia 6230
it still does d same thing.
u have to select the "edit" soft button before u can actually type ur username or whatever into the textfield
but on midp1.0 using nokia 6600 it comes out as a full sized textfieldand u just type in ur values straight and scroll down to the next field and type in and on and on till u fill the whole form then u select go.
but on the 6230 it does just as indicated above.
i think it phone screen size dependent?
 
Erik Kaellgren
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I was testing a simple TextField on the Nokia emulator device "Nokia_S40_DP20_SDK_6230i" and it behaves exactly the way you describe.
On the Nokia Series 60 emulator it works like you wanted.

Why is it a difference? Probably only Nokia knows or our own "Nokia hacker", the moderator of this forum

Guess is not really much to do about it.

Cheers
Erik
 
Michael Yuan
author
Ranch Hand
Posts: 1427
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually, I think the different behavior of the textbox on 6230 (Series 40) and 6630 (Series 60) is not only intentional but also a good design ...

The MIDP high level UI API is designed to be abstract so that device manufacturers can implement behaviors that are native to their phones. For instance, all the other apps on the 6230 uses the "[...]" style textboxes and 6230 users are "trained" to expect such behavior-- Java application should use the same. The same goes for the 6630 or any other phone -- the textbox tries to emulate the native behavior on each phone.

Of course, if you absolutely need to make the application look exactly the same on all device, you can always use the custom item and draw the textbox yourself.
 
lexander Bosco
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hey mike,

so its only with the custom item i can use to accomplish the uniformity in the textfields appearance?

no probs .. i will check it out.

tanx man.
i will keep i touch of any probs

eric i think i got it solved at d moment.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic