Reputation: 309
This can be done by
1. Extracting jar to get manifest file
2. Read all lines and concatenate long lines which are distributed in 70 characters lines
3. Add two extra attributes i.e MIDlet-Jar-Size and MIDlet-Jar-URL
But I want to know is there any other way like class or library in java which handles everything? Also is there something similar for editing manifest file programmatically?
Upvotes: 1
Views: 3624
Reputation: 80
JAD (Java Application Descriptor) file is used mainly for OTA (Over-the-Air) download of MIDlets. Nokia PC Suite Application Installer also uses information in JAD file. JAD file is a plain text file which explains the major parameters of a MIDlet. There are five required paramets and a few commonly used optional ones.
JAR (Java Archive) is a file which contains MIDlet class file, other classes referred to by MIDlet and resource files. It also contains Manifest.mf text file, which has mostly the same information as JAD file.
JAD and/or Manifest are used by JAM (Java Application Manger) in the phone to check that the MIDlet is valid and to fetch the JAR and install the application.
Basically JAR and JAD don't need to be in the same directory as JAD contains parameter "MIDlet-Jar-URL: MyMidlet.jar". This parameter tells JAM where JAR file can be found. Most commonly they are in the same directory.
Upvotes: 1
Reputation: 20244
Use an IDE like Eclipse or NetBeans.They Automatically create .jar and .jad files once you run or build them.You can also edit the manifest file within the IDE.
I recommend the Eclipse IDE.I installed NetBeans some time ago and it Hangs a lot.
Upvotes: 1