×

Discussion Board

Page 1 of 2 12 LastLast
Results 1 to 15 of 16
  1. #1
    Registered User
    Join Date
    Mar 2003
    Location
    Bremen, Germany
    Posts
    106

    J2ME Polish 0.9.2 released: a next generation build tool

    Hi everyone,

    J2ME Polish 0.9.2 has just been released. J2ME Polish is an Open Source build tool with an integrated optional GUI.

    With J2ME Polish you can...

    - optimize your applications without sacrificing the portability
    - use MIDP/2.0 GUI features on MIDP/1.0 phones
    - design your application with simple CSS-textfiles
    - preprocess, compile, preverify, package and create the JAD file for phones.

    You don't need to learn a new API, since the GUI of J2ME Polish is compatible with the MIDP standard. You don't even need to change your source code to use this GUI!

    J2ME Polish is licensed under the Open Source license GPL as well as commercial licenses. The new release features an installer and a sample application which makes the setup really easy.

    Find more information at http://www.j2mepolish.org

    Thanks and best regards,
    Robert

  2. #2
    Registered User
    Join Date
    May 2004
    Posts
    8
    hi,enough

    Can i define a symbol with a value in Polish preprocessing?

    For example:

    //#define SCREENWIDTH 176

    Thanks!

  3. #3
    Super Contributor
    Join Date
    Mar 2003
    Location
    Israel
    Posts
    2,280

    Not an official answer

    I'm not related to the J2ME Polish project, but AFAIK it uses Ant and Antenna for the preprocess/build/package steps.
    With Antenna you can't define symbols like that to be used in the code. I also use Antenna and what I usually do is have a special class where all these layout constants are defined like so:
    Code:
    //#ifdef SERIES60
    public static final int SCREEN_WIDTH = 176;
    //#elifdef SERIES40
    public static final int SCREEN_WIDTH = 128;
    //#elifdef SERIES30
    public static final int SCREEN_WIDTH = 96;
    //#endif
    The result is that I have a constant called SCREEN_WIDTH available which acts just like a #defined constant. Even more, if I obfuscate the code all the places where the constant is used will be replaced with the value, so it's exactly like using #define.

    shmoove

  4. #4
    Registered User
    Join Date
    Mar 2003
    Location
    Bremen, Germany
    Posts
    106
    H shmoove and ykcim,

    of course you can define any variables you like, you can do this by defining it either in the build.xml or in the device-database (devices.xml, vendors.xml or groups.xml).
    You can use variables with the "//#=" preprocessing directive.

    The screen-sizes are all defined in the device-database already, so you can use following code right away without any extra classes or something else:

    Code:
    	//#= private int screenWidth = ${ polish.ScreenWidth };
    	//#= private int screenHeight = ${ polish.ScreenHeight };
    	//#= private int canvasHeight = ${ polish.CanvasHeight );
    You can check if a variable has been defined with the "variable-name:defined" construct:

    Code:
    //#ifdef startUrl:defined
    	//#= private final String URL = "${startUrl}";
    //#else
    	private final String URL = "http://start.com"
    //#endif
    You can even compare variable values:
    Code:
    //#if polish.BitsPerPixel >= 12
    	// this is a hight color device
    //#endif
    
    //#if polish.Vendor == Nokia
    	// this is a Nokia device
    //#endif
    J2ME Polish has an extensive range of predefined variables and symbols and pretty mighty preprocessing possibilities.

    Although it supports all preprocessing directives of Antenna, it is not in any way affiliated with it. J2ME Polish is much more powerful than Antenna.

    Check out more examples at http://www.j2mepolish.org/docs/optimization.html

    Best regards,
    Robert

    http://www.j2mepolish.org
    Last edited by enough; 2004-06-11 at 20:54.

  5. #5
    Registered User
    Join Date
    Mar 2003
    Posts
    7

    Pointer Support

    Is it possible to use Pointer Events on PolishGUI? I am using a Sony Ericsson P900, and it is importand!

    thanks

  6. #6
    Registered User
    Join Date
    Mar 2003
    Location
    Bremen, Germany
    Posts
    106
    Hi Kakoulis,

    Pointer support is scheduled for the 1.1 release, see the http://www.j2mepolish.org/roadmap.html.

    Since J2ME Polish is open source, it's fairly easy to extend. If you (or anyone else here) are interested in adding pointer support, please get in touch with me! I can give you some directions as well as ideas.

    So long,
    Robert

  7. #7
    Registered User
    Join Date
    May 2004
    Posts
    8
    thank you shmoove and thank you Robert!

    and i have another question about whether J2ME Polish can integrate with JBuilderX?

    How can i do?

    micky

  8. #8
    Registered User
    Join Date
    Mar 2003
    Location
    Bremen, Germany
    Posts
    106

    Integrating J2ME Polish into JBuilder

    Hello zkcim,

    to integrate J2ME Polish into JBuilder, use following steps:


    To integrate J2ME Polish into JBuilder it is best to install J2ME Polish (with the included sample application) into a new folder in your workspace called "myproject" (or any other name). Then start JBuilder and create a new project called "myproject".

    In the project-dialog select the appropriate path and confirm the "src" folder as the main source-folder. Switch to the "Required Libraries" tab and select "Add..." and then "New...". Enter "MIDP-Development" or similar as the name of the library and add the files "enough-j2mepolish-client.jar", "midp-2.jar", "mmapi.jar", "wmapi.jar" and "nokia-ui.jar" to the library path.

    Note: only the "midp-2.jar" is actually needed by the sample application, but if you later want to explore the full possibilities of J2ME Polish you already have all important libraries included.

    Now create the new project.

    After the project has been created, you need to integrate the provided "build.xml" file: Select "Wizard" -> "Ant" -> "Add..." and select the file "build.xml" in the project-root. Now the "build.xml" is shown in the project-view. Important: you need to deactivate the Borland-compiler for building the actual applications: Right-click the "build.xml" file, select "Properties..." and de-select the "Use Borland Java compiler" check box.

    You can now build the sample application by right-clicking the "build.xml" file and selecting "Make". You will find the created J2ME application files in the "dist" folder of your project, after you have switched to the "File Browser" view.

    Best regards,
    Robert

  9. #9
    Registered User
    Join Date
    May 2004
    Posts
    8
    Hi Robert

    now I can build the "build.xml" file with JbuilderX
    but when i build it i have noticed a error message:

    "build.xml": file:/Eclipse/workspace/j2mepolish/build.xml:53: ProGuard was unable to obfuscate: The output jar is empty. Did you specify the proper '-keep' options? at line 53

    Why the output jar is empty?

    thanks!

  10. #10
    Registered User
    Join Date
    Mar 2003
    Location
    Bremen, Germany
    Posts
    106
    Hi ykcim,

    this sounds like there was a compile error in a previous run. Run the "clean" target of the build or delete the "build" directory manually, then it should work fine.

    Regards,
    Robert

  11. #11
    Registered User
    Join Date
    May 2004
    Posts
    8
    Hi Robert

    i cleaned the project and then rebuild it but
    it ran error yet.

    but i found some warnings:
    [j2mepolish] Warning: duplicated input class [javax/microedition/media/Control]
    [j2mepolish] Warning: duplicated input class [javax/microedition/media/control/VolumeControl]
    [j2mepolish] Warning: duplicated input class [javax/microedition/media/control/ToneControl]
    [j2mepolish] Warning: duplicated input class [javax/microedition/media/PlayerListener]
    [j2mepolish] Warning: duplicated input class [javax/microedition/media/Player]
    [j2mepolish] Warning: duplicated input class [javax/microedition/media/MediaException]
    [j2mepolish] Warning: duplicated input class [javax/microedition/media/Manager]
    [j2mepolish] Warning: duplicated input class [javax/microedition/media/Controllable]

    BUILD FAILED
    "build.xml": file:/Eclipse/workspace/j2mepolish/build.xml:53: ProGuard was unable to obfuscate: The output jar is empty. Did you specify the proper '-keep' options? at line 53

  12. #12
    Registered User
    Join Date
    Mar 2003
    Location
    Bremen, Germany
    Posts
    106
    Hi ykcim,

    that sounds like you are still using the borland compiler, please make sure that you have deactivated that setting:

    Right-click the "build.xml" file, select "Properties..." and de-select the "Use Borland Java compiler" check box.

    Remove the "build" directory and try again. If it still does not work, do you have problems on the command line as well?

    Cheers,
    Robert

  13. #13
    Registered User
    Join Date
    May 2004
    Posts
    8
    Hello Robert,

    i have always deactivated the Use Borland Java Compiler check box, but the error still occured.

    and either check or uncheck this option the error always occured.

    when i use Eclipse to build the project, this error found again.


    is this my java environment issue?

  14. #14
    Registered User
    Join Date
    Mar 2003
    Location
    Bremen, Germany
    Posts
    106
    Hi ykcim,

    this is getting interesting ;-)

    Can you please tell me all about your platform - which operating system, which SDK, which WTK?

    Cheers,
    Robert

  15. #15
    Registered User
    Join Date
    May 2004
    Posts
    8
    Hi Robert,

    my OS is Windows XP with SP1 and java version is 1.4.2_01

    i installed JBuilderX and JBuilder has WTK 2.0_01

    i think this is useful for you ( all JBuilder build message ):

    Ant
    StdOut
    Buildfile: build.xml

    init:

    j2mepolish:
    [j2mepolish] Processing [13] devices...
    [j2mepolish] preprocessing for device [Nokia/7610].
    [j2mepolish] Warning: unable to find the library [Bluetooth API] on the path. If this leads to problems, please adjust the settings for this library in the file [apis.xml].
    [j2mepolish] nothing to compile for device [Nokia/7610].
    [j2mepolish] obfuscating for device [Nokia/7610].
    [j2mepolish] Jaring took 547 ms.
    [j2mepolish] Reading program jar [D:\Eclipse\workspace\j2mepolish\build\source.jar]
    [j2mepolish] Reading library jar [D:\Eclipse\workspace\j2mepolish\import\midp2.jar]
    [j2mepolish] Reading library jar [D:\Eclipse\workspace\j2mepolish\import\mmapi.jar]
    [j2mepolish] Reading library jar [C:\JBuilderX\j2mewtk2.0\lib\wma.zip]
    [j2mepolish] Reading library jar [import/nokia-ui.jar]

    StdErr

    [j2mepolish] Warning: duplicated input class [javax/microedition/media/Control]
    [j2mepolish] Warning: duplicated input class [javax/microedition/media/control/VolumeControl]
    [j2mepolish] Warning: duplicated input class [javax/microedition/media/control/ToneControl]
    [j2mepolish] Warning: duplicated input class [javax/microedition/media/PlayerListener]
    [j2mepolish] Warning: duplicated input class [javax/microedition/media/Player]
    [j2mepolish] Warning: duplicated input class [javax/microedition/media/MediaException]
    [j2mepolish] Warning: duplicated input class [javax/microedition/media/Manager]
    [j2mepolish] Warning: duplicated input class [javax/microedition/media/Controllable]

    BUILD FAILED

    "build.xml": file:/Eclipse/workspace/j2mepolish/build.xml:53: ProGuard was unable to obfuscate: The output jar is empty. Did you specify the proper '-keep' options? at line 53
    Total time: 4 seconds

    Error executing Ant: C:/JBuilderX/jdk1.4/bin/java -Dbuild.compiler=com.borland.jbuilder.ant.compiler.Bmj -classpath C:\JBuilderX\lib\javac.jar;C:\JBuilderX\lib\jbuilder.jar;C:\JBuilderX\jdk1.4\demo\jfc\Java2D\Java2Demo.jar;C:\JBuilderX\jdk1.4\demo\plugin\jfc\Java2D\Java2Demo.jar;C:\JBuilderX\jdk1.4\jre\javaws\javaws.jar;C:\JBuilderX\jdk1.4\jre\lib\charsets.jar;C:\JBuilderX\jdk1.4\jre\lib\ext\dnsns.jar;C:\JBuilderX\jdk1.4\jre\lib\ext\ldapsec.jar;C:\JBuilderX\jdk1.4\jre\lib\ext\localedata.jar;C:\JBuilderX\jdk1.4\jre\lib\ext\sunjce_provider.jar;C:\JBuilderX\jdk1.4\jre\lib\im\indicim.jar;C:\JBuilderX\jdk1.4\jre\lib\im\thaiim.jar;C:\JBuilderX\jdk1.4\jre\lib\jce.jar;C:\JBuilderX\jdk1.4\jre\lib\jsse.jar;C:\JBuilderX\jdk1.4\jre\lib\plugin.jar;C:\JBuilderX\jdk1.4\jre\lib\rt.jar;C:\JBuilderX\jdk1.4\jre\lib\sunrsasign.jar;C:\JBuilderX\jdk1.4\lib\dt.jar;C:\JBuilderX\jdk1.4\lib\htmlconverter.jar;C:\JBuilderX\jdk1.4\lib\tools.jar;C:\JBuilderX\lib\ant.jar;C:\JBuilderX\lib\optional.jar;C:\JBuilderX\lib\xercesImpl.jar;C:\JBuilderX\lib\xmlParserAPIs.jar org.apache.tools.ant.Main -buildfile build.xml -inputhandler com.borland.jbuilder.build.AntBuildTask$AntInputHandler

Posting Permissions

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