Specific exemplary embodiments of the invention now will be described with reference to the accompanying drawings. This invention may, however, be embodied in many different forms and should not be construed as limited to the embodiments set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the invention to those skilled in the art. The terminology used in the detailed description of the particular exemplary embodiments illustrated in the accompanying drawings is not intended to be limiting of the invention. In the drawings, like numbers refer to like elements.
As used herein, the singular forms “a”, “an” and “the” are intended to include the plural forms as well, unless expressly stated otherwise. It will be further understood that the terms “includes,” “comprises,” “including” and/or “comprising,” when used in this specification, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof. It will be understood that when an element is referred to as being “connected” or “coupled” to another element, it can be directly connected or coupled to the other element or intervening elements may be present. Furthermore, “connected” or “coupled” as used herein may include wirelessly connected or coupled. As used herein, the term “and/or” includes any and all combinations of one or more of the associated listed items.
Unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs. It will be further understood that terms, such as those defined in commonly used dictionaries, should be interpreted as having a meaning that is consistent with their meaning in the context of the relevant art and the present specification and will not be interpreted in an idealized or overly formal sense unless expressly so defined herein.
As used herein, a “terminal” includes both devices having only a wireless signal receiver without transmit abilities and devices having both receive and transmit hardware capable of two-way communication over a two-way communication link. Such devices may include cellular or other communications devices with or without a multi-line display; Personal Communications System (PCS) terminals that may combine a voice and data processing, facsimile and/or data communications capabilities; Personal Digital Assistants (PDA) that can include a radio frequency receiver and a pager, Internet/Intranet access, Web browser, organizer, calendar and/or a global positioning system (GPS) receiver; and/or conventional laptop and/or palmtop computers or other appliances, which include a radio frequency receiver. As used herein, “mobile terminals” may be portable, transportable, installed in a vehicle (aeronautical, maritime, or land-based), or situated and/or configured to operate locally and/or in a distributed fashion at any other location(s) on earth and/or in space.
Referring now to
As shown in the embodiments of
In some embodiments of the present invention, the API attribute list generation module 160 is configured to initialize the list of all required classes 150 and the list of all required bundles 162 to an empty set and to format and identify a group of Java class files associated with the Java application as an API attribute list, which may be included with a descriptor associated with the Java application. More particularly, the API attribute list generation module 160 may be configured to generate the API attribute list by carrying out operations as will be described with reference to
In some embodiments of the present invention, the class identification module 161 is configured to identify all Java class files associated with a Java application. The class identification module 161 may be configured to identify all Java class files contained in a Java application and to identify all Java class files referenced in the Java class files contained in the Java application. As will be described for some embodiments herein, the Java class files contained in the Java application need not be included in the API attribute list as they are contained in the application and, thus, supported by a downloading device once the Java application is downloaded. Similarly, a referenced Java class file that is also contained in the Java application also need not be included in the API attribute list.
By way of background, a Java class file generally contains executable byte codes. For example, a J2ME Java application is typically stored in a Java architecture (JAR) file, which generally contains several class files and other resources. Inside each class file there is generally included information about any other classes that are referenced by the class. As such, a list of required classes, in some embodiments of the present invention, may be generated by inspecting fields in the JAR file, such as constant pool, super class, interfaces and fields.
It will further be understood that, in some embodiments, there may be one or more different versions of any given recorded Java class. The implementation of a class may be different from device to device and different class implementations or versions may support different public and protected methods and fields. As such, in some embodiments of the present invention, the required class identification module 161 further determines the version of the required classes. Such information may be available as a method/field signature for a class or bundle definition.
A communication system, such as a mobile terminal, in according to some embodiments of the present invention will now be described with reference to the block diagram illustration of
As further shown in the embodiments of
In some embodiments of the present invention, API list generation module 160 and the required class identification module 215 may be configured to operate on Java applications downloaded to the communication system 200 substantially as described previously for the required class identification module 161. Similarly, API attribute list generation module 235 may be configured to operate on Java applications downloaded to the communication system 200 substantially as described previously for the API list generation module 160. As also shown in the embodiments of
While embodiments of the present invention have been illustrated in
Operations for controlling downloading of a Java application according to some embodiments of the present invention will now be described with reference to the flowchart illustration of
An API attribute list included in the descriptor is retrieved (block 310). The API attribute list identifies all Java class files referenced by the Java application. For example, in some embodiments of the present invention, the API attribute file is added to the application's JAD file. The API attribute list may provide a list of all the required APIs (classes) for a given Java application, such as a MIDlet. As will be further described herein, the list of APIs can be generated automatically by a server, which analyzes each of the class files in a JAR file or the like. For example, an API attribute list might include the following: java.lang.Boolean, java.lang.Byte, . . . , javax.microedition.midlet.MIDlet, javax.microedition.io.Connection, . . . , javax.microedition.media.Player, . . . com.mascotcapsule.micro3d.v3.Vector3D.
It will be further understood that the listed APIs or identification of Java classes will typically include one or more package identifications, where the package identifies a corresponding set of classes. It is known to organize Java classes into packages. Examples of such known Java class packages include java.io, com.sun.io, and com.sonyericssonj2me.sdk. Such packages (sometimes referred to as libraries) are a way of grouping related classes. A class is generally uniquely identified by its fully qualified class name, which typically includes the package name followed by the class name. For example, java.io.InputStream identifies the InputStream class that is a member of the java.io package. The term “bundle” as used herein includes, but is not limited to, Java packages.
The use of bundle identification, rather than individual listings of every class in the API attribute list, may potentially provide a significant reduction in the length of the API attribute list, which has a potential to be fairly lengthy as it lists out every single class that is referenced by the Java application. Thus, to shorten the length of the attribute list, the concept of API bundles may be utilized. For example, the Mascot Capsule v3 API typically includes the following classes: ActionTable, AffineTrans, Effect3D, Figure, FigureLayout, Graphics3D, Light, Texture, Util3D, Vector3D. Instead of listing each individual class, the set of classes may be referenced as a bundle. An example bundle identification is: com.mascotcapsule.micro3d.v3.[REVA], where the [REVA] refers to a specific revision of the API which includes a set of classes. By way of further example, if an application requires CLDC1.1 and MIDP2.0, the API attribute may be set to Javax.microedition.[CLDC1.1], javax.microedition.[MIDP2.0] that will refer to all the classes in the Java and Javax packages that are required.
The retrieved API attribute list is compared to a list of Java class files supported by the mobile terminal to determine if the mobile terminal supports the Java application (block 315). Operations for controlling downloading of the Java application based on the comparison at block 315 will now be described with reference to blocks 320 to 330. If the terminal supports the application (block 320), the Java application is downloaded (block 325). If the mobile terminal does not support the Java application (block 320), a user of the mobile terminal is notified that the mobile terminal does not support the Java application (block 330).
Methods for generating an API attribute list for a Java application according to some embodiments of the present invention will now be described with reference to the flowchart illustration of
Operations related to identifying all Java class files associated with the Java application will now be described with reference to blocks 410 and 415 are identified (block 410). All Java class files contained in the Java application are identified (block 410). All Java class files referenced in the Java class files contained in the Java application are also identified (block 415). Operations as will now be described with reference to blocks 418 through 440 are then carried out for each referenced Java class file identified at block 415.
In particular embodiments of the present invention, the Java application is stored in a Java archive (JAR) file, which contains several Java class files and other resources. In addition, inside each class file may be information about any other classes that are referenced by the listed classes. More particularly, in some embodiments of the present invention, the list of required classes obtained at block 410 and block 415 may be derived by inspecting fields of a class file in a JAR file, including constant pool, super class, interfaces, and fields.
Operations for formatting the identified Java class files to generate the API attribute list will now be described with reference to blocks 418 to 440 for some embodiments of the present invention. The operations at blocks 418 through 440 in some embodiments are carried out for each referenced Java class file identified at block 415. It will be understood that formatting operations as described with reference to blocks 418 to 440 may be performed with or without making a change to the Java class files. Fore example, when the API identifier is placed in the JAD file then no modification to Java class files may be made. However, a similar API identifier attribute could optionally also be placed within each of the Java class files and used to, for example, speed the process of generating the API attribute list when it is not present in the JAD file. In any event, the process for identifying required classes need not include changing the class files.
Referring now to
When it is determined that the identified Java class file is known to the listed one of the known bundles (block 425), the listed one of the known bundles is added to the list of all required bundles (block 430). When it is determined that the identified Java class file is not known to a listed one of the known bundles (block 425), the identified Java class file is added to the list of all required classes (block 435). If there are additional identified referenced classes (block 440), operations at block 418 through block 440 repeat.
The API attribute list for a Java class is generated based on the list of required bundles and the list of required classes (block 445). The API attribute list may be incorporated in the descriptor, such as the JAD (block 450). The API attribute list may be inserted into the Java class file. For example, inserting the API attribute list into the class file may be desirable in some embodiments when a JAD is not present and the Java application is downloaded over a network one class at a time. This may allow the downloading device to determine if the application can be supported by the device after downloading only a single class file, namely the class file that contains the application entry point.
Methods for controlling downloading of a java application to a mobile terminal according to further embodiments of the present invention will now be described with reference to the flowchart illustration of
Operations for controlling downloading will be further described with reference to the remaining blocks of
For example, the Java application descriptor (JAD) file generally contains attributes of MicroEdition-Configuration and MicroEdition-Profile that indicate the required configuration and profile support. For example, CLDC 1.0, CLDC 1.1, MIDP 1.0 and MIDP 2.0. These field designations may provide information about the core APIs (classes) that are required, although many applications require additional APIs above and beyond CLDC and MIDP. Nonetheless, as described herein and performed at Block 520, for some embodiments of the present invention, it is possible to imply a required bundle from standard configuration and profile attributes (such as CLDC 1.0, CLDC 1.1, MIDP 2.0 and/or MIDP 1.0) that are found in other fields of the downloaded descriptor. This may be used to reduce the length of the generated API attribute list by not re-identifying such bundles in the API attribute list and/or may be used to avoid unnecessary downloading of the JAVA application in some embodiments of the present invention when the API attributes list is not already present as will be further described with reference to Blocks 545, 550 and 540.
If no required bundle not supported by the downloading device is identified by reviewing the other fields in the descriptor (Block 520), the Java application itself is downloaded (Block 525). As such, once the Java application is downloaded at Block 525, the downloading device may itself generate the API attribute list in a manner such as described previously for generating an API attribute list for including in the descriptor with reference to the embodiments of
Some embodiments may differ based on whether a server or client device generates the API attribute list. For example, a client device will typically know exactly what it supports. The server in some embodiments knows the super set of what is supported by different possible downloading client devices and may then perform a best fit operation when generating the API attribute list. In other words, a class might be included in several bundles and, when selecting among several bundles, the one that includes the least number of classes may be chosen first. If, subsequently, a second bundle is added that is a super set of a previously added bundle, the second bundle can replace the first bundle and/or extra information about which device the application is targeted for may be provided. Furthermore, while the API attribute (for the entire application) may be missing from the JAD file, this information may have been added inside of the individual Java class files, which may make it easier for the mobile client to produce the API attribute list.
For some Java applications, referenced classes associated with the Java application may be both required and/or optional APIs (classes). In other words, an identified Java class or API may be optional, although performance and features of the Java application may be changed and/or limited where an optional API/class is not supported. Thus, in some embodiments of the present invention, a distinction may be made between required and optional API/classes as will now be described with reference to Blocks 535-550. For such embodiments, the generated API attribute list or the like provides the necessary information to the downloading device or the server generating the API attribute list to allow designation of a particular listed class/API as optional or required.
As seen in the embodiments of
It will be further understood that, in some embodiments, the identified Java class files have an associated version and a listing of required classes and bundles may include a corresponding identification of the associated version. Operations related to determining if an identified Java class file is included in any bundle or included in a bundle known to the mobile terminal may similarly be based on the associated version number. In other words, a class or bundle may be known to the downloading device but only in a version number that is earlier than the version of the class and/or bundle that has been identified as being required by the Java application that is to be downloaded. Accordingly, where the version number does not match, the Java application may be identified as not supported by the downloading device because the required version number is not supported. For example, the method/field signature may be associated with a listed bundle or class definition to ensure that the correct version of the class identified in a Java application to be downloaded is supported by the downloading device. This may be represented in the API attribute list and in the bundle definition as a list of methods with the method's type signature (the type and/or order and/or parameters).
Thus, a modified install process may be provided in accordance with some embodiments of the present invention, where the downloading device receives a user selection of an application to be downloaded and begins the downloading/transferring of the application to the downloading device, including first downloading a descriptor file, such as a JAD file containing an API attribute. The downloading device may read the JAD file and compare bundles and/or Java libraries listed in the API attribute list with a set of bundles and/or Java libraries supported by the downloading device. If the downloading device does not support all of the required APIs, then a user may be informed that the application is not compatible with this downloading device and the install process may be ceased. If the downloading device does not support all of the optional APIs, then the user may be informed that the application can be installed but will have limited functionality as not all APIs are supported. If the downloading device does support all required and optional APIs, then downloading may be continued of the Java application, such as the JAR file and installing of the application. The install process may then continue as normal. Where an API attribute list is not present in the descriptor JAD file, some embodiments proceed with normal installation without verification of compatibility or modified install processes may proceed as described with reference to Blocks 525 and 530 by generating a validation API attribute list for checking on the downloading device itself.
Thus, as described above with reference to various embodiments, some embodiments of the present invention provide for identifying unsupported applications prior to downloading, installing and running an application. Such operations may limit or prevent end user frustration from experience of non-functioning applications and the potentially wasted time and resources associated with downloading and installing non-functional applications.
As generally described above, when beginning generation of the API attribute list for a given Java application, a list of required bundles and a list of required classes are first set to an empty set so that they may be built up with identifications of all required class and bundle identifications for a particular Java application. Known bundle information is also obtained to allow for a potential reduction in length and size of the API attribute list by using bundle identifications rather than individual class identification listing for every class. For some particular embodiments, a registry of known bundles may be maintained so that when new API bundles are defined, they may be standardized and version controlled. For example, placing this information on a common server may be provided so that application servers, application developers, and/or device manufacturers can update and/or reference such bundle information.
Further, as described above, in some embodiments a JAR file for a Java application may be read to create a list of all class files contained in the JAR file and, for each class in the JAR file, the class may be inspected and a list of referenced classes may be created. For each referenced class, it may be determined if the referenced class is already included in the list of classes contained in the JAR file and, if so, to avoid redundancy, operations may skip to the next class. It is further determined if the referenced class is included in any of the bundles in the list of required bundles and, if so, the reference class may be skipped. If the referenced class is included in any of the bundles listed in the list of known bundles, then the bundle may be added to the list of required bundles. If the referenced class is not already in the list of required classes, nor is it associated with any known or listed required bundle, it may be added to the list of required classes. In other words, classes referenced or associated with the Java application file may be preferentially included in an API attribute list as part of a known bundle/library to which the class is known and, if no such known bundle is available, may be listed individually in the API attribute list file. Thus, as described above, a server or other device can generate the API attribute list for an existing Java application and add this attribute list to a descriptor, such as a JAD file, without the need for human intervention.
As will be appreciated by one of skill in the art, the present invention may be embodied as a method, system, mobile terminal or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects, all generally referred to herein as a “circuit” or “module.”
Computer program code for carrying out operations of the present invention may be written in an object oriented programming language such as Java®, Smalltalk or C++, a conventional procedural programming languages, such as the “C” programming language, or lower-level code, such as assembly language and/or microcode. The program code may execute entirely on a single processor and/or across multiple processors, as a stand-alone software package or as part of another software package.
The present invention is described above with reference to flowchart illustrations and/or block and/or flow diagrams of methods, apparatus (systems) and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and/or block diagrams, and combinations of blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart and/or block and/or flow diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable processor to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart and/or block diagram block or blocks.
The computer program instructions may also be loaded onto a computer or other programmable data processor to cause a series of operational steps to be performed on the computer or other programmable processor to produce a computer implemented process such that the instructions which execute on the computer or other programmable processor provide steps for implementing the functions or acts specified in the flowchart and/or block diagram block or blocks.
In the drawings and specification, there have been disclosed exemplary embodiments of the invention. Although specific terms are employed, they are used in a generic and descriptive sense only and not for purposes of limitation, the scope of the invention being defined by the following claims.