Summary
This article applies to the following:
|
Details
When publishing an application over the wireless network, the application developer may need to access the contents of the corresponding Java® Application Descriptor (JAD) file to read attributes embedded in the file.
The following is a sample JAD file:
Manifest-Version: 1.0 MIDlet-Version: 1.0.1 MIDlet-Name: My App MIDlet-Description: My description MIDlet-Vendor: My Company, Inc. RIM-COD-Module-Name: Sample JAD RIM-COD-URL-1: FileOne.cod RIM-COD-Size-1: 20000 RIM-COD-URL-2: FileTwo.cod RIM-COD-Size-2: 10000 My-Custom-JAD-Property: Hello There!
In BlackBerry Device Software 4.3 and later, the BlackBerry smartphone introduces support for programmatically reading the contents of the JAD file added or modified after the application has been built. This allows a developer to add dynamic content to a JAD file that could be unique for a particular user or installation.
Custom JAD attributes can be read prior to JAD version 4.3.0. However, the custom JAD file attributes must be added to the JAD file before build time and cannot be modified after the application has been built. To accomplish this the JAD file must be added to the project in the BlackBerry Java® Development Environment (BlackBerry JDE) or BlackBerry® JDE Plug-in for Eclipse™. This means that the custom attribute is identical for all BlackBerry smartphone users who install the application and are using BlackBerry Device software 4.3.0 or earlier.
For a MIDlet, JAD file attributes can be read by calling MIDlet.getAppProperty() . For a Connected Limited Device Configuration (CLDC) application that is leveraging the BlackBerry smartphone application programming interfaces (API), JAD file attributes can be read by callingCodeModuleGroup.getProperty() . Examples for each application type are provided below.
MIDlet example:
String description = MIDlet.getAppProperty("MIDlet-Description"); String custom = MIDlet.getAppProperty("My-Custom-JAD-Property");
BlackBerry smartphone API example:
CodeModuleGroup[] allGroups = CodeModuleGroupManager.loadAll(); CodeModuleGroup myGroup = null; String moduleName = ApplicationDescriptor .currentApplicationDescriptor().getModuleName();
for (int i = 0; i < allGroups.length; i++) { if (allGroups[i].containsModule(moduleName)) { myGroup = allGroups[i]; break; } }
// Get the property String description = myGroup.getProperty("MIDlet-Description"); String custom = myGroup.getProperty("My-Custom-JAD-Property");
For more information on JAD files and publishing applications over the wireless network, see theDeploying Java Applications whitepaper.
Note: Auto-start applications that read JAD file attributes should implement a short delay (approximately 1 second) before attempting to read JAD file attributes on its first startup. When an auto-start application is installed it will start up in parallel to the BlackBerry smartphone saving the JAD file information. This can result in a race condition where the application tries to read the attributes before they have been saved, resulting in a failure to access the attributes. This only occurs the first time an application is installed and the BlackBerry smartphone is not restarted during the installation.
|
|
Keywords
deploy, OTA, over the air, JAD, property, read, application, descriptor, MIDlet, CLDC, getAppProperty, CodeModuleGroup
|
分享到:
相关推荐
swift-programmatically, 以编程方式无需 Storyboard 基于编程的以编程方式无需 Storyboard在UITabBarController中以编程方式在中添加制表符func application(application: UIApplication, didFinishLau
- **Contextual Sessions**: Discusses the use of contextual sessions, which allow you to manage the lifecycle of a session within a transactional context. #### Configuration Configuration plays a ...
The book shows a simple internet banking application that is developed incrementally in each chapter of the book and covers the topics mentioned above. You can post your feedback and questions to the ...
submit command., By the end of this book, you will have established a firm understanding of the Spark Python API and how it can be used to build data-intensive applications., Style and approach, This ...
submit command., By the end of this book, you will have established a firm understanding of the Spark Python API and how it can be used to build data-intensive applications., Style and approach, This ...
Q484199 - Documentation - Provide an example of how to use the TcxCustomTreeList.Find function Resolved Issues VCL Subscription B232998 - Documentation - The OnValidateDrawValue event is not ...
Q484199 - Documentation - Provide an example of how to use the TcxCustomTreeList.Find function Resolved Issues VCL Subscription B232998 - Documentation - The OnValidateDrawValue event is not ...
By the end of the book, you will have a thorough understanding of all the data wrangling concepts and how to implement them in the best possible way. What you will learn Read a csv file into python ...
Instead of presenting a dull laundry list of concepts, this book provides the source code to several fun programming projects for adults and young adults. Table of Contents Chapter 1 - Making Paper ...
the way to network-based cultural domain analysis and a marketing study of Sephora cosmetic products. If you cannot find any direct or indirect relationships between the items, but still would like to...
This application is demonstrate the use of flashlight of the camera. You can find complete tutorial of it here: ...
You'll learn how to automate your infrastructure by programmatically calling the AWS API to control every part of AWS. Next, you'll learn options and techniques for storing your data. You'll also ...
Please refer to the Readme.htm file provided with the SMDK for .NET for the latest information on updating your terminal for use with the class libraries and for information on how to deploy your ...
The concept of "on" and "off" values for checkbuttons is explained, including how to set and retrieve these values programmatically. **4.8 Radiobutton Values** Similar to checkbuttons, the values ...