Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Web and WebWorks Development

Reply
New Contributor
twingocerise
Posts: 3
Registered: ‎12-30-2010
My Device: STORM 9800
My Carrier: VODA

GWT and OS7 don't play well together

If you ever wonder why your GWT app doesn't start on a blackberry OS7, you might be experiencing the same problem I had a week ago. I spend a couple of hours investigating and basically, if you try to perform a Integer.parseInt, it fails miserably. Nothing in the logs, nothing in the console, etc. Debugging the JS gwt code I found that it's checking on the min/max value of an int. And guess what? OS7 browser doesn't support them. That looks like a dodgy bit overflow problem... I put a little test case together on StackOverflow for you to understand the problem. Here's a copy of it:


<html>
  <body>
    test page
    <script>
          i = 0;
          if(i < -2147483647) {
             alert("very low")
          } 
          if(i < -2147483648) {
             alert("very very low")
          } 
          if(i < -2147483649) {
              alert("very very very low")
          }
     </script>
  </body>
</html>


Surprisingly, the phone comes up with the message "very very low".

So, solutions I'm considering are:

  • Don't use Integer.parseInt - use Long.parseLong instead or something like that - well... that might be acceptable for some people...
  • Override the Integer class and change the parseInt method to check the value on a bit less than -2147483648 - or enforce the use of a long.
  • Hope and pray that RIM will fix it asap... and that everybody updates... ?

Are you guys experiencing the same problem? Any other idea how to fix it?

Please use plain text.
BlackBerry Development Advisor (Retired)
Tohman
Posts: 34
Registered: ‎10-24-2011
My Device: Curve
My Carrier: Telus

Re: GWT and OS7 don't play well together

[ Edited ]

The source of that issue is in browser and (nothing to do with GWT itself) and will be fixed in latter OS updates.

Please make sure that your work around won't break when issue is resolved.

 

Thanks.



1.Please resolve your thread by clicking the "Accept as Solution" button below the post which solved your problem!
2. If any post helps you please click the button below the post(s)
Please use plain text.
New Contributor
twingocerise
Posts: 3
Registered: ‎12-30-2010
My Device: STORM 9800
My Carrier: VODA

Re: GWT and OS7 don't play well together

yes I know! I thought it was clear with the testcase I provided, wasn't it?

 

So what's going to happen now? When is that going to be solved? 7.2? 7.3? 8.0?

Please use plain text.
BlackBerry Development Advisor (Retired)
Tohman
Posts: 34
Registered: ‎10-24-2011
My Device: Curve
My Carrier: Telus

Re: GWT and OS7 don't play well together

The fix should be in the next release of 7.1, I wouldn't coun't that 7.0 will have that fix, at least not soon.



1.Please resolve your thread by clicking the "Accept as Solution" button below the post which solved your problem!
2. If any post helps you please click the button below the post(s)
Please use plain text.