CN103365698B - A kind of method and device for solidifying resource in Android system - Google Patents

A kind of method and device for solidifying resource in Android system Download PDF

Info

Publication number
CN103365698B
CN103365698B CN201210084245.8A CN201210084245A CN103365698B CN 103365698 B CN103365698 B CN 103365698B CN 201210084245 A CN201210084245 A CN 201210084245A CN 103365698 B CN103365698 B CN 103365698B
Authority
CN
China
Prior art keywords
resource
version
official
announced
unpub
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
Application number
CN201210084245.8A
Other languages
Chinese (zh)
Other versions
CN103365698A (en
Inventor
郭和平
窦立立
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Yulong Computer Telecommunication Scientific Shenzhen Co Ltd
Original Assignee
Yulong Computer Telecommunication Scientific Shenzhen Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Yulong Computer Telecommunication Scientific Shenzhen Co Ltd filed Critical Yulong Computer Telecommunication Scientific Shenzhen Co Ltd
Priority to CN201210084245.8A priority Critical patent/CN103365698B/en
Publication of CN103365698A publication Critical patent/CN103365698A/en
Application granted granted Critical
Publication of CN103365698B publication Critical patent/CN103365698B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The invention discloses a kind of method and device for solidifying resource in Android system, it is related to moving communicating field, it is to avoid the dislocation of resource identification number, it is ensured that the normal operation of program and system.A kind of method for solidifying resource in Android system, including:Obtain the sequence number ID of the unpub official's version resource of Android system;During the unpub official version resource and its ID write-ins do not announced into curing document, with the corresponding relation between fixation unpub official's version resource and ID;To be compiled comprising the system for not announcing curing document, the system version after being compiled.Present invention is mainly used for electronic terminal product.

Description

A kind of method and device for solidifying resource in Android system
Technical field
The present invention relates to moving communicating field, more particularly to a kind of method and device for solidifying resource in Android system.
Background technology
At present, the software application based on Android (Android) system gradually increases, and Android system itself provides a set of official Developer is used square version resource altogether.On this basis, developer can increase personalized resource according to itself product demand, Such as picture, character and color.Because the resource in Android system is arranged according to the order of English alphabet, therefore developer The resource for newly increasing, may be inserted into the sequence of official's version resource so that the official's version resource after insertion position Sequence number (ID, identification) there is change, so as to cause the resource transfer of mistake, trigger display entanglement, or even Program and system is set normally to run.
The content of the invention
The embodiment provides a kind of method and device for solidifying resource in Android system, it is to avoid resource identification Number dislocation, it is ensured that the normal operation of program and system.
To reach above-mentioned purpose, embodiments of the invention are adopted the following technical scheme that:
A kind of method for solidifying resource in Android system, including:
Obtain the sequence number ID of the unpub official's version resource of Android system;
It is described unpub with fixation during the unpub official version resource and its ID write-ins do not announced into curing document Corresponding relation between official's version resource and ID;
To be compiled comprising the system for not announcing curing document, the system version after being compiled.
A kind of device for solidifying resource in Android system, including:
Sequence number acquiring unit, the sequence number ID for obtaining the unpub official's version resource of Android system;
Resource solidified cell, in the unpub official version resource and its ID write-ins do not announced into curing document, With the corresponding relation between fixation unpub official's version resource and ID;
Compilation unit, for will be compiled comprising the system for not announcing curing document, the system after being compiled Version.
A kind of method and device for solidifying resource in Android system provided in an embodiment of the present invention, by will be unpub The corresponding relation of official's version resource and its ID is solidificated in described in not announcing curing document so that the new resource for adding is not interfered with The ID of unpub official's version resource, it is to avoid the display entanglement caused by ID changes, it is ensured that the normal fortune of program and system OK.
Brief description of the drawings
In order to illustrate more clearly about the embodiment of the present invention or technical scheme of the prior art, below will be to embodiment or existing The accompanying drawing to be used needed for having technology description is briefly described, it should be apparent that, drawings in the following description are only this Some embodiments of invention, for those of ordinary skill in the art, on the premise of not paying creative work, can be with Other accompanying drawings are obtained according to these accompanying drawings.
Fig. 1 is the flow chart of the method for solidification resource in a kind of Android system provided in an embodiment of the present invention;
Fig. 2 is the flow chart of the method for solidification resource in another Android system provided in an embodiment of the present invention;
Fig. 3 is the block diagram of the device of solidification resource in a kind of Android system provided in an embodiment of the present invention;
Fig. 4 is the block diagram of sequence number acquiring unit provided in an embodiment of the present invention;
Fig. 5 is the block diagram of the device of solidification resource in another Android system provided in an embodiment of the present invention.
Specific embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is carried out clear, complete Site preparation is described, it is clear that described embodiment is only a part of embodiment of the invention, rather than whole embodiments.It is based on Embodiment in the present invention, it is every other that those of ordinary skill in the art are obtained under the premise of creative work is not made Embodiment, belongs to the scope of protection of the invention.
, with official's version resource, these officials version resource is including picture, character, color scheme etc. for Android system itself.Peace Resource in tall and erect system is named with English, and system is according to the lexicographic order in the English name of resource, is that each resource is entered Row sequence.Such as, before the position of the resource that English name is started with a will come the position of the resource started with b.Table specific as follows It is shown, list three kinds of official's version resources.
ID Resource name Resource type
01 a_pic1.png Image
02 b_pic2.png Image
03 d_pic3.png Image
Table 1
System calls each resource according to the corresponding ID of resource.For table 1, system will call resource a_pic1.png, It is that a_pic1.png is found by ID01.
When developer increases new resource, newly-increased resource may be inserted into the row of official's version resource due to the problem named In row order, so that the relation destroyed between official's version resource and 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
It can be seen that, due to the insertion of c_pic_new.png, the corresponding ID of d_pic3.png become 04 by 03, when system is called Mistake occurs during resource c_pic_new.png.
Official's version resource that Android system is carried includes the official's version resource announced and unpub official version resource.Institute It is visible for user to state the official's version resource announced, and the unpub resource is invisible for user.Wherein, it is public Official's version resource of cloth is recorded in having announced curing document with corresponding ID.The curing document of having announced generally is named as Public.xml files, the corresponding relation of the official version resource and the ID that are recorded in this document be it is fixed, will not be because of new resources Increase and change.But unpub official's version resource can be subject to the addition of new resources and change with the corresponding relation of ID.
The method for solidifying resource in Android system is the embodiment of the invention provides, as shown in figure 1, comprising the following steps:
101st, the ID of the unpub official's version resource of Android system is obtained.
102nd, in the unpub official version resource and its ID write-ins not announced into curing document, with the fixed not public affairs Corresponding relation between official's version resource and ID of cloth.
Unpub official version resource and ID records are not announced into curing document described, unpub official is realized It is fixed corresponding between version resource and ID, the change of ID will not be caused because of the insertion of new resources.In addition, by described not public Resource in cloth curing document is set does not announce mark, it is ensured that the resource asked in announcement curing document is in does not announce shape State.
103rd, will be compiled comprising the system for not announcing curing document, the system version after being compiled.
The embodiment of the invention provides it is a kind of in Android system solidify resource method, by by unpub official version The corresponding relation of resource and its ID is solidificated in described in not announcing curing document so that the new resource for adding do not interfere with it is described not The ID of official's version resource of announcement, it is to avoid the display entanglement caused by ID changes, it is ensured that the normal operation of program and system.
Further, present invention also offers a kind of method for solidifying resource in Android system, as shown in Fig. 2 the party Method includes:
201st, resource identification ID map listings are obtained from Android system official version, and curing document has been announced in acquisition.
Wherein, included in the resource ID map listing and announced and unpub official version resource and corresponding ID, institute State to have announced in curing document and fix corresponding ID comprising the official's version resource announced and the official's version resource announced.
The usual resource ID map listing is named as android resource.xml, described to have announced curing document It is named as public.xml files.
Specifically, obtain the method for the resource ID map listing can be:From SDK (software development Kit, SDK) middle acquisition android.jar files, and therefrom extract the resource ID map listing;Or: By overall situation compiling Android system official version, (path is from the file of generation:out\target\common\R\com\ Android internal R.java files) obtain.
202nd, by compare the resource identification ID map listings and it is described announced curing document, obtain described in do not announce Official version resource ID.
Included in the resource ID map listing and announced and unpub official version resource and corresponding ID, it is described public Corresponding ID is fixed comprising the official's version resource announced and the official's version resource announced in cloth curing document, by right Than the resource ID map listing and the ID for having announced curing document, unpub official's version resource being got.
203rd, in the unpub official version resource and its ID write-ins not announced into curing document, with the fixed not public affairs Corresponding relation between official's version resource and ID of cloth, and mark is not announced to the resource setting do not announced in curing document Know.
In by writing the unpub official version resource and its ID and not announce curing document, so as to realize not announcing Official version resource and ID between corresponding relation fixation, wherein not announcing curing document can be named as public_ Fixed.xml files, and be stored under same catalogue with public.xml files.Further, since newly-generated public_ Fixed.xml files are visible, to keep the invisibility of unpub official's version resource therein, it is necessary to public_ Resource in fixed.xml files is set does not announce mark.
For example, to every resource record addition<!--@hide-->Mark, such as, for following resource:
Its resource type be " style ", entitled " Animation ", ID is 0x01030000.
Being recorded into public_fixed.xml files, and add<!--@hide-->After mark, format change is:
<!--@hide-->
<Public type=" style " name=" Animation " id=" 0x01030000 "/>
Realize resource fixed corresponding with ID=0x01030000, and ensure that the resource is in non-publication status.
204th, will be compiled comprising the system for not announcing curing document, the system version after being compiled.
It should be noted that the method for the embodiment of the present invention, can apply to each version more than version of Android 2.0, than Such as Android 2.0,2.1,2.2,2.3 and 4.0.
The embodiment of the invention provides it is a kind of in Android system solidify resource method, by by unpub official version The corresponding relation of resource and its ID is solidificated in described in not announcing curing document so that the new resource for adding do not interfere with it is described not The ID of official's version resource of announcement, it is to avoid the display entanglement caused by ID changes, it is ensured that the normal operation of program and system.
Additionally, the embodiment of the present invention additionally provides a kind of device for solidifying resource in Android system, as shown in figure 3, should Device includes sequence number acquiring unit 31, resource solidified cell 32, compilation unit 33.
Sequence number acquiring unit 31 is used to obtain the sequence number ID of the unpub official's version resource of Android system.Resource solidifies During unit 32 is used to for the unpub official version resource and its ID write-ins not to announce curing document, do not announced with described in fixed Official version resource and ID between corresponding relation.Compilation unit 33 is used to enter comprising the system for not announcing curing document Row compiling, the system version after being compiled.
Further, the sequence number acquiring unit 31 specifically includes resource acquisition subelement 311, and it is single that sequence number obtains son Unit 312.
Resource acquisition subelement 311 is used to obtain resource identification ID map listings from Android system official version, and obtains Take and announced curing document;Comprising having announced and unpub official version resource and corresponding in the resource ID map listing ID, described announcement in curing document fixes correspondence comprising the official's version resource announced and the official's version resource announced ID.Sequence number obtains subelement 312 to be used to solidify text by comparing the resource identification ID map listings and described announcement Part, obtains the ID of unpub official's version resource.
Wherein, included in the resource ID map listing and announced and unpub official version resource and corresponding ID, institute State to have announced in curing document and fix corresponding ID comprising the official's version resource announced and the official's version resource announced.
Further, as shown in figure 5, described device also includes not announcing mark setting unit 34, for described not public Resource in cloth curing document is set does not announce mark.
The usual resource ID map listing is named as android_resource.xml, described to have announced curing document It is named as public.xml files.Write and do not announce curing document by by unpub official's version resource and its ID In, so as to realize the fixation of corresponding relation between unpub official's version resource and ID, wherein do not announce curing document can order Entitled public_fixed.xml files, and be stored under same catalogue with public.xml files.Further, since newly-generated Public_fixed.xml files are visible, to keep the invisibility of unpub official's version resource therein, it is necessary to right Resource in public_fixed.xml files is set does not announce mark.Not announcing the set-up mode of mark can participate in of the invention real A preceding sections is applied, here is omitted.
It should be noted that the device of the embodiment of the present invention, can apply to each version more than version of Android 2.0, than Such as Android 2.0,2.1,2.2,2.3 and 4.0.
The embodiment of the invention provides it is a kind of in Android system solidify resource device, by by unpub official version The corresponding relation of resource and its ID is solidificated in described in not announcing curing document so that the new resource for adding do not interfere with it is described not The ID of official's version resource of announcement, it is to avoid the display entanglement caused by ID changes, it is ensured that the normal operation of program and system.
The above, specific embodiment only of the invention, but protection scope of the present invention is not limited thereto, and it is any Those familiar with the art the invention discloses technical scope in, change or replacement can be readily occurred in, should all contain Cover within protection scope of the present invention.Therefore, protection scope of the present invention should be based on the protection scope of the described claims.

Claims (6)

1. it is a kind of in Android system solidify resource method, it is characterised in that including:
Obtain the sequence number ID of the unpub official's version resource of Android system;
During the unpub official version resource and its ID write-ins do not announced into curing document, with the fixation unpub official Corresponding relation between version resource and ID;
To be compiled comprising the system for not announcing curing document, the system version after being compiled;
The sequence number ID for obtaining the unpub official's version resource of Android system, specifically includes:From Android system official version Middle acquisition resource identification ID map listings, and curing document has been announced in acquisition;Comprising in the resource identification ID map listings Announce and unpub official version resource and corresponding ID, it is described to have announced in curing document comprising the official's version resource announced And the official's version resource announced fixes corresponding ID;By comparing the resource identification ID map listings and the public affairs Cloth curing document, obtains the ID of unpub official's version resource;
After unpub official's version resource and its ID write-ins are not announced in curing document, also include:
The resource do not announced in curing document is set and does not announce mark.
2. method according to claim 1, it is characterised in that described to have announced curing document and described do not announced solidification text Part is XML format file.
3. method according to claim 1 and 2, it is characterised in that the Android system is included more than the version of Android 2.0 Each version.
4. it is a kind of in Android system solidify resource device, it is characterised in that including:
Sequence number acquiring unit, the sequence number ID for obtaining the unpub official's version resource of Android system;
Resource solidified cell, in the unpub official version resource and its ID write-ins do not announced into curing document, with solid Corresponding relation between fixed unpub official's version resource and ID;
Compilation unit, for will be compiled comprising the system for not announcing curing document, the system version after being compiled;
The sequence number acquiring unit is specifically included:Resource acquisition subelement, for obtaining money from Android system official version Source identifies ID map listings, and curing document has been announced in acquisition;Comprising having announced and not in the resource identification ID map listings Official's version resource and corresponding ID of announcement, it is described announced in curing document comprising the official's version resource announced and it is described Official's version resource of announcement fixes corresponding ID;Sequence number obtains subelement, for being mapped by comparing the resource identification ID List and the ID for having announced curing document, having obtained unpub official's version resource;
Described device also includes:
Mark setting unit is not announced, mark is not announced for being set to the resource do not announced in curing document.
5. device according to claim 4, it is characterised in that described to have announced curing document and described do not announced solidification text Part is XML format file.
6. the device according to claim 4 or 5, it is characterised in that the Android system is included more than the version of Android 2.0 Each version.
CN201210084245.8A 2012-03-27 2012-03-27 A kind of method and device for solidifying resource in Android system Active CN103365698B (en)

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 CN103365698A (en) 2013-10-23
CN103365698B true 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)

* Cited by examiner, † Cited by third party
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

Patent Citations (2)

* Cited by examiner, † Cited by third party
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

Also Published As

Publication number Publication date
CN103365698A (en) 2013-10-23

Similar Documents

Publication Publication Date Title
CN103902265B (en) One kind applies implementation method and relevant apparatus
CN105446769B (en) Image file upgrade processing method, device and terminal device
CN105446772B (en) A kind of method and apparatus of system upgrade
ATE410015T1 (en) METHOD AND SYSTEM FOR CREATING A PERMANENT CONFIRMATION OF A SERVICE FOR A MOBILE TERMINAL
CN110018840B (en) Intelligent contract upgrading method and device, block chain link point equipment and medium
CN105808251A (en) Virtual function table based method and system for bypassing security detection by hijack
CN105204823A (en) Method and device for generating application installation package
GB2406938A (en) Method and apparatus for handling text and binary markup languages in a computing device
CN108229148A (en) A kind of sandbox hulling method and system based on Android virtual machines
CN109684219A (en) System performance testing method, apparatus and storage medium
CN110704028A (en) Buried point statistical method, electronic device and computer equipment
CN105095087A (en) Permission operation based software test system and method
CN103365698B (en) A kind of method and device for solidifying resource in Android system
CN108170461A (en) Difference upgrade package generation method, difference upgrade method and device
CN102984330A (en) Contact person data management method of communication device
CN110134380A (en) A kind of code generating method based on template engine, device and electronic equipment
CN110414218A (en) Kernel detection method, device, electronic equipment and storage medium
CN108762983A (en) Multi-medium data restoration methods and device
CN109325221B (en) Method and device for merging table files
CN104320415A (en) Dynamic plug-in type protocol parsing method of substation equipment
CN103716395B (en) Oftware updating method and renewal server
CN103106090B (en) The installation method of a kind of smart card and application thereof
CN107562501A (en) A kind of smart machine management-control method and system
CN103546463B (en) Additional-parameter transmission method and additional-parameter transmission device based on network connection central system
CN109086145B (en) Data generation method and device and computer storage medium

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