Embodiment
For making the purpose, technical solutions and advantages of the present invention clearer, specific embodiments of the invention are elaborated below in conjunction with accompanying drawing.At this, illustrative examples of the present invention and explanation thereof are used to explain the present invention, but not as a limitation of the invention.
The embodiment of the invention provides a kind of terminal of dynamic installation Java application and the method that Java uses dynamically is installed.Wherein, described terminal not only can be mobile phone, PDA, can also be all mobile terminal devices of supporting Java, as: set-top box, GPS, game machine etc., and described terminal is supported Java Virtual Machine (being used to carry out java applet), supports to download OTA in the air, supports the installation that Java uses and is supported Java Application Manager (being used for the management to the Java application).
For the ease of the management of Java application and the installation of Java application, the embodiment of the invention is used Java and is installed under the Java catalogue of EFS.At first under the Java catalogue of the EFS of appointment, carry out the bibliographic structure configuration of EFS.This Java catalogue performance on EFS can be as shown in Figure 1.Among Fig. 1, root is the relative root of EFS, and java is the java catalogue on the EFS, and what the subdirectory app of java catalogue stored down is to use by the Java that OTA downloads or install on the PC backstage.What the subdirectory pre of java catalogue stored down is that the Java that installs uses.The dynamic installation Java of present embodiment uses, and can finish under the pre catalogue.
Embodiment one
Present embodiment provides a kind of method of dynamic installation Java application and realizes the terminal of this method.The method that described dynamic installation Java uses is a prepackage Jad file on EFS, visits and downloads the Jar file by the Jad file, thereby can reach the execution that Java uses.
As shown in Figure 2, the method for present embodiment comprises the steps:
Step 201 shows the Java list of application on display interface.
This Java list of application is to show according to the Java Apply Names in the configuration file of prepackage.This configuration file is just installation under the pre catalogue when the terminal Default Value.In the present embodiment, when configuration file is installed, the Jad file is installed also.
Described Jad file is a standard format files, and file format can be as shown in table 1.
Configuration file is that all install the configuration information that Java uses under the pre catalogue in order to write down, and makes Java Application Manager (Jam) show that the Java Apply Names is to the terminal use.In the present embodiment, configuration file adopts user-defined format, for example can define form as shown in table 2.
Table 1.Jad file format
Table 2. configuration file format
In the configuration file format shown in the table 2, each Java uses corresponding delegation (or one section), and the content that Java uses in every row is distinguished (being to come each attribute of Java application at interval with comma in every row) with comma.First was the Java Apply Names during every capable Java shown in the table 2 used, and second is the Jad file path, and the 3rd is Jar URL/Jar URL (the URL path of Jad file or the URL path of Jar file), and the 4th is the path of Jar file.In the present embodiment, because the Jad file is installed, therefore preceding two in every row can not be sky, and the 3rd Jad URL or Jar URL can be sky; If the Jar file is not installed, promptly there is not the Jar file path, then the 4th Jar file path is empty, if there is the Jar file path, then the 4th is not empty.
In the above-mentioned configuration file, if certain Java of delegation use in the 3rd be Jad URL and be non-NULL, when then in subsequent step, reading the Jad failure according to second Jad file path, can be according to the 3rd URL address download Jad file that provides.If the 3rd is Jar URL, this Jar URL can be consistent with Jar URL in the corresponding Jad file, also can be inconsistent, if the URL address of Jar file is inconsistent in the Jar URL in the configuration file and the corresponding Jad file, then can be according to preset priority, download the Jar file according to the JarURL address in the Jad file earlier, when downloading the failure of Jar file, download the Jar file according to the Jar URL address in the configuration file again according to the Jar URL address in the Jad file.
Certainly, in the present embodiment, definition 5 attributes (content) in also can using at the every capable Java of configuration file, every between with comma at interval, as be respectively: Java Apply Names, Jad file path, Jad URL, Jar URL, Jar file path.
With table 2 is example, according to the profile information shown in the table 2 as can be known, under the pre of correspondence catalogue, has deposited two Jad files of demo1.jad and demo2.jad.
In addition, in configuration file, the Java Apply Names will with the title of MIDlet-Name in the corresponding Jad file be consistent (as " doudizhu " in the table 2).If in the Jad file, contain a plurality of MIDlet (as MIDlet-1, when MIDlet-2) not having MIDlet-Name, the title of the desirable MIDlet-1 of Java Apply Names (as the demo1 in the table 1) in configuration file.
In the dynamic installation process that Java uses, described configuration file can carry out dynamic expansion.
Step 202 receives the selection that Java is used.
The user selects Java to be installed to use the tabulation of Java Apply Names from terminal interface in this step, and terminal receives the selection that Java is used.
Step 203 is carried out the download and the installation of Jar file according to configuration file, and the corresponding modify configuration file.
From the tabulation of the Java Apply Names of described demonstration, select Java to be installed to use, and when in described configuration file, not having corresponding Jar file path,, carry out the download of Jar file by the URL path of Jar file in access-profile or the Jad file.Configuration file is revised in the download back that finishes, and the path of Jad file or Jar file is filled in the configuration file, can carry out the installation of Jar file simultaneously.
As shown in Figure 3, this step specifically comprises again:
Step 301 is opened the configuration file under the pre catalogue.
Step 302 is resolved described configuration file, judges according to the 4th of the every row of configuration file whether the jar file path exists.If there is the Jar path, then execution in step 305, otherwise execution in step 303.
Step 303 according to the path access Jad file of the Jad file in the configuration file or the Jar URL path in the configuration file, starts the aerial OTA of download program, carries out the download of Jar file, carries out the installation of Jar file after having downloaded.
The Jar file of downloading can leave on the EFS, also can leave on the SD card, or on other mobile storage that is associated, can select flexibly according to user's needs.
Step 305, the Java that directly moves this Jar file correspondence uses.
When using in order to visit Java in next time, directly move Java and use and need not to download again and install, the Java of present embodiment uses with the dress flow process and also can comprise the steps:
Step 304 is revised configuration file, and the Jar path of downloading is written in the configuration file.
The Jar file is revised described configuration file after downloading and finishing, and the path of the Jar file downloaded is filled in the described configuration file, when the user visits the link of this Java application once more like this, owing in configuration file, there is the Jar path, therefore can directly carry out step 305, move this Java and use.
After Java used and installs, the user can select to upgrade Java by Java list of application interface and use, and what upgraded this moment is the Jar file of downloading, and Jad file and configuration file still keep.By downloading again and new Jar file being installed, realize the renewal (upgrading) that Java uses.
And, Java use install after, the user also can select deletion by Java list of application interface, delete this Java and use, but deletion this moment is the Jar file of being downloaded that Jad file and configuration file still keep.
In addition, the user can also select mobile Jar file to appointed positions by Java list of application interface or in the Java catalogue, at this moment Jar file path corresponding modify in the configuration file.
No matter be the Jar file deleted or move after, configuration file all can carry out corresponding modification, when guaranteeing that visiting Java once more uses, can carry out correct operation according to configuration file, if can correctly download again or direct execution that Java uses.
If terminal has note, multimedia message or Email function, the Jar file of above-mentioned download can also be transmitted to other-end by note, multimedia message or Email, and other-end just can and be carried out and install based on the Jar filling in documents configuration file that receives like this.
The dynamic installation method that Java as above uses can bring following beneficial effect:
1) can effectively save the EFS space (or Flash space) of terminal;
2) make operator and manufacturer that Java more is installed and use, enrich its device content;
3) install to use and can upgrade and delete, but what delete is the Jar file of its download that the Jad file also is retained on the EFS, the user can repeatedly operate, and has improved user experience greatly;
4) risk of reduction device fabrication.
In the present embodiment, as shown in Figure 6, realize that the terminal of said method comprises: display unit (not shown), selected cell 601, download unit 602, installation unit 603, modification unit 605, memory cell 606, edit cell 607, wherein:
Display unit is used for showing the tabulation of Java Apply Names on terminal interface;
Download unit 602 is used for when there is not corresponding Jar file path in the configuration file that presets, downloads the Jar file according to the URL path of Jar file in the Jad file of configuration file;
Installation unit 603 is used for the described Jar file of downloading is installed.
Revise unit 605 and be used to revise described configuration file, the path of the Jar file downloaded is written in the described configuration file.
Memory cell 606 is used to store described configuration file, also can store the Jar file further.
Edit cell 607 is used for selecting according to the Java Apply Names tabulation that shows on the terminal interface the described Jar file of deletion download, and the described configuration file of corresponding modify.
Selected cell 601 is used for from the terminal interface the tabulation of Java Apply Names and selects pending Java to use.
Embodiment two
The method that present embodiment provides the dynamic installation Java of another kind of terminal to use, configuration file can only be installed, in configuration file, record URL path (as the URL path of Jad file and/or the URL path of Jar file), visit and download Jad file and/or Jar file by visiting this URL path, thereby realize the dynamic installation that Java uses.
As shown in Figure 4, the method for present embodiment comprises the steps:
Step 401 shows the list menu that Java uses on terminal interface.
This Java list of application is to show that according to the Java Apply Names in the configuration file of installing described configuration file is just installation under the pre catalogue when the terminal Default Value.In the present embodiment, when the terminal Default Value is installed configuration file, in configuration file, pre-set the URL address of Jad file and/or the URL address of Jar file.
Described configuration file adopts user-defined format, the form shown in the face table 2 as defined above for example, form that also can be shown in following table 3.In the file format shown in the table 3, the corresponding delegation of the configuration information that each Java uses.In each row, first is the Java Apply Names, and second is the Jad file path, and the 3rd is Jad URL, and the 4th is Jar URL, and the 5th is the path of Jar file.
Table 3. configuration file format
When using the configuration file format shown in the table 2, if Jad file that Java uses and Jar file are installed URL path (the URL path of Jad file and/or the URL path of Jar file) only has not been installed, then this Java of configuration file uses in that corresponding delegation, second and the 4th is empty, first can not be sky, and the 3rd (URL of Jad file URL or Jar file) can not be sky.
When using the configuration file format shown in the table 3, if Java is not installed to be used the Jad file of (as table 3 " doudizhu ") and Jar file and URL path (the URL path of Jad file and/or the URL path of Jar file) only has been installed, then shown in the 1st row in the table 3, second and the 5th that " doudizhu " is corresponding is empty, first can not be sky, and the 3rd (Jad file URL) and the 4th (URL of Jar file) have at least one can not be sky.
When showing the Java Apply Names according to configuration file, be example with table 3, record two Java in the configuration file shown in the table 3 and use, the title of using at these two Java of the up corresponding demonstration of Java list of application menu of the display screen of terminal.
Step 402 receives the selection that Java is used.
The user selects Java to be installed to use the tabulation of Java Apply Names from terminal interface in this step, and terminal receives the selection that Java is used.
Step 403 is carried out the download of Jad file or Jar file according to the URL address, and the corresponding modify configuration file.
From the name list that the Java of described demonstration uses, select Java to be installed to use, and the URL path by Jad file in the access-profile or Jar file, carry out the download of Jad file or Jar file.After download finishes, the path of Jad file or Jar file is filled in the configuration file.
As shown in Figure 5, this step specifically comprises:
Step 501 is opened the configuration file under the pre catalogue.
Step 502 is resolved described configuration file, judges whether the jar file path that corresponding Java uses in the configuration file exists.If there is the Jar path, then execution in step 505, otherwise execution in step 503.
Step 503, Jad URL path in the access-profile and/or Jar URL path start the aerial OTA of download program, carry out the download of Jad and/or Jar file.
Concrete, if only there is Jad URL in the configuration file, then visit this Jad URL, download the Jad file, and revise configuration file.At this moment, owing to also there is not the Jar file, therefore also need download the Jar file based on the Jar URL in the Jad file of downloading.After download Jar file finishes, described Jar file is installed.
If only there is Jar URL in the configuration file, then downloads Jar file and install based on this Jar URL.Use description document because the Jad file is Java,, also do not influence the execution that Java uses though therefore do not have the Jad file.
If have Jad URL and Jar URL in the configuration file, then download Jad file and Jar file, and after the Jar file finishes described Jar file is installed in downloading based on this Jad URL and Jar URL.
Jar file and the Jad file downloaded can leave on the EFS, also can leave on the SD card, or on other mobile storage that is associated, can select flexibly according to user's needs.
Step 504 is revised configuration file, and the Jar path of downloading is written in the configuration file.
After installation Java uses and finishes, revise described configuration file, the path of the Jar file downloaded and the path of Jad file are filled in the described configuration file (if only downloaded the Jar file, then only the path of Jar file is write in the configuration file), when the user visits the link of this Java application once more like this, owing in configuration file, have the Jar path, therefore can directly move this Java and use.
Step 505, the Java that directly moves this Jar file correspondence uses.
After installing the Java application, the user can select to upgrade Java by Java list of application interface and use, and what upgrade at this moment is downloaded files (the Jar file also can comprise the Jad file).By downloading again and new Jar file being installed, realize the renewal (upgrading) that Java uses.
And, Java use install after, the user also can select deletion by Java list of application interface, delete this Java and use, this moment downloaded files with deleted, but configuration file still keeps.
In addition, the user can also select mobile Jar file to appointed positions by Java list of application interface or in the Java catalogue, at this moment Jar file path corresponding modify in the configuration file.
No matter be the Jar file deleted or move after, configuration file all can carry out corresponding modification, when guaranteeing that visiting Java once more uses, can carry out correct operation according to configuration file, if can correctly download again or direct execution that Java uses.
If terminal has note, multimedia message or Email function, the Jad of above-mentioned download and/or Jar file can also be transmitted to other-end by note, multimedia message or Email, and other-end just can and carry out the download of Jar file or execution is installed based on the Jad or the Jar filling in documents configuration file that receive like this.
As above the dynamic installation method of Java application can bring following beneficial effect:
1) can effectively save the EFS space (or Flash space) of terminal;
2) make operator and manufacturer that Java more is installed and use, enrich its device content;
3) install to use and can upgrade and delete, deletion be its downloaded files (Jar file and Jar file), Java application configuration file is installed also is retained on the terminal, the user can repeatedly be operated, improved user experience greatly;
4) risk of reduction device fabrication.
In the present embodiment, as shown in Figure 7, realize that the terminal of said method comprises: display unit (not shown), selected cell 701, download unit 702, installation unit 703, modification unit 705, memory cell 706 and edit cell 707, wherein:
Display unit is used for showing the tabulation of Java Apply Names on terminal interface;
Selected cell 701 is used for from the terminal interface the tabulation of Java Apply Names and selects pending Java to use;
Download unit 702 is used for according to the URL path of the file of Jad described in the configuration file and/or the URL path of Jar file, downloads the Jad file and/or the Jar file of the Java application of selecting in the described Java Apply Names tabulation to be installed.
Installation unit 703 is used for the described Jar file of downloading is installed.
Revise unit 705 and be used to revise described configuration file, the path of the Jar file downloaded is written in the described configuration file.When in configuration file, not having the URL of Jar file and Jar file path, described download unit is downloaded the Jad file according to the URL of Jad file in the configuration file earlier, download the Jar file according to the URL path of Jar file in the Jad file of downloading again, revise the unit and comprise that also the second modification unit is written to the path of the Jad file of download in the described configuration file.
Memory cell 706 is used to store described configuration file, also can store Jar file and/or Jad file further.
Edit cell 707 according to the Java Apply Names that shows on the terminal interface tabulation select described Jad that deletion downloads and/the Jar file, and the described configuration file of corresponding modify.
One of ordinary skill in the art will appreciate that all or part of step in the method that realizes the foregoing description 1 and embodiment 2 can instruct relevant hardware to finish by program, this program can be stored in the computer read/write memory medium, such as ROM/RAM, magnetic disc, CD etc.Wherein, when said procedure by machine, when loading and carrying out as portable terminal, this machine becomes in order to participate in system of the present invention or device.
Above-described specific embodiment; purpose of the present invention, technical scheme and beneficial effect are further described; institute is understood that; the above only is specific embodiments of the invention; and be not intended to limit the scope of the invention; within the spirit and principles in the present invention all, any modification of being made, be equal to replacement, improvement etc., all should be included within protection scope of the present invention.