CN105511851B - A method of extension Android system resource load - Google Patents
A method of extension Android system resource load Download PDFInfo
- Publication number
- CN105511851B CN105511851B CN201510810703.5A CN201510810703A CN105511851B CN 105511851 B CN105511851 B CN 105511851B CN 201510810703 A CN201510810703 A CN 201510810703A CN 105511851 B CN105511851 B CN 105511851B
- Authority
- CN
- China
- Prior art keywords
- mnc
- mapping
- 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.)
- Active
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
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Human Computer Interaction (AREA)
- Telephonic Communication Services (AREA)
- Stored Programmes (AREA)
Abstract
The invention discloses a kind of methods of extension Android system resource load, the present invention is not when using scheme proposed in this paper, different SIM cards loads different resources, it is not available the resource framework of Android system, it needs manually to judge in code the type of SIM card, is then being shown respectively in code to load resource.This method, code coupling is too high, and judges often, low efficiency.It only needs as common resource use, according to mapping table, corresponding file is created under resource folder, system can be mapped automatically according to current SIM card, load the resource under corresponding folder.Everything be all for other application it is transparent, reduce the workload of other application, reduce the degree of coupling of code, improve efficiency.
Description
Technical field
A kind of method more particularly to method of extension Android system resource load loaded the present invention relates to a kind of resource,
Belong to extension Android system resource load control field.
Background technique
Due to the open source of Android system, many manufacturers can all customize the Android system of oneself, and operator can be according to SIM card
Type is different, it is desirable that the tinkle of bells of mobile phone, boot animation, wallpaper, layout and display content of some applications etc. are also different.It is right
A set of software can not all be gone out in such demand for each type of SIM card, so, typically on a software version
To meet the needs of different.
The primary resource load mechanism of Android system has been supported (to be moved according to the MCC (Mobile Country Code MCC) and MNC of SIM card
Dynamic network code) resource is loaded, as long as create file-mcc national code-mnc network code under the resource folder of system,
Be inserted into corresponding SIM card will preferentially load this document folder under resource.But primary this resource load in some cases
Mechanism is but unable to satisfy demand, for example, the telecom operators in the same area the same area have main brand and sub-brand name it
Point, main brand and sub-brand name also have different customized demand, however main brand and the value of sub-brand name MCC and MNC are identical, need
It to be distinguished according to the value of SPN (operator name), not be available the resource load mechanism of Android system in this case;It is same
The main brand of a same telecom operators in area, the value of MCC, MNC and the SPN of sub-brand name are the same, need in this case
Customization is distinguished according to the GID (packet ID) of SIM card, be not also available the resource load machine of Android system in this case
System.
System customization is carried out according to SIM card under above situation, it can only be in code according to MCC, MNC, SPN and GID
Value is judged, corresponding resource file is then loaded in code, still, this to sentence in the case where there are many SIM card type
Disconnected method will be very troublesome, needs to do judgement many times, low efficiency and error-prone.Therefore, it is necessary to Android system
The resource load mechanism for uniting primary is extended.
Summary of the invention
The technical problem to be solved by the present invention is to the deficiencies for background technique to provide a kind of extension Android system money
The method of source load.
The present invention uses following technical scheme to solve above-mentioned technical problem:
A method of extension Android system resource load specifically includes the following steps:
Step 1, the state change of SIM cards of mobile phones is monitored;
Step 2, when SIM card state changes, the operator's informaiton of SIM card is obtained, is loaded according to operator's informaiton
Different mapping tables obtains mapping result according to mapping table, and mapping result is stored in system property and then is terminated
Mapping;
Step 3, before Android system loads resource, MCC, MNC in device configuration information and current operation are obtained
Program packet name, and then MCC, the MNC that will acquire are saved in temporary variable;
Step 4, the packet name of program is obtained according to step 3 to judge whether current program needs to map;
Step 4.1: if desired carrying out mapping processing, MCC, MNC after mapping are taken out from system property, and then will reflect
MCC, MNC after penetrating replace MCC and MNC original in system configuration information respectively;
Step 4.2: if not needing to carry out mapping processing, the value of mapping being replaced the original MNC's of device configuration information
Value;
Step 5: after the completion of Android system loads resource, the value replacement of original MCC and MNC being returned.
It is adopted in step 2 as a kind of further preferred scheme of the method for extension Android system resource load of the present invention
The mapping mode mapped with SPN.
It is adopted in step 2 as a kind of further preferred scheme of the method for extension Android system resource load of the present invention
The mapping mode mapped with GID.
It is needed in step 4 as a kind of further preferred scheme of the method for extension Android system resource load of the present invention
The packet list of file names to be mapped is defined in code.
It is needed in step 4 as a kind of further preferred scheme of the method for extension Android system resource load of the present invention
The packet list of file names to be mapped is defined in MXL.
The invention adopts the above technical scheme compared with prior art, has following technical effect that
1, for the present invention when not using scheme proposed in this paper, different SIM cards loads different resources, is not available peace
The resource framework of tall and erect system needs manually to judge in code the type of SIM card, is then providing respectively in code to load
Source is shown.This method, code coupling is too high, and judges often, low efficiency;
2, it only needs as common resource use, according to mapping table, corresponding file is created under resource folder
Folder, system can be mapped automatically according to current SIM card, load the resource under corresponding folder, everything answers other
For be all it is transparent, reduce the workload of other application, reduce the degree of coupling of code, improve efficiency.
Detailed description of the invention
Fig. 1 is MNC mapping flow chart of the invention.
Specific embodiment
Technical solution of the present invention is described in further detail with reference to the accompanying drawing:
A method of extension Android system resource load, it is characterised in that: specifically include the 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, the operator's informaiton of SIM card is obtained, is loaded according to operator's informaiton
Different mapping tables obtains mapping result according to mapping table, and mapping result is stored in system property and then is terminated
Mapping;
Step 3, before Android system loads resource, MCC, MNC in device configuration information and current operation are obtained
Program packet name, and then MCC, the MNC that will acquire are saved in temporary variable;
Step 4, the packet name of program is obtained according to step 3 to judge whether current program needs to map;
Step 4.1: if desired carrying out mapping processing, MCC, MNC after mapping are taken out from system property, and then will reflect
MCC, MNC after penetrating replace MCC and MNC original in system configuration information respectively;
Step 4.2: if not needing to carry out mapping processing, the value of mapping being replaced the original MNC's of device configuration information
Value;
Step 5: after the completion of Android system loads resource, the value replacement of original MCC and MNC being returned.
Wherein, in step 2, it needs to map in step 4 using the mapping mode of SPN mapping or GID mapping
Packet list of file names is defined in code or MXL.
To solve the above problems, a kind of method for extending Android system resource load mechanism provided herein, make with
Resource load in upper situation is as primary resource load, it is no longer necessary to cumbersome judgement and load money are done in code
Source.
The resource load mechanism of Android system has supported MCC, the loading scheme of MNC to adopt primary resource load extension
The mode mapped with MNC, for example, the card of mobile phone insertion operator, Deutsche Telecom, system default preferentially load in resource folder
The resource of values-mcc204-mnc16, still, the operator have multiple sub-brand names, and the value of the MCCMNC of all sub-brand names is all
It is 20416, uses resource mapping method in this case, because the title of MNC has been acknowledged in the market, consideration will have
The value of the MNC used, to be mapped as some corresponding SPN, for example, by the sub-brand name 1 of MNC (999) the corresponding operator
(Ben NL), by the sub-brand name 2 (T-Mobile NL) of MNC (998) corresponding operator in this way, if mobile phone inserts this
The SIM card of sub-brand name 1 (Ben NL), system will preferentially go the resource under load values-mcc204-mnc999 file,
If mobile phone inserts the SIM card of this sub-brand name 2 (T-Mobile NL), system will preferentially remove load values-
Resource under mcc204-mnc998 file.
Wherein corresponding relationship, we pre-define in xml or in code, need answering according to SIM card customization resource
With only needing to create corresponding MCC-MNC file according to corresponding relationship under resource folder.
Two parts: MNC mapping and resource load are divided into for the extension of resource load mechanism.
MNC demapping section technology is realized:
Application program registers the monitoring to SIM card state change;When SIM card state changes, state change is received
Notice, obtain the attributes such as MCC, MNC, SPN and the GID of new SIM card;According to MCC, the value of MNC can uniquely determine one
Operator, then according to operator to determine whether need to map, and the mode (SPN mapping or GID mapping) of mapping, if
It needs to map, then loads different mapping tables according to operator;According to MCC, MNC, SPN and the GID of SIM card, reflecting
Penetrate the value after being mapped in relation table.It will be in the value deposit system property after mapping.
Resource loading section technology is realized:
Resource loading section needs to modify in the process of Android system load resource.Known Android system is in basis
The ID of resource can also specify the configuration information of current device when obtaining resource, the configuration information of current device is stored in
In the variable of one structural body, which describe all configuration informations of equipment, certainly also include MCC, the value of MNC.It is loading
During resource, the resource of load can be compared with device configuration information, obtain most matched resource.So we are providing
Mapping processing is carried out to the MNC of configuration information before the load of source, the function of resource impact thus may be implemented.
Before loading resource, the MCC in device configuration information, the packet name of MNC and currently running program are obtained.It will obtain
The MCC taken, MNC are saved in variable, interim to store.Judge whether current program needs to map according to packet name.It needs to reflect
The packet list of file names penetrated is defined in xml or in code.At the time of initialization, load or initial is carried out according to operator
Change.
Mapping processing is carried out if necessary, and the value for the mapping that demapping section saves, such as 999 are taken out from system property.It will
The value of mapping replaces the value of the original MNC of device configuration information, for example, replacing with 999 for 01.System according to new MCC,
The value of MNC searches and loads resource.After the completion of system loads resource, the value replacement of original MCC and MNC are returned, in this way
It will not influence the other places of system.
The above examples only illustrate the technical idea of the present invention, and this does not limit the scope of protection of the present invention, all
According to the technical idea provided by the invention, any changes made on the basis of the technical scheme each falls within the scope of the present invention
Within.Embodiments of the present invention are explained in detail above in conjunction with attached drawing, but the present invention is not limited to above-mentioned embodiment party
Formula can also be done without departing from the premise of the present invention within the knowledge of a person skilled in the art
Various change out.
Claims (5)
1. a kind of method of extension Android system resource load, it is characterised in that: specifically include the following steps:
Step 1, the state change of SIM cards of mobile phones is monitored;
Step 2, when SIM card state changes, the operator's informaiton of SIM card is obtained, is loaded according to operator's informaiton different
Mapping table, mapping result is obtained according to mapping table, will mapping result be stored in system property in so that terminate to map;
Step 3, before Android system loads resource, MCC, MNC in device configuration information and currently running journey are obtained
The packet name of sequence, and then MCC, the MNC that will acquire are saved in temporary variable;
Step 4, the packet name of program is obtained according to step 3 to judge whether current program needs to map;
Step 4.1: if desired carrying out mapping processing, MCC, MNC after mapping are taken out from system property, and then will map
MCC, MNC afterwards replaces MCC and MNC original in system configuration information respectively;
Step 4.2: if not needing to carry out mapping processing, the value of mapping being replaced to the value of the original MNC of device configuration information;
Step 5: after the completion of Android system loads resource, the value replacement of original MCC and MNC being returned.
2. a kind of method of extension Android system resource load according to claim 1, it is characterised in that: in step 2,
The mapping mode mapped using SPN.
3. a kind of method of extension Android system resource load according to claim 1, it is characterised in that: in step 2,
The mapping mode mapped using GID.
4. a kind of method of extension Android system resource load according to claim 1, it is characterised in that: in step 4,
The packet list of file names for needing to map is defined in code.
5. a kind of method of extension Android system resource load according to claim 4, it is characterised in that: in step 4,
The packet list of file names for needing to map is defined in xml.
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 CN105511851A (en) | 2016-04-20 |
CN105511851B true 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) |
Families Citing this family (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 |
CN108664259B (en) * | 2018-04-02 | 2022-04-15 | 青岛海信移动通信技术股份有限公司 | Method and terminal for installing application |
Citations (4)
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 |
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 |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8782443B2 (en) * | 2010-05-25 | 2014-07-15 | Microsoft Corporation | Resource-based adaptive server loading |
-
2015
- 2015-11-20 CN CN201510810703.5A patent/CN105511851B/en active Active
Patent Citations (4)
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 |
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 |
Also Published As
Publication number | Publication date |
---|---|
CN105511851A (en) | 2016-04-20 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN105446769B (en) | Image file upgrade processing method, device and terminal device | |
CN105682126B (en) | Configuration processing method and device for APN (access point name) parameter | |
CN107920112A (en) | Support configuration file method for pushing, central server and the storage medium of grayscale mode | |
WO2011071438A1 (en) | Method for automatic provisioning of a sim card | |
CN101656928A (en) | Short message processing method, system and assembly program unit | |
CN104581689A (en) | Terminal customized starting-up control method and device | |
WO2015103847A1 (en) | Configuration method and device | |
CN109660979A (en) | Internet of Things opens chucking method and device in the air, calculates equipment and storage medium | |
CN105511851B (en) | A method of extension Android system resource load | |
CN104158895A (en) | Mobile terminal, contact photo management method thereof and remote server | |
CN106657433A (en) | Method and device for naming physical network card in multi-network card environment | |
CN105978794A (en) | Method and device for replacing note name in instant messaging platform address book | |
CN105915361A (en) | Group upgrading method and device | |
CN103118358A (en) | Unique identification mobile phone user registration method | |
US20130091093A1 (en) | Method and device for managing information of a universal integrated circuit card | |
CN106502648A (en) | Application shows the method and terminal of language-specific | |
CN102984330A (en) | Contact person data management method of communication device | |
CN105812178B (en) | A kind of terminal staging method and terminal | |
CN107291637A (en) | The method and apparatus of compatible polytypic mobile communication module in Android system | |
CN101616498A (en) | A kind of method, Subscriber Identity Module and unit that carries out interactive information access | |
CN104683973B (en) | Management method and system are automatically configured based on intelligent terminal | |
CN102572800A (en) | Method for SIM (subscriber identity module) card to automatically read information of IMEI (international mobile equipment identity) information of terminal on basis of STK (SIM application tool kit) technology | |
CN106528144B (en) | Replace the method and user terminal of system font | |
CN110099179B (en) | Number updating method and device | |
CN107888746A (en) | A kind of method, storage device and mobile terminal for obtaining APN 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 |