Mobile phone and cell phone configuration method reach the website that the XML configuration file is provided for mobile phone
Technical field
The present invention relates to the mobile phone configuration, particularly relate to the unified management of mobile phone configuration, the user can download the mobile phone of the arrangements oneself that designs from the website, and is convenient and swift.
Background technology
XML, i.e. extend markup language is a kind of new technology that Web uses, be World Wide Web Consortium (W3C) formulate standard.XML has simplified exchanges data and expression in the network, makes code, data and expression to separate, and can be used as the data exchange standard form.
Current, most of mobile phone can be provided with different wallpapers by menu option, and personality elements such as theme also can be regulated the brightness of display screen simultaneously by menu option, make screen display can reach optimum efficiency.
In general, the layoutprocedure of existing mobile phone may further comprise the steps as shown in Figure 1:
Step S1 selects different config options, mobile phone config options such as Tathagata electroacoustic sound, background picture; And
The config option that step S2 carry out to select, Tathagata electroacoustic sound or background picture etc., it can be downloaded from the Internet, also can the manual editing or directly select from the mobile phone memory cell.
But there is following shortcoming in existing mobile phone layoutprocedure: sound, and Background, background color will be provided with respectively, wastes time and energy; Because each configuration is independent, can not read from a configuration file simultaneously, personalized configuration can easily not exchange.
Summary of the invention
The object of the present invention is to provide a kind of mobile phone and cell phone configuration method reach provides the XML configuration file for mobile phone website, solve the inconvenient problem of existing mobile phone configuration, mobile phone personalization collocation method according to the present invention can once be finished all configurations of mobile phone, and is very convenient.
To achieve these goals, the invention provides a kind of cell phone configuration method, described mobile phone supports XML to resolve, and described mobile phone is connected with a website, and described website is used to provide the XML configuration file, may further comprise the steps:
A1. described XML configuration file is downloaded and preserved to described mobile phone from described website;
A. select described XML configuration file, described XML configuration file comprises mobile phone model, mobile phone config option title, mobile phone configuration option data, and described mobile phone configuration option data comprises audio files and the image file that is fit to described mobile phone at least;
B. resolve described XML configuration file, and preserve described mobile phone configuration option data;
C. finish described mobile phone configuration according to the mobile phone configuration option data of described mobile phone config option title and preservation.
Above-mentioned cell phone configuration method, wherein, before the described step a, described website provides XML configuration file by following steps:
A1., the mobile phone simulator is set, the described mobile phone config option that the input user selects;
The described mobile phone simulator that a2. will set is converted into described XML configuration file;
Above-mentioned cell phone configuration method, wherein, described step b comprises:
B1. resolve described XML configuration file;
B2. judge that whether mobile phone model coincide, and whether the determining program space is enough;
B3. handle described mobile phone configuration option data according to judged result,, otherwise do not preserve described mobile phone configuration option data if two conditions all satisfy then preserve described mobile phone configuration option data.
Above-mentioned cell phone configuration method wherein, also comprises before the described step c, if resolves successfully then execution in step c, if parsing gets nowhere then reads in last successful configuration or return the configuration of dispatching from the factory.
Above-mentioned cell phone configuration method, wherein, described mobile phone configuration option data is data or the static data by the url link, when described mobile phone configuration option data is the data of url link, the data and the preservation of the described url link of mobile phone-downloaded among the described step b, when described mobile phone configuration option data was static data, mobile phone was directly preserved described static data among the described step b.
Above-mentioned cell phone configuration method, wherein, the head of described mobile phone configuration option data has the length of data.
Above-mentioned cell phone configuration method wherein, also comprises step after the described step b3:
The filename of b4. described mobile phone configuration option data is set to particular file name.
In order better to realize purpose of the present invention, the present invention also provides a kind of mobile phone, and described mobile phone is connected with a website, and described website is used to provide the XML configuration file, wherein, comprises a configuration module among the FLASH, and described configuration module comprises:
Preserve module, be used for downloading and preserve described XML configuration file from described website;
File is selected module, be used to select described XML configuration file, described XML configuration file comprises mobile phone model, mobile phone config option title, mobile phone configuration option data, and described mobile phone configuration option data comprises audio files and the image file that is fit to described mobile phone at least;
Document analysis is preserved module, is used to resolve described XML configuration file, and preserves described mobile phone configuration option data according to analysis result;
The analysis judgment module is used to judge whether described XML configuration file parsing resolves success;
Executive Module is finished described mobile phone configuration according to the mobile phone configuration option data of described mobile phone config option title and preservation.
Above-mentioned mobile phone, wherein, if resolve successfully then described Executive Module carries out the personalized configuration of mobile phone according to mobile phone configuration option data of preserving and corresponding mobile phone config option title, if resolve unsuccessful then read in last successful configuration or return the configuration of dispatching from the factory.
In order better to realize purpose of the present invention, the present invention also provides a kind of website that is used to mobile phone as claimed in claim 8 that the XML configuration file is provided, and described website is used to provide the XML configuration file, wherein, comprising:
Mobile phone configuration simulator is used for selecting the mobile phone configuration for the user, and described mobile phone configuration simulator is a Java Applet mobile phone configuration simulator;
The XML file generating module is used for generating described XML configuration file according to described mobile phone configuration simulator.
The present invention once finishes every configuration of mobile phone, and can overcome the inconvenience of mobile phone configuration in the past from the Internet download, has made things convenient for the interchange of the personalized configuration of mobile phone simultaneously.
The present invention is described in detail below in conjunction with drawings and Examples.
Description of drawings
Fig. 1 is the layoutprocedure schematic diagram of existing mobile phone;
Fig. 2 is the mobile phone hardware structure chart;
Fig. 3 is the schematic diagram of the mobile phone of personalized configuration of the present invention;
Fig. 4 is the layoutprocedure schematic diagram of the personalized collocation method of mobile phone of the present invention;
Embodiment
The personalized configuration file of mobile phone of the present invention adopts the file of XML form, therefore need support the program of XML document analysis at the mobile phone end, this program analyzing XML file, thus revise each configuration.
The mobile phone of personalizable configuration of the present invention comprises a personalized configuration module, described personalized configuration module comprises that file selects module, document analysis module, analysis judgment module and Executive Module, and this personalization configuration module is present among as shown in Figure 2 the FLASH 20.
As shown in Figure 3, the mobile phone end is selected the XML file and is resolved, thereby the action of revising each configuration may further comprise the steps:
Step S10 file selects module to select personalized configuration file;
The mobile phone of the personalized configuration of step S20 utilizes document analysis to preserve the described XML configuration file of module parses, and preserves described mobile phone configuration option data according to analysis result;
Step S30 analysis judgment module judges whether to resolve successfully;
Step S40 Executive Module carries out the personalized configuration of mobile phone according to judged result, if resolve successfully then carry out the personalized configuration of mobile phone according to mobile phone configuration option data of preserving and corresponding mobile phone config option title, as the tinkle of bells of configurating mobile, background etc., if resolve unsuccessful then read in last successful configuration or return the configuration of dispatching from the factory.
As shown in Figure 4, this step S20 may further comprise the steps again:
Step S201 resolves described XML configuration file;
Step S202 judges that whether mobile phone model coincide, and whether the determining program space is enough;
If two conditions of step S203 all satisfy then preserve described mobile phone configuration option data, otherwise do not preserve described mobile phone configuration option data.
In the process of analyzing XML file, need to consider the integrality of file, the head of each data among the present invention in the XML configuration file all has the length of data, to guarantee the complete of data.
The XML file of mobile phone personal settings of the present invention is provided by the website, and it comprises authentication registration module, mobile phone configuration simulator and XML file generating module.
At first utilize java applet to write the mobile phone configuration simulator of different model on the website, different models has different screen sizes.Javaapplet is the initialization screen size at first, according to user's selection of configuration, as corresponding outward appearances of drawing such as Background, control color, the tinkle of bells music, simulates the environment of real handset simultaneously, and the user can determine whether to keep configuration according to effect.
After the user chooses, call the packing function, all configurations that the XML file generating module chooses the user are written as an XML file, this XML file of mobile phone-downloaded also is stored in and becomes the XML configuration file in the mobile phone, the benefit of using the XML file is that current most mobile phone all supports XML to resolve, XML is a kind of general form simultaneously, can not produce compatibility issue, and the key data of XML configuration file inside is: mobile phone model, mobile phone config option title, mobile phone configuration option data.Wherein, mobile phone model is to show which kind of mobile phone this XML configuration file can be used for, mobile phone config option title is corresponding with the mobile phone configuration option data, the mobile phone configuration option data that is called Background as mobile phone config option name is the picture that can be used as the mobile phone background, it can be the picture file of forms such as BMP, JPG, and mobile phone config option name is called the mobile phone configuration option data of the tinkle of bells is the audio files that can be used as ringing sound of cell phone, can be the audio files of forms such as wav, mmf.
Consider that the memory space on the mobile phone is limited.If each configuration file all adopts static linkage, that is to say that all picture voice datas all are kept in the configuration file, this extremely wastes memory space.
Therefore, the mobile phone configuration option data can be data or the static data by the url link among the present invention, when the mobile phone configuration option data is the data of url link, the data of the described url link of mobile phone-downloaded are also preserved, when described mobile phone configuration option data was static data, mobile phone was directly preserved described static data.
With each picture, sound etc. save as special filename after resolving.The function of calling mobile phone inside then, the field that resources such as Background are set is current special filename.Like this, in the time of resources such as these pictures of handset displays, just from these files, i.e. the resources field filename of Bao Cuning, just reading of data in those special file name.Like this, the parsing of xml is only carried out once.And, when carrying out an xml parsing again (when that is to say other configuration files of configuration), because filename is the same after resolving.The file of resolving last time has just been covered automatically like this, has saved the space.
Certainly; the present invention also can have other various embodiments; under the situation that does not deviate from spirit of the present invention and essence thereof; those of ordinary skill in the art work as can make various corresponding changes and distortion according to the present invention, but these corresponding changes and distortion all should belong to the protection range of the appended claim of the present invention.