Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User santoshc's Avatar
    Join Date
    Nov 2008
    Posts
    19
    hi there,

    in my app's about box, i want to display the midlet's vendor name, version, etc as defined in the jad attributes. In netbeans, these are defined in the project properties. Now, can I read them through the pre-processor in my code, like:
    String version = "";
    //#= version = ${MIDlet-Version};
    System.out.println ("version: " + version);


    This is not working, so there must be some other syntax for this. I am looking for what that is. Thanks.

  2. #2
    Nokia Developer Champion jappit's Avatar
    Join Date
    Nov 2007
    Location
    Rome, Italy
    Posts
    2,391
    Hi santoshc,

    check out the MIDlet getAppProperty() method:

    http://www.forum.nokia.com/document/...va.lang.String)

    Pit

  3. #3
    Registered User santoshc's Avatar
    Join Date
    Nov 2008
    Posts
    19
    Pit,
    I want these parameters hardcoded in the binary at the build time. Note that, in addition to the midlet attributes, I would also be embedding some of the preprocessor variables. For example, if I am building jar files seperately for s40 and s60 platforms, built seperately though preprocessor variables, i would like the midlet to tell me exactly which version I am using.

    I can embed these paramters in the jad file, but I would like to consider that as the last option. Is there any other way to embed pre processor variables in the code? for example, j2me polish has this preprocessor directive //#= which embeds whatever follows on the line as is. I dont see this directive in netbeans. Any idea, if I can do it through my build scripts in netbeans? Thanks.

  4. #4
    Nokia Developer Champion Tiger79's Avatar
    Join Date
    Apr 2007
    Posts
    2,697
    j2mepolish can do that because they have their own ant scripts running as preprocessors, or at least thats as far as i understood when i looked at it...
    so u might want to implement ur own ant scripts for that purpose, i'd like to help but i wouldnt even know where to start

  5. #5
    Nokia Developer Champion jappit's Avatar
    Join Date
    Nov 2007
    Location
    Rome, Italy
    Posts
    2,391
    If you're using NetBeans, then this page should definitely help:

    http://www.netbeans.org/kb/55/preprocessor-syntax.html

    Pit

Similar Threads

  1. Carbide.j 1.5 unstable with Netbeans 5.5?
    By kalgik in forum Mobile Java Tools & SDKs
    Replies: 7
    Last Post: 2007-05-18, 01:11
  2. integration Carbide.j 1.0 and Netbeans 5.0
    By ovjo12 in forum Mobile Java Tools & SDKs
    Replies: 0
    Last Post: 2006-02-16, 07:48
  3. NetBeans 4.1 Early Access Release Now Available
    By rdemmer in forum Mobile Java General
    Replies: 0
    Last Post: 2004-10-22, 14:52
  4. Replies: 0
    Last Post: 2004-08-25, 11:42

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved