CN103365698A - Method and device for solidifying resources in Android system - Google Patents
Method and device for solidifying resources in Android system Download PDFInfo
- Publication number
- CN103365698A CN103365698A CN2012100842458A CN201210084245A CN103365698A CN 103365698 A CN103365698 A CN 103365698A CN 2012100842458 A CN2012100842458 A CN 2012100842458A CN 201210084245 A CN201210084245 A CN 201210084245A CN 103365698 A CN103365698 A CN 103365698A
- Authority
- CN
- China
- Prior art keywords
- resource
- official
- version
- unpub
- announced
- 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
Images
Landscapes
- Stored Programmes (AREA)
- Document Processing Apparatus (AREA)
Abstract
The invention discloses a method and a device for solidifying resources in an Android system, and relates to the field of mobile communication. The method for solidifying the resources in the Android system includes acquiring a serial number ID (identity) of an unpublished official resource of the Android system; writing the unpublished official resource and the ID thereof into an unpublished solidification file so as to solidify a corresponding relation between the unpublished official resource and the ID; compiling a system which contains the unpublished solidification file to obtain a compiled system version. The method and the device have the advantages that dislocation of identification numbers of the resources is prevented, and normal running of programs and normal running of the system are guaranteed. The method and the device are mainly used in electronic terminal products.
Description
Technical field
The present invention relates to moving communicating field, relate in particular to a kind of method and device that in Android system, solidifies resource.
Background technology
At present, increase gradually based on the software application of Android (Android) system, Android system self provide a cover official version resource altogether the developer use.On this basis, the developer can increase personalized resource according to self product demand, such as picture, character and color etc.Because the resource in the Android system is arranged according to the order of English alphabet, therefore the resource that increases newly of developer, may be inserted in the sequence of official's version resource and go, so that be in the sequence number (ID of the official's version resource after the insertion position, identification) occur changing, thereby the resource transfer that leads to errors causes the demonstration entanglement, even program and system can't normally be moved.
Summary of the invention
Embodiments of the invention provide a kind of method and device that solidifies resource in Android system, avoid the dislocation of resource identification number, have guaranteed the normal operation of program and system.
For achieving the above object, embodiments of the invention adopt following technical scheme:
A kind of method of solidifying resource in Android system comprises:
Obtain the sequence number ID of the unpub official of Android system version resource;
Described unpub official version resource and ID thereof write do not announce in the curing document, with the corresponding relation between fixing described unpub official version resource and the ID;
To comprise the described system that does not announce curing document and compile, the system version after obtaining compiling.
A kind of device that solidifies resource in Android system comprises:
The sequence number acquiring unit is for the sequence number ID that obtains the unpub official of Android system version resource;
The resource solidified cell, be used for will described unpub official version resource and ID write and do not announce curing document, to fix the corresponding relation between described unpub official version resource and the ID;
Compilation unit is used for comprising the described system that does not announce curing document and compiles the system version after obtaining compiling.
A kind of method and device that in Android system, solidifies resource that the embodiment of the invention provides, be solidificated in described the announcement in the curing document by the corresponding relation with unpub official version resource and ID thereof, so that the new resource that adds can not affect the ID of described unpub official version resource, avoid changing the demonstration entanglement that causes, the normal operation of assurance program and system because of ID.
Description of drawings
In order to be illustrated more clearly in the embodiment of the invention or technical scheme of the prior art, the below will do to introduce simply to the accompanying drawing of required use in embodiment or the description of the Prior Art, apparently, accompanying drawing in the following describes only is some embodiments of the present invention, for those of ordinary skills, under the prerequisite of not paying creative work, can also obtain according to these accompanying drawings other accompanying drawing.
Solidify the process flow diagram of the method for resource in a kind of Android system that Fig. 1 provides for the embodiment of the invention;
Solidify the process flow diagram of the method for resource in the another kind of Android system that Fig. 2 provides for the embodiment of the invention;
Solidify the block diagram of the device of resource in a kind of Android system that Fig. 3 provides for the embodiment of the invention;
The block diagram of the sequence number acquiring unit that Fig. 4 provides for the embodiment of the invention;
Solidify the block diagram of the device of resource in the another kind of Android system that Fig. 5 provides for the embodiment of the invention.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the invention, the technical scheme in the embodiment of the invention is clearly and completely described, obviously, described embodiment only is the present invention's part embodiment, rather than whole embodiment.Based on the embodiment among the present invention, those of ordinary skills belong to the scope of protection of the invention not making the every other embodiment that obtains under the creative work prerequisite.
Android system self is with official's version resource, and these official's version resources comprise picture, character, color scheme etc.Resource in the Android system is named with English, and system is according to the lexicographic order in the English name of resource, for each resource sorts.To come before the position with the resource of b beginning with the position of the resource of a beginning such as, English name.Shown in the table specific as follows, three kinds of official's version resources have been listed.
ID | Resource name | Resource type |
01 | a_pic1.png | Image |
02 | b_pic2.png | Image |
03 | d_pic3.png | Image |
Table 1
Each resource is called according to ID corresponding to resource by system.For table 1, resource a_pic1.png will call in system, finds a_pic1.png by ID01.
When the developer increases new resource, newly-increased resource may since the problem of name be inserted in the putting in order of official's version resource, thereby destroy relation between official's version resource and the corresponding ID, as shown in table 2.
Sequence number | Resource name | Resource type |
01 | a_pic1.png | Image |
02 | b_pic2.png | Image |
03 | c_pic_new.png | Image |
04 | d_pic3.png | Image |
Table 2
As seen, because the insertion of c_pic_new.png, the ID that d_pic3.png is corresponding becomes 04 by 03, mistake can occur when system call resource c_pic_new.png.
Official's version resource that Android system carries comprises official's version resource and the unpub official version resource of having announced.Described official's version resource of having announced is visible for the user, and described unpub resource is invisible for the user.Wherein, official's version resource of having announced is recorded in corresponding ID to be announced in the curing document.The described curing document of having announced is named as the public.xml file usually, and the official's version resource that records in this document and the corresponding relation of ID are fixed, and can not change because of the increase of new resources.But the corresponding relation of unpub official version resource and ID can be subject to the adding of new resources and change.
The embodiment of the invention provides the method for solidifying resource in Android system, as shown in Figure 1, may further comprise the steps:
101, obtain the ID of the unpub official of Android system version resource.
102, described unpub official version resource and ID thereof are write do not announce in the curing document, with the corresponding relation between fixing described unpub official version resource and the ID.
Unpub official version resource and ID are recorded in described the announcement in the curing document, realize fixing corresponding between unpub official version resource and the ID, can not cause because of the insertion of new resources the change of ID.In addition, by sign is not announced in described resource setting of not announcing in the curing document, guarantee that the described resource of announcing in the curing document of asking is in not publication status.
103, will comprise the described system that does not announce curing document and compile, the system version after obtaining compiling.
The embodiment of the invention provides a kind of method of solidifying resource in Android system, be solidificated in described the announcement in the curing document by the corresponding relation with unpub official version resource and ID thereof, so that the new resource that adds can not affect the ID of described unpub official version resource, avoid changing the demonstration entanglement that causes, the normal operation of assurance program and system because of ID.
Further, the present invention also provides a kind of method of solidifying resource in Android system, and as shown in Figure 2, the method comprises:
201, Gains resources sign ID map listing from the Android system official version, and obtain and announce curing document.
Wherein, comprise in the described resource ID map listing and announce and unpub official version resource and corresponding ID, described the announcement comprises official's version resource and the fixing corresponding ID of described official's version resource of having announced that has announced in the curing document.
Common described resource ID map listing is named as android resource.xml, and the described curing document of having announced is named as the public.xml file.
Concrete, the method for obtaining described resource ID map listing can be: obtain the android.jar file from SDK (software development kit, SDK (Software Development Kit)), and therefrom extract described resource ID map listing; Or: by overall situation compiling Android system official version, from the file that generates (path is: out target common R com android internal the R.java file) obtain.
202, by comparing described resource identification ID map listing and the described curing document of having announced, obtain the ID of described unpub official version resource.
Comprise in the described resource ID map listing and announce and unpub official version resource and corresponding ID, described the announcement comprises official's version resource and the fixing corresponding ID of described official's version resource of having announced that has announced in the curing document, by contrasting described resource ID map listing and the described curing document of having announced, can get access to the ID of unpub official version resource.
203, described unpub official version resource and ID thereof are write do not announce in the curing document, with the corresponding relation between fixing described unpub official version resource and the ID, and described resource setting of not announcing in the curing document do not announced sign.
By being write, described unpub official version resource and ID thereof do not announce in the curing document, thereby realize the fixing of corresponding relation between unpub official version resource and the ID, wherein not announcing curing document can called after public_fixed.xml file, and is stored under the same catalogue with the public.xml file.In addition, because newly-generated public_fixed.xml file is visible, for keeping the invisibility of unpub official version resource wherein, need to sign not be announced in the resource setting in the public_fixed.xml file.
For instance, to every resource record add<!--@hide--〉sign, such as, for following resource:
Its resource type is " style ", and name is called " Animation ", and ID is 0x01030000.
Be recorded into the public_fixed.xml file, and adding<!--@hide--〉sign after, format change is:
<!--@hide-->
<public type=”style”name=”Animation”id=”0x01030000”/>
Realized the fixing corresponding of resource and ID=0x01030000, and guaranteed that this resource is in not publication status.
204, will comprise the described system that does not announce curing document and compile, the system version after obtaining compiling.
Need to prove that the method for the embodiment of the invention can be applied to each above version of Android 2.0 versions, such as Android 2.0,2.1,2.2,2.3 and 4.0 etc.
The embodiment of the invention provides a kind of method of solidifying resource in Android system, be solidificated in described the announcement in the curing document by the corresponding relation with unpub official version resource and ID thereof, so that the new resource that adds can not affect the ID of described unpub official version resource, avoid changing the demonstration entanglement that causes, the normal operation of assurance program and system because of ID.
In addition, the embodiment of the invention also provides a kind of device that solidifies resource in Android system, and as shown in Figure 3, this device comprises sequence number acquiring unit 31, resource solidified cell 32, compilation unit 33.
Sequence number acquiring unit 31 is used for obtaining the sequence number ID of the unpub official of Android system version resource.Resource solidified cell 32 be used for will described unpub official version resource and ID write and do not announce curing document, to fix the corresponding relation between described unpub official version resource and the ID.Compilation unit 33 is used for comprising the described system that does not announce curing document and compiles the system version after obtaining compiling.
Further, described sequence number acquiring unit 31 specifically comprises resource acquisition subelement 311, and sequence number obtains subelement 312.
Resource acquisition subelement 311 is used for the map listing from Android system official version Gains resources sign ID, and obtains and announce curing document; Comprise in the described resource ID map listing and announce and unpub official version resource and corresponding ID, described the announcement comprises official's version resource and the fixing corresponding ID of described official's version resource of having announced that has announced in the curing document.Sequence number obtains subelement 312 and is used for by comparing described resource identification ID map listing and the described curing document of having announced, and obtains the ID of described unpub official version resource.
Wherein, comprise in the described resource ID map listing and announce and unpub official version resource and corresponding ID, described the announcement comprises official's version resource and the fixing corresponding ID of described official's version resource of having announced that has announced in the curing document.
Further, as shown in Figure 5, described device also comprises does not announce sign setting unit 34, is used for sign is not announced in described resource setting of not announcing curing document.
Common described resource ID map listing is named as android_resource.xml, and the described curing document of having announced is named as the public.xml file.By being write, described unpub official version resource and ID thereof do not announce in the curing document, thereby realize the fixing of corresponding relation between unpub official version resource and the ID, wherein not announcing curing document can called after public_fixed.xml file, and is stored under the same catalogue with the public.xml file.In addition, because newly-generated public_fixed.xml file is visible, for keeping the invisibility of unpub official version resource wherein, need to sign not be announced in the resource setting in the public_fixed.xml file.The set-up mode of not announcing sign can be participated in the aforementioned part of the embodiment of the invention, repeats no more herein.
Need to prove that the device of the embodiment of the invention can be applied to each above version of Android 2.0 versions, such as Android 2.0,2.1,2.2,2.3 and 4.0 etc.
The embodiment of the invention provides a kind of device that solidifies resource in Android system, be solidificated in described the announcement in the curing document by the corresponding relation with unpub official version resource and ID thereof, so that the new resource that adds can not affect the ID of described unpub official version resource, avoid changing the demonstration entanglement that causes, the normal operation of assurance program and system because of ID.
The above; be the specific embodiment of the present invention only, but protection scope of the present invention is not limited to this, anyly is familiar with those skilled in the art in the technical scope that the present invention discloses; can expect easily changing or replacing, all should be encompassed within protection scope of the present invention.Therefore, protection scope of the present invention should be as the criterion with the protection domain of described claim.
Claims (10)
1. a method of solidifying resource in Android system is characterized in that, comprising:
Obtain the sequence number ID of the unpub official of Android system version resource;
Described unpub official version resource and ID thereof write do not announce in the curing document, with the corresponding relation between fixing described unpub official version resource and the ID;
To comprise the described system that does not announce curing document and compile, the system version after obtaining compiling.
2. method according to claim 1 is characterized in that, the described sequence number ID that obtains the unpub official of Android system version resource specifically comprises:
Gains resources sign ID map listing from the Android system official version, and obtain and announce curing document; Comprise in the described resource ID map listing and announce and unpub official version resource and corresponding ID, described the announcement comprises official's version resource and the fixing corresponding ID of described official's version resource of having announced that has announced in the curing document;
By comparing described resource identification ID map listing and the described curing document of having announced, obtain the ID of described unpub official version resource.
3. method according to claim 2 is characterized in that, has describedly announced curing document and the described curing document of not announcing is the XML formatted file.
4. method according to claim 1 is characterized in that, described unpub official version resource and ID thereof are write do not announce in the curing document after, also comprise:
Sign is not announced in described resource setting of not announcing in the curing document.
5. each described method in 4 according to claim 1 is characterized in that described Android system comprises each version that Android 2.0 versions are above.
6. a device that solidifies resource in Android system is characterized in that, comprising:
The sequence number acquiring unit is for the sequence number ID that obtains the unpub official of Android system version resource;
The resource solidified cell, be used for will described unpub official version resource and ID write and do not announce curing document, to fix the corresponding relation between described unpub official version resource and the ID;
Compilation unit is used for comprising the described system that does not announce curing document and compiles the system version after obtaining compiling.
7. device according to claim 6 is characterized in that, described sequence number acquiring unit specifically comprises:
The resource acquisition subelement is used for the map listing from Android system official version Gains resources sign ID, and obtains and announce curing document; Comprise in the described resource ID map listing and announce and unpub official version resource and corresponding ID, described the announcement comprises official's version resource and the fixing corresponding ID of described official's version resource of having announced that has announced in the curing document;
Sequence number obtains subelement, is used for by comparing described resource identification ID map listing and the described curing document of having announced, and obtains the ID of described unpub official version resource.
8. device according to claim 7 is characterized in that, has describedly announced curing document and the described curing document of not announcing is the XML formatted file.
9. device according to claim 6 is characterized in that, also comprises:
Do not announce the sign setting unit, be used for sign is not announced in described resource setting of not announcing curing document.
10. the described device of any one in 9 according to claim 6 is characterized in that described Android system comprises each version that Android 2.0 versions are above.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201210084245.8A CN103365698B (en) | 2012-03-27 | 2012-03-27 | A kind of method and device for solidifying resource in Android system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201210084245.8A CN103365698B (en) | 2012-03-27 | 2012-03-27 | A kind of method and device for solidifying resource in Android system |
Publications (2)
Publication Number | Publication Date |
---|---|
CN103365698A true CN103365698A (en) | 2013-10-23 |
CN103365698B CN103365698B (en) | 2017-06-20 |
Family
ID=49367127
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201210084245.8A Active CN103365698B (en) | 2012-03-27 | 2012-03-27 | A kind of method and device for solidifying resource in Android system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN103365698B (en) |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101553779A (en) * | 2006-10-17 | 2009-10-07 | 三星Sds株式会社 | Migration apparatus which convert application program of mainframe system into application program of open system and method for thereof |
CN101788906A (en) * | 2010-01-21 | 2010-07-28 | 中兴通讯股份有限公司 | Resource management method and system thereof |
-
2012
- 2012-03-27 CN CN201210084245.8A patent/CN103365698B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101553779A (en) * | 2006-10-17 | 2009-10-07 | 三星Sds株式会社 | Migration apparatus which convert application program of mainframe system into application program of open system and method for thereof |
US20100095283A1 (en) * | 2006-10-17 | 2010-04-15 | Samsung Sds Co., Ltd. | Migration Apparatus Which Convert Application Program of Mainframe System into Application Program of Open System and Method for Thereof |
CN101788906A (en) * | 2010-01-21 | 2010-07-28 | 中兴通讯股份有限公司 | Resource management method and system thereof |
Also Published As
Publication number | Publication date |
---|---|
CN103365698B (en) | 2017-06-20 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108228188B (en) | View component processing method, electronic device and readable storage medium | |
CN102207873B (en) | Realizing method of JavaScript extended object based on Android platform, and binding interface structure | |
CN102622237B (en) | A kind of collocation method of business function procedure and system | |
CN103577207A (en) | Loading method and loading device for interface components in custom interface system | |
CN106484464A (en) | Tuner chip driving method and electronic equipment | |
CN108037941A (en) | Application program update method, electronic equipment based on public plug-in unit, storage medium | |
CN104133676A (en) | Function execution method and function execution device based on scripts | |
CN105404574B (en) | Smart card and mobile terminal consistency test method and device | |
CN111967209A (en) | SOC simulation verification method and device and storage medium | |
CN105095087A (en) | Permission operation based software test system and method | |
CN103198244B (en) | The method of protection dynamic link library | |
CN103002492A (en) | Communication test method and device for mobile terminal (MT) | |
CN111967274B (en) | Label conversion processing method and device, electronic equipment and readable storage medium | |
CN103379145A (en) | Information processing method, apparatus and system | |
CN103164245A (en) | Method and terminal applied for displaying specific language | |
CN103365698A (en) | Method and device for solidifying resources in Android system | |
CN108733990A (en) | A kind of document protection method and terminal device based on block chain | |
ATE521938T1 (en) | SYSTEM AND METHOD FOR DEVELOPING COMPONENT-BASED APPLICATIONS | |
CN105100901A (en) | Virtual storage card configuration method and system | |
CN108897532B (en) | Method and device for class factory registration and electronic equipment | |
CN112965733A (en) | Component library updating method and device, electronic equipment and readable storage medium | |
KR20190061402A (en) | A language learning technology using an application and plastic typed-word cards equipped with nfc chip | |
CN109388571B (en) | Method and device for acquiring identification information, computer equipment and storage medium | |
CN112579133A (en) | Firmware program updating method and device, storage medium and electronic equipment | |
CN106020894A (en) | Method for controlling electronic device and electronic device |
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 |