USERNAME PASSWORD LOST PASSWORD? REGISTER
"A Complete Mobile Application Development Environment"
Advertisement

Downloads
Documentation
Forums
Blog
Press
Bug Tracking
Creator IDs
Contact Us




Creating a Mobile-Ready Java MIDlet PDF Print E-mail
Documentation »  ACCESS Linux Platform Native Development »  Java Programmer's Guide »  Creating a Mobile-Ready Java MIDlet

The following sections describe the packaging requirements for your Java MIDlet and include the following topics:

Design Considerations ^TOP^

In general, when designing applications that run on ACCESS Linux Platform JV-Lite2, you should keep in mind the following:

  • The ACCESS Linux Platform is designed to run on a many devices with different screen sizes, orientation (vertical or horizontal, or rotating), and color palettes.
  • Handheld, mobile, and cell phone devices impose limits on the size of your application.
  • Many Java applications have been written for phones with soft keys so you need to be aware of how key mapping will work with JV-Lite2. For more information about key mapping, see "Key Mapping," in Chapter 3, "Running Java MIDlets."
  • Once the user installs your Java application or game, it will automatically appear in the Applications Launcher.

NOTE: Most carriers will pre-install the Java VM on a device. In some rare cases the user may need to install the JVM on the device.

Installation Packages ^TOP^

For your application to run on ACCESS Linux platform it must conform to the J2ME specifications, applicable JSRs, and be packaged as a .jar file. You may also want to provide a .jad file to specify information about your application.

The following sections describe the .jar and .jad files in more detail.

Java Application File Formats ^TOP^

JV-Lite 2 Java applications are supported in the existing .jar (Java Archive) file format. This flat format supports transmission as well as execution (Java virtual machines support direct execution from .jar files).

MIDlet Suites are commonly packaged with.jad (Java Application Descriptor) file. These .jad files contain information about the Java MIDlet such as application size that allow the user and/or device to understand the requirements for the application. The .jad file is used with the .jar file to package Java applications such as games for downloading to mobile devices. JAD files contain information about the MIDlet including:

  • MIDlet-Name - The name of the application
  • MIDlet Version - The application Version number
  • MIDlet-Vendor - The originating organization
  • MIDlet-JAR-URL - The path for the .jar file
  • MIDlet-JAR-Size - The file size in bytes

However, some MIDlets are packaged only in .jar file formats without a .jad file. The ACCESS Linux Platform JV-Lite2 allows users to run files downloaded as:

  • Only.jar files
  • Both.jar and .jad files

The .jad file can be useful when downloading MIDlet Suites. These are multiple Java applications that are bundled together. The .jad file contains descriptive information about each application. The user can view that information to determine if they want to download specific files from a suite or the entire MIDlet Suite.

Icon Formats ^TOP^

The Icon file type for a .jar file is always .PNG.

The Launcher displays a single icon for a MIDlet or MIDlet Suite. The user will be able to select a MIDlet from a MIDlet Suite.

Bundle Manager ^TOP^

ACCESS Linux Platform features a Bundle Manager that is the channel through which all third-party applications are loaded on to a device. For more information about application development and security, see the ACCESS Linux Platform Applications Programming Guide.

Switching to Native Applications and Pausing ^TOP^

The ACCESS Linux Platform displays only one primary application at a time. Java MIDlets are considered applications so the user can switch to other applications. ACCESS Linux Platform provides some support for pausing and switching from a Java MIDlet application to a native application without needing to reset the Java MIDlet application.

A native application shows up as a primary application on the Launcher. These native applications include the Browser, Calendar, Telephony applications, Contacts and others.

The user can switch to some native applications such as the following:

  • Browser to handle http:// and https:// schema
  • Telephone for handling Tel: schema
  • Native video player for rtsp:// schema

The capacity to pause a MIDlet and switch to other applications is not inherent. You must provide support for switching from your MIDlet to another native application by calling the Java method platformrequest. Refer to the Java.com website for information about available Java methods.

Although ACCESS Linux Platform allows users to switch from the MIDlet to other native application, you cannot run your MIDlet in a background execution mode. If your MIDlet triggers another native application as the primary application, the MIDlet remains paused (not running in the background) until the user resumes it by selecting the MIDlet in the Jumplist.

The user's experience in interacting with a switch-enabled MIDlet is as follows:

  • When the user switches to another application or the MIDlet switches based on an event such as a Telephone call, the Java MIDlet pauses operation and the other native application becomes the primary application.
  • The Java MIDlet application will appear in the Jumplist so that the user can resume using it.
  • When selected from the Jumplist, the Java MIDlet application resumes activity from the point where the user switched to another application.

Running the MIDlet in the Simulator ^TOP^

Once you have developed your Java MIDlet application, you can run it in a simulator. The ACCESS Linux Platform contains a standard simulator that enables you to run and test your applications.

After installing the ACCESS Linux Platform SDK, you run the ACCESS Linux Platform simulator from the command-line with the following command:

alp-sim

You can view the command-line options for running the simulator with the following command:

alp-sim --help

You can also run the simulator from the Linux GUI menu by selecting: Applications -->Programming -->ACCESS Simulator.


NOTE: The alp-simulator command is now a subset of alp-sim. You can use it to run the simulator but use of alp-sim is preferred.

For more information about running applications in the simulator, see the "Testing and Debugging" topic in the ACCESS Linux Platform Applications Programming Guide.

To manually install the your application ^TOP^

Once you develop your Java MIDlet, to run it in the simulator you will need to manually install it so that it appears in the Launcher. The following example illustrates the use of the alp-bundle command to install a Java MIDlet:

alp_bundle --install /path/to/jad/or/jar/file

You have several options for getting your Java application onto your system for installation into the simulator. You can:

  • Download your .jar file from a website using the simulator Browser." For more information about downloading from the Browser, see "Download from Web to Device."
  • HotSync your .jar file from your desktop into the simulator using the HotSync application. For more information about downloading using HotSync, see "HotSync Java Applications from PC to Device."
  • Manually move your .jar file into the simulator. For more information about the simulator, see Chapter 10, "Testing and Debugging," in the ACCESS Linux Platform Programming Guide, Document Number 1000-007.

Figure 2.1  Example of Installed JBenchmark.jar

Security ^TOP^

Users face a number of security concerns when downloading Java applications to their mobile devices. The Java Virtual Machine provides security prompts so the user can allow or deny authorization for any application.

When users download a Java application using the ACCESS Linux Platform Browser, they can download both signed and unsigned applications. User's can view the .jad file information by selecting the information button that appears on the download dialogs.

Signed and Unsigned Applications ^TOP^

Application certification enables developers of Java MIDlets to package and distribute signed applications creating increased confidence in the security of the application.

Digitally signed Java MIDlet applications provides greater permissions latitude for the Java MIDlet application.

 

Add as favourites (71) | Quote this article on your site | Views: 2077

Be first to comment this article
RSS comments

Only registered users can write comments.
Please login or register.

Powered by AkoComment Tweaked Special Edition v.1.4.6
AkoComment © Copyright 2004 by Arthur Konze - www.mamboportal.com
All right reserved

 


© 2008 ACCESS Developer Network    |    Joomla! is Free Software released under the GNU/GPL License.    |    ACCESS Global Website
Events Support Community Platforms Home