Solved

J2ME: Build package with antenna

Posted on 2004-10-25
665 Views
Last Modified: 2012-05-05
I use IDEA 3.0.5, ant 1.5.1 (1.6.1), and new antenna, WTK2.1
There is example build.xml from Master jimmack
 http://www.experts-exchange.com/Programming/Wireless_Programming/Q_20971796.html#10949699

When I build package (JAR/JAD) with NDS 2.2 for J2ME, package is worked properly.

I don`t understand how ant make (build) all tasks. I can do it, only if I set depends for target.
In second, my JAR is bad. When I build JAR with Nokia DevSuit JAR work properly, but when I run ant (from command line or via IDEA) JAR is bad.
After start midlet phone (or emulator) generate exception:
"A class was not fount during execution. It is possible that preberifying has failed. If you compiled the classes using J2SDK 1.4.1 or later, please check that you used compiler option "-target 1.1",which generates class files gor for all Java SDKs. Also note that the default emulator used for  preverifying must support the APIs which are used by classes in the ckass path."

In task wtkbuild target = 1.1

My package task
<wtkpackage jarfile="${MIDlet-Name}.jar" jadfile="${MIDlet-Name}.jad" basedir="${ProjDir}/classes">
      <fileset dir="${ProjDir}/res"/>
      <manifest>
        <attribute name="Built-By" value="${user.name}"/>
        <attribute name="MicroEdition-Configuration" value="${ME-Conf}"/>
        <attribute name="MIDlet-Name" value="${MIDlet-Name}"/>
        <attribute name="MIDlet-Icon" value="/${MIDlet-Icon}"/>
        <attribute name="MIDlet-Version" value="${MIDlet-Version}"/>
        <attribute name="MIDlet-Vendor" value="${MIDlet-Vendor}"/>
        <attribute name="MIDlet-1" value="${MIDlet-Name}, /${MIDlet-Icon}, ${MIDlet-Class}"/>
        <attribute name="MicroEdition-Profile" value="${ME-P}"/>
      </manifest>
    </wtkpackage>
0
Question by:yobser
    2 Comments
     
    LVL 13

    Accepted Solution

    by:
    I can't under stand this statment "I don`t understand how ant make (build) all tasks. I can do it, only if I set depends for target"

    Second ur ant build.xml must do the following:

    1- Preverify after compiling the classes
    2- package the JAR with the right MANIFEST.MF that its attributes match the correspondnet in urapp.jad file
    3- the JAD file msut contain the right jar size in attribute MIDlet-Jar-Size

    refer to the build.xml of the smart ticket demo at:

    http://java.sun.com/blueprints/code/index.html

    good luck
    0
     

    Author Comment

    by:yobser
    I mean "make all target, if I don`t set depends". I know answer ;-) NOHOW

    I`ll attempt your link.
    0

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Give your grad a cloud of their own!

    With up to 8TB of storage, give your favorite graduate their own personal cloud to centralize all their photos, videos and music in one safe place. They can save, sync and share all their stuff, and automatic photo backup helps free up space on their smartphone and tablet.

    Suggested Solutions

    Hopefully this article will help someone who's had the same issues I had. I have a Dell Wireless 1390 WLAN Mini-Card and Windows 7, and for the past couple of days I was beyond frustrated because my wireless laptop was not able to access the Inte…
    Today sees the launch of a new case study, focusing on BYOD technologies we have been working with for some time now.  But with the advent of 802.11ac wireless technologies and the story behind our landmark developments, we would like to share this …
    This Micro Tutorial will show you how to maximize your wireless card to its maximum capability. This will be demonstrated using Intel(R) Centrino(R) Wireless-N 2230 wireless card on Windows 8 operating system.
    Viewers will learn how to connect to a wireless network using the network security key. They will also learn how to access the IP address and DNS server for connections that must be done manually. After setting up a router, find the network security…

    933 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now