In J2ME development, what is the purpose of the jad file? How is it used in conjunction with the application's jar file to install on a cell phone/other limited device?
People succeed in answering Dane Summers's questions 40% of the time (6 successes in 15 attempts).
Answers by: JSO1
The JAD (Java Application Descriptor) file tells the application management software (AMS), the piece of software on the hardware (cell phone, etc) responsible for managing J2ME applications, how to handle your application, including installation, identification, and retrieval.
Your JAR file will, of course, contain your application's compiled byte classes, resources, and manifest file.
The JAD file provides a number of features including:
-Specifying an information URL for your application
-Associating your application with specific media types
-Categorizing your application into a folder
-Notifying you on successful installation
How your hardware uses the JAD is dependent on the method for uploading your application to the hardware device. If you are using OTA (over the air) method, then typically you will host your JAD and JAR file on a webserver and specify the URL on the hardware device.
Hope this helps - let me know if you need additional information!
Yes, one follow up on that (great overview in general though, thanks!). So I notice that some devices (eg a couple Sony Ericssons I've used), I don't need to use the JAD to install an application (bluetooth file exchange).
Is the JAD something you would point your phone browser to provide the cell phone general information about the application (checksum, URL to jar, manufacturer, etc)? From the JAD the cell phone would know where to download the Jar?
Or is this more of a device dependent requirement, like some phones just need the Jar, and some need both the Jar and JAD?
Some devices do not require the JAD, but most do - so it's best practice to provide a JAD. Non-OTA (Over The Air) methods are typically proprietary and not part of the standard which explains why some of the Sony Ericsson models utilizing Bluetooth File Exchange don't need the JAD.
You're absolutely right - the JAD is a rather simple file that provides the device with information about the application. And yes, from the JAD, the device can know where to download the JAR using the MIDlet-Jar-URL property . A lot of it is device dependent based on the devices and carriers implementation.
thanks!