CN105511851A - Method for expanding android system resource loading - Google Patents
Method for expanding android system resource loading Download PDFInfo
- Publication number
- CN105511851A CN105511851A CN201510810703.5A CN201510810703A CN105511851A CN 105511851 A CN105511851 A CN 105511851A CN 201510810703 A CN201510810703 A CN 201510810703A CN 105511851 A CN105511851 A CN 105511851A
- Authority
- CN
- China
- Prior art keywords
- mapping
- mnc
- resource
- android system
- mcc
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/445—Program loading or initiating
- G06F9/44505—Configuring for program initiating, e.g. using registry, configuration files
- G06F9/4451—User profiles; Roaming
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/451—Execution arrangements for user interfaces
- G06F9/454—Multi-language systems; Localisation; Internationalisation
Abstract
The invention discloses a method for expanding android system resource loading. When the scheme provided by the invention is not in used, different resources are loaded by various SIM cards and an Android system resource framework cannot be used; and a type of the SIM card has to be manually determined via codes and then resources are loaded in the codes and displayed. The former method requires high code coupling property and has to determine for many times, thereby possessing low efficiency. By the use of the method for expanding android system resource loading, just like the use of common resources, according to a map list, corresponding file folders are built under the resource file folder and the system can automatically map according to the current SIM card to load resources of the corresponding file folders; all the operations are transparent to other applications; and work load of other applications can be reduced, code coupling degree can be lowered and efficiency can be improved.
Description
Technical field
The present invention relates to a kind of method that resource loads, particularly relate to a kind of method expanded Android system resource and load, belong to expansion Android system resource Loading Control field.
Background technology
Due to increasing income of Android system, many manufacturers all can customize oneself Android system, and operator can be different according to the type of SIM card, require the tinkle of bells of mobile phone, boot animation, wallpaper, and the layout of some application and displaying contents etc. are also different.A set of software can not be all gone out for the SIM card of every type for such demand, so, be all generally meet the different needs on a software version.
The primary resource load mechanism of Android system has supported that the MCC according to SIM card (Mobile Country Code MCC) and MNC (Mobile Network Code) loads resource, as long as create file-mcc national code-mnc network code under the resource file folder of system, the resource under the corresponding SIM card of insertion preferentially will load this file.But this resource load mechanism primary in some cases but cannot satisfy the demands, such as, the telecom operators in same area have in same area main brand and sub-brand name point, main brand and sub-brand name also have different customized demand, but the value of main brand and sub-brand name MCC and MNC is identical, need to distinguish according to the value of SPN (operator name), the resource load mechanism of Android system cannot be used in this case; The main brand of the same telecom operators in same area, the MCC of sub-brand name, the value of MNC with SPN is all the same, needs the GID (packet ID) according to SIM card to distinguish customization in this case, also cannot use the resource load mechanism of Android system in this case.
System customization is carried out according to SIM card in above situation, can only according to MCC in code, MNC, the value of SPN and GID judges, then in code, loads corresponding resource file, but, when SIM card kind is a lot, the method of this judgement will bother very much, needs the judgement done many times, and efficiency is low and be easy to make mistakes.Therefore, the resource load mechanism primary to Android system is needed to expand.
Summary of the invention
Technical matters to be solved by this invention provides a kind of method expanded Android system resource and load for the deficiency of background technology.
The present invention is for solving the problems of the technologies described above by the following technical solutions:
Expand the method that Android system resource loads, specifically comprise following steps:
Step 1, monitors the state change of SIM cards of mobile phones;
Step 2, when SIM card state changes, obtains the operator's informaiton of SIM card, loads different mapping relations tables, obtain mapping result according to mapping relations table according to operator's informaiton, by mapping result stored in system property and then terminate to map;
Step 3, before Android system loads resource, the bag name of MCC, MNC in acquisition device configuration information and the program of current operation, and then MCC, MNC of acquisition are saved in temporary variable;
Step 4, the bag name obtaining program according to step 3 judges that current program is the need of mapping;
Step 4.1: if desired carry out mapping process, takes out MCC, MNC after mapping from system property, and then MCC, the MNC after mapping is replaced MCC and MNC original in system configuration information respectively;
Step 4.2: carry out mapping process if do not need, the value of mapping is replaced the value of the original MNC of device configuration information;
Step 5: after Android system loading resource completes, the value of original MCC and MNC is replaced.
As a kind of further preferred version expanding the method that Android system resource loads of the present invention, in step 2, adopt the mapping mode that SPN maps.
As a kind of further preferred version expanding the method that Android system resource loads of the present invention, in step 2, adopt the mapping mode that GID maps.
As a kind of further preferred version expanding the method that Android system resource loads of the present invention, in step 4, need the bag list of file names of mapping defined in code.
As a kind of further preferred version expanding the method that Android system resource loads of the present invention, in step 4, need the bag list of file names of mapping defined in MXL.
The present invention adopts above technical scheme compared with prior art, has following technique effect:
1, the present invention is not when using scheme in this paper, and different SIM card loads different resources, cannot use the resource framework of Android system, needs the type of judgement SIM card manual in code, then in code, loading resource display respectively.This method, code coupling is too high, and judges that efficiency is low often;
2, only need as common resource uses, according to mapping table, corresponding file is created under resource file folder, system can map according to current SIM card automatically, load the resource under corresponding folder, everything is all transparent concerning other application, decreases the workload of other application, reduce the degree of coupling of code, improve efficiency.
Accompanying drawing explanation
Fig. 1 is that MNC of the present invention maps process flow diagram.
Embodiment
Below in conjunction with accompanying drawing, technical scheme of the present invention is described in further detail:
Expand the method that Android system resource loads, it is characterized in that: specifically comprise following steps:
As shown in Figure 1, step 1, monitors the state change of SIM cards of mobile phones;
Step 2, when SIM card state changes, obtains the operator's informaiton of SIM card, loads different mapping relations tables, obtain mapping result according to mapping relations table according to operator's informaiton, by mapping result stored in system property and then terminate to map;
Step 3, before Android system loads resource, the bag name of MCC, MNC in acquisition device configuration information and the program of current operation, and then MCC, MNC of acquisition are saved in temporary variable;
Step 4, the bag name obtaining program according to step 3 judges that current program is the need of mapping;
Step 4.1: if desired carry out mapping process, takes out MCC, MNC after mapping from system property, and then MCC, the MNC after mapping is replaced MCC and MNC original in system configuration information respectively;
Step 4.2: carry out mapping process if do not need, the value of mapping is replaced the value of the original MNC of device configuration information;
Step 5: after Android system loading resource completes, the value of original MCC and MNC is replaced.
Wherein, in step 2, adopt the mapping mode that SPN maps or GID maps, in step 4, need the bag list of file names of mapping defined in code or MXL.
For solving the problem, in the application, providing a kind of method expanding Android system resource load mechanism, the resource in above situation being loaded and loads the same with primary resource, no longer need in code, do loaded down with trivial details judgement and load resource.
The resource load mechanism of Android system supports MCC, the loading scheme of MNC, the mode that expansion adopts MNC mapping is loaded to primary resource, such as, mobile phone inserts the card of operator of Deutsche Telecom, system default preferentially loads the resource of values-mcc204-mnc16 in resource file folder, but, there is multiple sub-brand name in this operator, the value of the MCCMNC of all sub-brand names is all 20416, in this case resource mapping method is adopted, because the title of MNC confirms on market, consider the value by not having the MNC used, be mapped as the SPN of some correspondences, such as, by MNC (999) to should the sub-brand name 1 (BenNL) of operator, by MNC (998) to should operator sub-brand name 2 (T-MobileNL) like this, if mobile phone inserts the SIM card of this sub-brand name 1 (BenNL), system preferentially will go the resource under loading values-mcc204-mnc999 file, if mobile phone inserts the SIM card of this sub-brand name 2 (T-MobileNL), system preferentially will go the resource under loading values-mcc204-mnc998 file.
Wherein corresponding relation, we pre-define in xml or in code, need the application according to SIM card customization resource only to need to create corresponding MCC-MNC file according to corresponding relation under resource file folder.
Expansion for resource load mechanism is divided into two part: MNC to map and resource loads.
MNC demapping section technology realizes:
Application program registration is to the monitoring of SIM card state change; When SIM card state changes, receive the notice of state change, obtain the MCC of new SIM card, the attributes such as MNC, SPN and GID; According to MCC, the value of MNC uniquely can determine an operator, then judges whether to need to map according to operator, and the mode mapped (SPN maps or GID maps), if need to map, then load different mapping relations tables according to operator; According to the MCC of SIM card, MNC, SPN and GID, obtain the value after mapping in mapping relations table.By the value after mapping stored in system property.
Resource loading section technology realizes:
Resource loading section needs to load in the flow process of resource at Android system to modify.Known Android system also can specify the configuration information of current device when carrying out Gains resources according to the ID of resource, the configuration information of current device is kept in the variable of a structure, which describe all configuration informations of equipment, certainly also comprise MCC, the value of MNC.In the process loading resource, the resource of loading can compare with device configuration information, the resource of being mated most.So we carried out mapping process to the MNC of configuration information before resource loads, the function of resource mapping so just can be realized.
Before loading resource, obtain the MCC in device configuration information, the bag name of the program of MNC and current operation.By the MCC obtained, MNC is saved in variable, stores temporarily.Judge that current program is the need of mapping according to bag name.Need in the in xml defined or code of bag list of file names mapped.Initialized time, carry out loading or initialization according to operator.
If need to carry out mapping process, from system property, take out the value of the mapping that demapping section is preserved, as 999.The value of mapping is replaced the value of the original MNC of device configuration information, such as, replace with 999 by 01.System is searched according to the value of new MCC, MNC and is loaded resource.After system loads resource completes, the value of original MCC and MNC is replaced, like this can not other place of influential system.
Above embodiment is only and technological thought of the present invention is described, can not limit protection scope of the present invention with this, and every technological thought proposed according to the present invention, any change that technical scheme basis is done, all falls within scope.By reference to the accompanying drawings embodiments of the present invention are explained in detail above, but the present invention is not limited to above-mentioned embodiment, in the ken that those of ordinary skill in the art possess, makes a variety of changes under can also or else departing from the prerequisite of present inventive concept.
Claims (6)
1. expand the method that Android system resource loads, it is characterized in that: specifically comprise following steps:
Step 1, monitors the state change of SIM cards of mobile phones;
Step 2, when SIM card state changes, obtains the operator's informaiton of SIM card, loads different mapping relations tables, obtain mapping result according to mapping relations table according to operator's informaiton, by mapping result stored in system property and then terminate to map;
Step 3, before Android system loads resource, the bag name of MCC, MNC in acquisition device configuration information and the program of current operation, and then MCC, MNC of acquisition are saved in temporary variable;
Step 4, the bag name obtaining program according to step 3 judges that current program is the need of mapping;
Step 4.1: if desired carry out mapping process, takes out MCC, MNC after mapping from system property, and then MCC, the MNC after mapping is replaced MCC and MNC original in system configuration information respectively;
Step 4.2: carry out mapping process if do not need, the value of mapping is replaced the value of the original MNC of device configuration information;
Step 5: after Android system loading resource completes, the value of original MCC and MNC is replaced.
2. a kind of method expanded Android system resource and load according to claim 1, is characterized in that: in step 2, adopts the mapping mode that SPN maps.
3. a kind of method expanded Android system resource and load according to claim 1, is characterized in that: in step 2, adopts the mapping mode that GID maps.
4. a kind of method expanded Android system resource and load according to claim 1, is characterized in that: in step 4, needs the bag list of file names of mapping defined in code.
5. a kind of method expanded Android system resource and load according to claim 4, is characterized in that: in step 4, needs the bag list of file names of mapping defined in MXL.
6. a kind of intelligent guidance system according to claim 1, is characterized in that: described controller module module adopts AVR series monolithic.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510810703.5A CN105511851B (en) | 2015-11-20 | 2015-11-20 | A method of extension Android system resource load |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510810703.5A CN105511851B (en) | 2015-11-20 | 2015-11-20 | A method of extension Android system resource load |
Publications (2)
Publication Number | Publication Date |
---|---|
CN105511851A true CN105511851A (en) | 2016-04-20 |
CN105511851B CN105511851B (en) | 2019-06-14 |
Family
ID=55719861
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201510810703.5A Active CN105511851B (en) | 2015-11-20 | 2015-11-20 | A method of extension Android system resource load |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN105511851B (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106973162A (en) * | 2017-03-28 | 2017-07-21 | 上海与德科技有限公司 | A kind of intelligent terminal system version-switching method and device |
CN108664259A (en) * | 2018-04-02 | 2018-10-16 | 青岛海信移动通信技术股份有限公司 | A kind of method and terminal carried out using installation |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6269371B1 (en) * | 1998-02-27 | 2001-07-31 | Kabushiki Kaisha Toshiba | Computer system, and file resources switching method applied to computer system |
CN101040258A (en) * | 2004-12-21 | 2007-09-19 | 中兴通讯股份有限公司 | Method and apparatus for loading compatibly equipment software in distributed control system |
US20110296225A1 (en) * | 2010-05-25 | 2011-12-01 | Microsoft Corporation | Resource-Based Adaptive Server Loading |
CN102630081B (en) * | 2012-03-22 | 2015-03-11 | 华为终端有限公司 | Operator configuration information loading method and terminal |
CN104980454A (en) * | 2014-04-02 | 2015-10-14 | 腾讯科技(深圳)有限公司 | Method, server and system for sharing resource data |
-
2015
- 2015-11-20 CN CN201510810703.5A patent/CN105511851B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6269371B1 (en) * | 1998-02-27 | 2001-07-31 | Kabushiki Kaisha Toshiba | Computer system, and file resources switching method applied to computer system |
CN101040258A (en) * | 2004-12-21 | 2007-09-19 | 中兴通讯股份有限公司 | Method and apparatus for loading compatibly equipment software in distributed control system |
US20110296225A1 (en) * | 2010-05-25 | 2011-12-01 | Microsoft Corporation | Resource-Based Adaptive Server Loading |
CN102630081B (en) * | 2012-03-22 | 2015-03-11 | 华为终端有限公司 | Operator configuration information loading method and terminal |
CN104980454A (en) * | 2014-04-02 | 2015-10-14 | 腾讯科技(深圳)有限公司 | Method, server and system for sharing resource data |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106973162A (en) * | 2017-03-28 | 2017-07-21 | 上海与德科技有限公司 | A kind of intelligent terminal system version-switching method and device |
CN108664259A (en) * | 2018-04-02 | 2018-10-16 | 青岛海信移动通信技术股份有限公司 | A kind of method and terminal carried out using installation |
Also Published As
Publication number | Publication date |
---|---|
CN105511851B (en) | 2019-06-14 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN105682126B (en) | Configuration processing method and device for APN (access point name) parameter | |
CN105893084A (en) | Version upgrading method and terminal equipment | |
CN104850301A (en) | Method and system for classifying application icons on system desktop | |
CN109660372B (en) | SDN service configuration method and device | |
CN102348017A (en) | Calling method of terminal application, terminal device and UICC (Universal Integrated Circuit Card) | |
US20180046472A1 (en) | Method and system for customizing desktop launcher of mobile terminal | |
CN103079192B (en) | Terminal use's card information collocation method and device | |
CN110868763A (en) | Method, device and system for establishing Bluetooth connection | |
CN105511851A (en) | Method for expanding android system resource loading | |
CN103246428A (en) | Method and user terminal for displaying applications in desktop groups | |
CN104484206A (en) | Method, terminal and system for setting up application program | |
CN105915361A (en) | Group upgrading method and device | |
CN105528133A (en) | Icon displaying method and apparatus | |
CN102984350A (en) | User-defined subject switchover method and device in mobile terminal of Android operating system | |
CN106383914B (en) | Method and system for realizing configuration of multiple data sources based on cloud call platform | |
CN109697281A (en) | The online method, apparatus and electronic equipment for merging document | |
US20200293490A1 (en) | File storing method, terminal, and computer-readable storage medium | |
CN103309906A (en) | Address book backup and recovery method and device | |
CN109781135B (en) | Information screen information supplement display method, system and application of road-directing robot | |
CN110134486A (en) | A kind of asynchronous method and device to Load Image of ListView | |
CN106792853B (en) | New equipment adding method for Bluetooth mesh network | |
CN107329804A (en) | It is a kind of automatically created according to configuration, the method for upgrading virtual machine | |
CN103092629A (en) | Interface packaging system and interface packaging method | |
CN106878812A (en) | A kind of method and apparatus of upgrade-system | |
WO2016110028A1 (en) | Method and device for acquiring user configuration information |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |