×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Mar 2003
    Posts
    1

    Questions about using a preprocessor

    I'm a final year uni student and for my final project i intented to develop a game in J2ME for a 40 serries nokia. I am only just entering the development process, and have a few questions.
    I've seen several mentions of using a preprocessor on java code but little of the how and why.
    My questions:
    1. Is the only benifit a smaller .jar and if so how does it accomplich this?
    2. One person has said they use the visual C++ preprocessor and then compile with Ktoolbar? How do you compile code thats gone through a c++ preprocessor?
    3. Does anyone know a good resource that fully explain this. All the books\net sites i've found mention it in passing or not at all.

    Thank you anyone who can help me with this.

  2. #2
    Registered User
    Join Date
    Mar 2003
    Location
    Russia, Saint-Petersburg
    Posts
    40

    RE: Questions about using a preprocessor

    a preprocessor is good when you want to get final sources (to remove all debugging info as an example)... I think the using of C++ preprocessor is a bad idea because if you will have pure C++ preprocessing directives in java sources, you will not be able to compile that sources without preprocessing.... of course preprocessing allows to really decrease jar size of midlet because you remove not used code from sources... i use my own preprocessor for midlet developing...
    A lot of useful things for a mobile developer on http://www.igormaznitsa.com

  3. #3
    Registered User
    Join Date
    Mar 2003
    Posts
    17

    RE: Questions about using a preprocessor

    In reply to 1) a preprocessor is useful for maintaining a single code base that produces different builds for different platforms e.g. a Series 40 build, a Series 60 build, a Motorola build etc. This makes the code smaller as you don't need to include code for other platforms in a build, however, that approach make provisioning harder as you have many jar files. As you are only targetting Series 40 this probably doesn't concern you.

    From memory Nokia also recommended using a preprocessor for string constants in preference to declaring a final static String as this reduces the class file size (this was in their document relating to Midlet performance).

    3) Seek out Nokia's performance document. That has some other good recommendations on reducing Midlet size. I assume you have researched using an obfuscator?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×