Win a copy of TDD for a Shopping Website LiveProject this week in the Testing forum!

Daniel Moore

Ranch Hand
+ Follow
since Dec 12, 2003
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Daniel Moore

Thanks Robert. The good folks at google must have done a killer job on GWT if you spent that much time writing a book and couldn't think of any inconsistencies.

I did end up submitting an issue: http://code.google.com/p/google-web-toolkit/issues/detail?id=1310
14 years ago
GWT
Hi folks,

I was wondering what the biggest incompatibility you've seen between java (the JRE and the language) and GWT generated javascript (running in web mode)? The only one I've seen is this:


Which alerts 'no nfe' in gwt web mode, but when compiled into a java class emits 'nfe' (I haven't tested it in hosted mode).

Any other examples of incompatibilities?
14 years ago
GWT
This techtip may help you: http://java.sun.com/developer/J2METechTips/2002/tt0325.html#tip2

If you're sending images, you can also look at JAI to turn an image from 24 bit to 8 bit color, significantly (3x) decreasing its size.
17 years ago
I'd avoid using perl scripts where possible. Ant has a lot of power, but most folks don't use it beyond the 'compile, test, war' scenario. For instance, you can check modules out from CVS. I like perl, but simplifying your build environment might make maintenance easier.

Also, definitely look at abstracting out properties that differentiate subprojects into properties files. A proper build environment is much like coding--the DRY (Don't Repeat Yourself) principle should be followed wherever possible.

If you're having problems with dependencies, a look at Savant may be worthwhile.
17 years ago
Yup. Here's confirmation that Blackberrys support MIDP 1.0 and CLDC 1.0. (At the bottom.)
17 years ago
Hi Greg.

The jar file needs to be converted into a .cod file, which runs on blackberry. Apparently, there are three ways of doing this.

* Antenna, an open source ant based project.
* Blackberry's enterprise server, which, from what I've read, converts jar files to cod files on the fly.
* Recompiling the code (or importing the jar? not sure here) in the IDE.

I assume you have a blackberry device? If so, you can try just using the antenna wtkrapc task. I'm trying to avoid the IDE, and there doesn't seem to be a way to load the simulator apart from the IDE. But I can generate a .cod file using this task.

The jad file also definitely needs to change. See the "deploy .cod files" section of the BlackBerry_Developer_Guide_Volume_1_-_Fundamentals.pdf available at the RIM website for additional attributes needed in the jad file. (Unless you're using the Mobile Data Service of the Blackberry Enterprise Server, in which case magic seems to happen? Not sure.)

However, I don't believe any code changes have to be implemented, since I believe that the Blackberry implements all of MIDP 1.0. See the document titled Creating_MIDP_Applications.pdf for more info.

Dan
17 years ago
Yes, it does:


For more info, check out the spec.
17 years ago
Thanks everyone for the help.

I got the application down to 64080 bytes, and it installed on the 6200 I have.

The things that helped the most to decrease the jar file size, in order:

1. Eliminating logging (which was just System.out.println statements) by commenting it all out:
perl -p -i -e 's!Log\.!//Log.!' `find . -name "*.java" -print |xargs grep -l 'Log\.'`

2. Combining everything into one file.

3. Combining classes where applicable--not great for polymorphism and oo programming.

4. Eliminating accessors on simple data objects.

I tried jode, which cut down the size significantly, but was getting weird errors from the Nokia (bad stack and others). It also didn't play very nice with image and manifest files.

Thanks for all the suggestions.
17 years ago
In case anyone is interested, here are some numbers on my minaturization(sp?) efforts:

Original obfuscated jar file size: 79848
Removed all logging statements: 71572
Removed logging class: 70582
Removed image: 68968
Condensed all classes into one class file: 66959
Removed another unused class: 66953
17 years ago
Hello,

I'm trying to target the Nokia 6200 with my application. Unfortunately, my application is about 70K when jarred up. According to this page, this device only excepts jar files of 64K. (I'm hoping they're being precise, and mean 65536 bytes, rather than 64000.)

I have done the following to decrease the app's size:

1. Used an obfuscator: proguard 2.0.1 and 2.1 (no size difference, fyi). I'm building with Sun's WTK 2.0.1 on Windows.

2. Removed all the log statements, and the logging class. This was the only extraneous class I could find.

3. Removed images in the application.

4. Tried to make as many variables static and final as possible.

Short of rearchitecting the entire program does anyone have any other suggestions to decrease the size of the jar file?

I've googled this, and didn't find anything really useful. I also searched this forum, but didn't find anything really applicable.

Any help would be appreciated.

Thanks,
Dan
17 years ago
It doesn't look very good. You can grab numeric info: web here, but it also says:
"This technique is useful only in certain limited cases. In particular, it is not sufficient for full textual input, because it does not handle upper and lower case, keyboard shift states, and characters that require more than one keystroke to enter. For textual input, applications should always use TextBox or TextField objects."

Dan
18 years ago
Hi,
To me, there are three benefits to using struts.
1. The struts-config.xml file provides an easy place for anyone familiar with struts to sit down and start learning how an application works.
2. The large collection of helpful classes to deal with common html problems (ie error validation, logging, internationalization)
3. The MVC and taglibs encourage you to keep scriptlets out of jsps.
I remember when I first learned struts I was continually bewildered by the variables and conventions that appeared (to me) to be coming from out of nowhere. But I find that struts is very well documented and a google search for almost any problem will get you most of the way to a solution.
18 years ago
Hi,
I was wondering whether you'd had a chance to look at the JavaServerFaces? My understanding is that JSF relates to struts in the same way that the 1.4 logging API related to log4j. Do you feel like struts and JSF solve the same problem?
Thanks,
Dan
18 years ago
Hi,
I'm not doing any graphics intensive development, but I've had good luck thus far with the Motorala T72x series. Visit the HMotorola Web Page for more information.
It's not too expensive (I've heard $50 bandied about, of course with a one or two year contract), and in the USA is a supported handset for AT&T, at least (not sure where you're from).
Dan
18 years ago
Have you checked out this web page?
18 years ago