The content of the invention
In view of the above problems, it is proposed that the present invention so as to provide one kind overcome above mentioned problem or at least in part solve on
State the treating method and apparatus of the asynchronous call mechanism of the Android application of problem.
According to one aspect of the present invention, there is provided a kind of processing method of the asynchronous call mechanism of Android application, wherein,
Including:
Virtual machine constructor environment, attending to anything else for one or more the specified Android applications in Android system is virtual using being put into
In machine so that attending to anything else for each specified Android application is applied and can specify Android application parallel running with corresponding;
Asynchronous call event to the application of attending to anything else of the specified Android application on virtual machine carries out agency's treatment so that
The application of attending to anything else of the specified Android application in virtual machine is able to carry out the corresponding operation of the asynchronous call event.
Alternatively, the method is further included:State Agent components in advance in Android system;
The asynchronous call event of the application of attending to anything else of the specified Android application on virtual machine carries out agency's treatment
Including:
Monitor the asynchronous call event in Android system;
When there is asynchronous call event in listening to Android system, the asynchronous call event is intercepted, judging described different
The corresponding target element performed in message of step event whether be specified Android application in virtual machine application of attending to anything else
Component;
It is then, the target element in the corresponding execution message of the asynchronous call event to be replaced with into the Agent components,
Record replaces the corresponding message that performs of the preceding asynchronous call event as original execution message, and lets pass described different after replacement
Step event;
Otherwise, directly let pass the asynchronous call event.
Alternatively, the asynchronous call event of the application of attending to anything else of the specified Android application on virtual machine carries out generation
Reason treatment also includes:
When sent after Android system is excited the asynchronous call event it is corresponding perform message when, in the execution message
Target element is the Agent components after replacing, and the Agent components receive the execution message.
Alternatively, the method is further included:Statement in advance adapts to the reserved of different component types in Android system
Process;
The asynchronous call event of the application of attending to anything else of the specified Android application on virtual machine carries out agency's treatment
Also include:
When the Agent components receive the execution message that Android system sends, the execution message pair that lookup is recorded
The original execution message answered;
The obligating process of the component type belonging to one target element adapted in the original execution message of selection;
The original execution message is sent into selected obligating process so that the mesh in the original execution message
Mark component runs in selected obligating process.
Alternatively, the asynchronous call event monitored in Android system;There is asynchronous tune in Android system is listened to
When using event, the asynchronous call event is intercepted, judge the corresponding target element performed in message of the asynchronous call event
Whether it is that the component of application of attending to anything else of specified Android application in virtual machine includes:
The event of the method for obtaining IntentSender objects is called in monitoring Android system;
When the event for calling the method for obtaining IntentSender objects is listened to, intercept corresponding
IntentSender objects, extract Intent message from the IntentSender objects, judge that the Intent message is signified
The target element for showing whether be specified Android application in virtual machine application of attending to anything else component.
Alternatively, the asynchronous call event in the application of attending to anything else of the specified Android application on virtual machine is carried out
Before agency's treatment, the method is further included:Obtain the correlation attended to anything else using registered component of each specified Android application
Information is simultaneously preserved into distribution management table;
Judge whether the target element indicated by the Intent message is that attending to anything else for specified Android application in virtual machine should
Component includes:Judge whether the relevant information of the target element in the Intent message is matched with the distribution management table
The relevant information of the component of record;It is then, to determine that the target element indicated by the Intent message is the specified peace in virtual machine
The component of the application of attending to anything else of Zhuo Yingyong;Otherwise it is not.
Alternatively, described acquisition is applied the relevant information of registered component and is preserved extremely attending to anything else for each specified Android application
Distribution management table includes:
Obtain the installation kit copy of each specified Android application and preserve to assigned catalogue, as dividing for each specified Android application
The installation kit of body application;
Configuration file in the installation kit of the application of attending to anything else for parsing each specified Android application, obtains each specified Android application
Attend to anything else and apply the relevant information of the component registered in respective profiles and preserve into the distribution management table.
Alternatively, the target element in the corresponding execution message by the asynchronous call event replaces with the agency
Component, record replaces the corresponding message that performs of the preceding asynchronous call event as original execution message, and is let pass after replacement
The asynchronous call event includes:
The target element indicated by Intent message in the IntentSender objects that will be intercepted replaces with institute
State Agent components, and the Intent message that will be extracted from the IntentSender objects as original I ntent message simultaneously
Record;
The IntentSender objects let pass after replacing so that the IntentSender objects are passed to accordingly
Treatment side, corresponding treatment side excites Android system to send the Intent message after being replaced accordingly in Preset Time.
Alternatively, it is described when sent after Android system is excited the asynchronous call event it is corresponding perform message when, should
It is the Agent components after replacing to perform the target element in message, and the Agent components receive the execution message to be included:
The Intent message after being correspondingly replaced is sent after Android system is excited, indicated by the Intent message
Target element is the Agent components, and the Agent components receive the Intent message.
Alternatively, it is described when the execution message that Android system sends is received when the Agent components, what lookup was recorded
The corresponding original execution message of the execution message includes:
When the Agent components receive the Intent message, the corresponding original of Intent message that lookup is recorded
Beginning Intent message;
It is described to send into selected obligating process the original execution message so that in the original execution message
Target element run in selected obligating process and include:The original I ntent message is sent to selected and is reserved
Process, the target element according to indicated by the original I ntent message loads the target element in the obligating process, right
The target element is instantiated so that action executing behaviour of the target element according to indicated by the original I ntent message
Make.
Alternatively, the asynchronous call event of the application of attending to anything else of the specified Android application on virtual machine carries out generation
Reason treatment includes:
By the resident service in virtual machine to the asynchronous tune of the application of attending to anything else of the specified Android application on virtual machine
Agency's treatment is carried out with event.
According to another aspect of the present invention, there is provided a kind of processing unit of the asynchronous call mechanism of Android application, its
In, including:
Environment construction unit, is suitable to virtual machine constructor environment, by one or more the specified Android applications in Android system
Attend to anything else using being put into virtual machine so that each specified Android application is attended to anything else using can be with corresponding specified Android application
Parallel running;
Resident service unit, is suitable to the asynchronous call event of the application of attending to anything else to the specified Android application on virtual machine
Carry out agency's treatment so that the application of attending to anything else of the specified Android application in virtual machine is able to carry out the asynchronous call event correspondence
Operation.
Alternatively, the device is further included:Information configuration unit, is suitable in Android system statement in advance and acts on behalf of group
Part;
The resident service unit, is adapted for listening for the asynchronous call event in Android system;In Android system is listened to
During generation asynchronous call event, the asynchronous call event is intercepted, in judging the corresponding execution message of the asynchronous call event
Target element whether be specified Android application in virtual machine application of attending to anything else component;It is then, by the asynchronous call thing
The corresponding target element performed in message of part replaces with the Agent components, record asynchronous call event correspondence before replacing
Execution message as original execution message, and the asynchronous call event of being let pass after replacement;Otherwise, directly let pass described different
Step event.
Alternatively, the resident service unit, is further adapted for sending the asynchronous call event after Android system is excited
During corresponding execution message, the target element in the execution message is the Agent components after replacing, and the Agent components connect
Receive the execution message.
Alternatively, information configuration unit, is further adapted in Android system statement in advance and adapts to the pre- of different component types
Stay process;
The resident service unit, is further adapted for when the Agent components receive the execution message that Android system sends,
The corresponding original execution message of the execution message that lookup is recorded;One mesh adapted in the original execution message of selection
The obligating process of the component type belonging to mark component;The original execution message is sent into selected obligating process, is made
The target element obtained in the original execution message runs in selected obligating process.
Alternatively, the resident service unit, is adapted for listening for being called for obtaining IntentSender pairs in Android system
The event of the method for elephant;When the event for calling the method for obtaining IntentSender objects is listened to, intercept corresponding
IntentSender objects, extract Intent message from the IntentSender objects, judge that the Intent message is signified
The target element for showing whether be specified Android application in virtual machine application of attending to anything else component.
Alternatively, the resident service unit, be further adapted for the specified Android application on virtual machine point
Before the asynchronous call event of body application carries out agency's treatment, attending to anything else using registered component for each specified Android application is obtained
Relevant information and preserve in distribution management table;
The resident service unit, is suitable to judge whether the relevant information of the target element in the Intent message is matched with
The relevant information of the component recorded in the distribution management table;It is then, to determine that the target element indicated by the Intent message is
The component of the application of attending to anything else of the specified Android application in virtual machine;Otherwise it is not.
Alternatively, the resident service unit, is suitable to obtain the installation kit copy of each specified Android application and preserves extremely refer to
Catalogue is determined, as the installation kit of the application of attending to anything else of each specified Android application;Parse the peace of the application of attending to anything else of each specified Android application
Configuration file in dress bag, obtains and applies the phase of the component registered in respective profiles each attending to anything else for specified Android application
Pass information is simultaneously preserved into the distribution management table.
Alternatively, the resident service unit, is suitable to the Intent in the IntentSender objects that will be intercepted
Target element indicated by message replaces with the Agent components, and will be extracted from the IntentSender objects
Intent message is as original I ntent message and records;The IntentSender objects let pass after replacing so that described
IntentSender objects are passed to corresponding treatment side, and corresponding treatment side excites Android system to send phase in Preset Time
Answer be replaced after Intent message.
Alternatively, the Intent message after being correspondingly replaced is sent after Android system is excited, the Intent message
Indicated target element is the Agent components, and the Agent components receive the Intent message.
Alternatively, the resident service unit, is suitable to, when the Agent components receive the Intent message, search
The corresponding original I ntent message of the Intent message for being recorded;The original I ntent message is sent to selected pre-
Process is stayed, the target element according to indicated by the original I ntent message loads the target element in the obligating process,
The target element is instantiated so that action executing behaviour of the target element according to indicated by the original I ntent message
Make.
Alternatively, the resident service unit, is suitable to by the resident service in virtual machine on the finger in virtual machine
The asynchronous call event of the application of attending to anything else of the tall and erect application in Dingan County carries out agency's treatment.
Have it is above-mentioned understand, technology according to the present invention scheme, in order to realize multiple identical Android applications in Android system
Parallel running, constructs virtual machine environment in Android system, and the application of attending to anything else of specified Android application is put into the virtual machine
Middle operation, and attend to anything else using for Android system being unknown and then attend to anything else using in cannot respond to Android system to overcome
The problem of asynchronous call event, asynchronous call event of this programme to the application of attending to anything else of the specified Android application on virtual machine
Carry out agency's treatment so that the application of attending to anything else of the specified Android application in virtual machine is able to carry out the asynchronous call event correspondence
Operation, can ideally realize the parallel running of the tall and erect its corresponding application of attending to anything else of application in Android system middle finger Dingan County, or even
Realization for asynchronous call mechanism is also very smooth.
Described above is only the general introduction of technical solution of the present invention, in order to better understand technological means of the invention,
And can be practiced according to the content of specification, and in order to allow the above and other objects of the present invention, feature and advantage can
Become apparent, below especially exemplified by specific embodiment of the invention.
Specific embodiment
The exemplary embodiment of the disclosure is more fully described below with reference to accompanying drawings.Although showing the disclosure in accompanying drawing
Exemplary embodiment, it being understood, however, that may be realized in various forms the disclosure without should be by embodiments set forth here
Limited.Conversely, there is provided these embodiments are able to be best understood from the disclosure, and can be by the scope of the present disclosure
Complete conveys to those skilled in the art.
Fig. 1 shows a kind of processing method of the asynchronous call mechanism of Android application according to an embodiment of the invention
Flow chart.As shown in figure 1, the method includes:
Step S110, virtual machine constructor environment should by attending to anything else for one or more the specified Android applications in Android system
With being put into virtual machine so that each specified Android application is attended to anything else using can parallel be transported with corresponding specified Android application
OK.
Wherein, specify Android application to refer to what can normally be run in Android system, browsed similar to QQ chats, UC
The application software of device etc..And the attending to anything else using the replisome as specified Android application of Android application is specified, can regard as and refer to
What Dingan County's Zhuo was applied attends to anything else.In the prior art, apply and with corresponding Android can be specified to answer attending to anything else for each specified Android application
With cannot parallel running, its reason is the identical registration that Android system cannot approve that two identical applications are stated
Information, therefore, in the case of specified Android application is mounted, the application of attending to anything else for specifying Android application is to be successfully registered to
In Android system, for Android system, it is unknown to specify the application of attending to anything else of Android application, and Android system cannot be with it
Normally interacted.
Step S120, the asynchronous call event to the application of attending to anything else of the specified Android application on virtual machine is acted on behalf of
Treatment so that the application of attending to anything else of the specified Android application in virtual machine is able to carry out the corresponding operation of the asynchronous call event.
The asynchronous call event refer to asynchronous call event time of origin with call the implementation time and it is asynchronous or
There is close relation, after the generation of asynchronous call event, can determine to specify the asynchronous call time pair in following any time
The execution of the operation answered.
It can be seen that, method shown in Fig. 1 in order to realize the parallel running of multiple identical Android applications in Android system, in Android
Virtual machine environment is constructed in system, by specified Android application attend to anything else using put into the virtual machine run, and in order to gram
Taking application of attending to anything else is unknown for Android system and then attends to anything else using the asynchronous call event that cannot respond in Android system
Problem, this programme carries out agency's treatment to the asynchronous call event of the application of attending to anything else of the specified Android application on virtual machine,
So that the application of attending to anything else of the specified Android application in virtual machine is able to carry out the corresponding operation of the asynchronous call event, can be with complete
The parallel running of the tall and erect its corresponding application of attending to anything else of application in Android system middle finger Dingan County is beauteously realized, even for asynchronous call machine
The realization of system is also very smooth.
In one embodiment of the invention, it is unknown due to attending to anything else using for Android system, when on dividing
When the asynchronous call event of body application occurs, the purpose of the corresponding real script of the event is intended to asynchronously call attend to anything else and answers
A component in simultaneously performs certain operation, because the execution message of the corresponding operation of asynchronous call event is by Android system
Sent at specific time point, and registered in Android system because the component of application of attending to anything else does not have, when so that attend to anything else should
When component in is the target element of the execution message, Android system is not aware that whom this execution message issued, and leads
The failure of asynchronous call event is caused.Therefore, this programme needs to carry out certain place to it when the asynchronous call event occurs
Reason so that the component that the target element of the asynchronous call event is temporarily recognized with Android system replaces so that Android system
Execution message can be successfully sent, when being sent in the component for being replaced when performing message, this is used to carry out generation
The component for replacing can be forwarded the execution message, be forwarded to real target element, and such target element round can
Receive the execution message of the corresponding operation of asynchronous call event and then perform corresponding operation so that asynchronous call event into
Work(.
Method i.e. shown in Fig. 1 is further included:State Agent components in advance in Android system;It is above-mentioned on virtual
The asynchronous call event of the application of attending to anything else of the specified Android application in machine carries out agency's treatment to be included:It is different in monitoring Android system
Step event;When there is asynchronous call event in listening to Android system, the asynchronous call event is intercepted, judging described
The corresponding target element performed in message of asynchronous call event whether be specified Android application in virtual machine application of attending to anything else
Component;It is then, the target element in the corresponding execution message of the asynchronous call event to be replaced with into the Agent components, remembers
Record replaces the corresponding message that performs of the preceding asynchronous call event as original execution message, and lets pass described asynchronous after replacement
Call event;Otherwise, directly let pass the asynchronous call event.
Further, the asynchronous call event of the application of attending to anything else of the specified Android application on virtual machine is carried out
Agency's treatment also includes:When sent after Android system is excited the asynchronous call event it is corresponding perform message when, the execution
Target element in message is the Agent components after replacing, and the Agent components receive the execution message.
And further, statement adapts to the obligating process of different component types in advance in Android system;It is described right
The asynchronous call event of the application of attending to anything else of the specified Android application on virtual machine carries out agency's treatment also to be included:When the generation
When reason component receives the execution message that Android system sends, the corresponding original execution of execution message that lookup is recorded disappears
Breath;The obligating process of the component type belonging to one target element adapted in the original execution message of selection;Will be described
Original execution message is sent into selected obligating process so that the target element in the original execution message is selected
Obligating process in run.Wherein, Android system includes polytype component, and different types of component is due to performing difference
The operation of type of functionality, in this step, the obligating process stated matches with component type, i.e., come for an obligating process
Say, all components for meeting the component type that the obligating process is adapted to can run in the obligating process.
This programme is that the component of different component types states obligating process in advance respectively, needs to run certain attending to anything else to apply
For it provides corresponding obligating process during kind of component, this kind of mode different from it is common in the art be the statement of specific component
The mode of specific process, the way to manage of obligating process is more flexible and convenient, for what is do not registered in Android system
It is also very reliable effective for the operation of system of attending to anything else.
In Android, we are frequently used PendingIntent to express a kind of meaning of " remaining day post processing ".
From for this angle, PendingIntent is construed as a kind of special Asynchronous Invocation.But, it is single just to name
For, PendingIntent have in fact it is certain misleading because it is neither inherited in Intent, also not comprising Intent, it
Core can roughly be aggregated into four words --- " asynchronous excitation ".
It is obvious that this asynchronous excitation is often to want what striding course was performed.Such as A processes are used as originating end, it can be with
From PendingIntent of system " acquisition ", then A processes can be by PendingIntent objects by binder mechanism
" transmission " gives B processes, then by B processes in following certain proper moment, the send () of " readjustment " PendingIntent objects is moved
Make, complete to excite.
In android system, the component for being best suitable for doing centrality management is exactly AMS (Activity Manager
Service), so it bears the responsibility for managing all PendingIntent duty-boundly.Briefly, initiation is worked as
When end obtains PendingIntent, needed while providing some intent.These intent and
PendingIntent is supporting relation, and rather than the relation of polymerization, they can be buffered in AMS.In the future, once locating
" exciting " semanteme of PendingIntent is delivered to AMS by reason end, and AMS will attempt finding and this PendingIntent pairs
The some intent for answering, and deliver away.New PendingIntent (target) create PendingIntent objects, its
Importance is self-evident.However, the internal core of this object is in fact by that getIntentSender () function above
Get.And this IIntentSender core is only the thing that we really need to be concerned about.Reveal, herein
IIntentSender couples as if binder agency, during its corresponding binder entity is AMS
PendingIntentRecord objects.When PendingIntent object formations, IIntentSender agencies pass as parameter
Come in, and record in the mTarget domains of PendingIntent.In the future, when PendingIntent performs asynchronous excitation, in it
Transmit semantic to AMS by this mTarget domain in portion.
We said that PendingIntent can usually be delivered to another process and go via binder mechanism above.And
Binder mechanism can ensure that the mTarget domains of the PendingIntent that target process is obtained are also legal
IIntentSender is acted on behalf of, and be correspond to the IIntentSender of originating end agencies same
PendingIntentRecord entities.
Based on this, in one embodiment of the invention, it is described monitor Android system in asynchronous call event;Work as monitoring
When there is asynchronous call event in Android system, the asynchronous call event is intercepted, judge the asynchronous call event correspondence
Execution message in target element whether be that the component of application of attending to anything else of specified Android application in virtual machine includes:Monitor peace
The event of the method for obtaining IntentSender objects is called in tall and erect system;Called for obtaining when listening to
During the event of the method for IntentSender objects, corresponding IntentSender objects are intercepted, from the IntentSender
Intent message is extracted in object, judges whether the target element indicated by the Intent message is specified Android in virtual machine
The component of the application of attending to anything else of application.
Wherein, the asynchronous call event in the application of attending to anything else of the specified Android application on virtual machine carries out generation
Before reason treatment, the method is further included:Obtain the related letter attended to anything else using registered component of each specified Android application
Cease and preserve into distribution management table;Judge whether the target element indicated by the Intent message is specified peace in virtual machine
The component of the application of attending to anything else of Zhuo Yingyong includes:Judge whether the relevant information of the target element in the Intent message is matched with institute
State the relevant information of the component recorded in distribution management table;It is then, to determine that the target element indicated by the Intent message is empty
The component of the application of attending to anything else of the specified Android application in plan machine;Otherwise it is not.
The logon mode of application of attending to anything else can be static registration mode, and log-on message writes dead in Manifest files, i.e.,
Described acquisition is wrapped attending to anything else for each specified Android application using in the relevant information and preservation to distribution management table of registered component
Include:Obtain the installation kit copy of each specified Android application and preserve to assigned catalogue, should as attending to anything else for each specified Android application
Installation kit;Configuration file in the installation kit of the application of attending to anything else for parsing each specified Android application, obtaining each specified Android should
Attend to anything else and apply the relevant information of the component registered in respective profiles and preserve into the distribution management table.
In one embodiment of the invention, it is described by the corresponding target group performed in message of the asynchronous call event
Part replaces with the Agent components, and record is replaced the corresponding message that performs of the preceding asynchronous call event and disappeared as original execution
Cease, and the asynchronous call event of being let pass after replacement includes:In the IntentSender objects that will be intercepted
Target element indicated by Intent message replaces with the Agent components, and will be extracted from the IntentSender objects
The Intent message for going out is as original I ntent message and records;The IntentSender objects let pass after replacing so that
The IntentSender objects are passed to corresponding treatment side, and corresponding treatment side excites Android system to send out in Preset Time
The Intent message gone out after corresponding being replaced.
And, it is described when sent after Android system is excited the asynchronous call event it is corresponding perform message when, this is held
Target element in row message is the Agent components after replacing, and the Agent components receive the execution message to be included:Work as peace
Tall and erect system sends the Intent message after being correspondingly replaced after being excited, the target element indicated by the Intent message is institute
Agent components are stated, the Agent components receive the Intent message.
Specifically, it is described when the execution message that Android system sends is received when the Agent components, what lookup was recorded
The corresponding original execution message of the execution message includes:When the Agent components receive the Intent message, institute is searched
The corresponding original I ntent message of the Intent message of record;It is described to send to selected pre- the original execution message
In staying process so that the target element in the original execution message runs in selected obligating process and includes:Will be described
Original I ntent message is sent to selected obligating process, and the target element according to indicated by the original I ntent message exists
The target element is loaded in the obligating process, the target element is instantiated so that the target element is according to the original
Action executing operation indicated by beginning Intent message.
In one embodiment of the invention, the application of attending to anything else of the specified Android application on virtual machine is different
Step carries out agency's treatment with event to be included:By the resident service in virtual machine to the specified Android application on virtual machine
The asynchronous call event of application of attending to anything else carry out agency's treatment.
Fig. 2 shows the framework of the processing unit of the asynchronous call mechanism of Android application according to an embodiment of the invention
Figure.As shown in Fig. 2 dotted line frame illustrates the processing unit of the asynchronous call mechanism of Android application, in the device and Android system
AMS service interaction constitute whole structure system, the device have registered multiple components to Android system:Component 1, component 2,
Component 3 ..., the device has run in virtual machine attends to anything else using a and attends to anything else and apply b, attend to anything else using have in a some components and
Process, does not register to Android system, attends to anything else using having some components and process in b, is not also registered to Android system.It is asynchronous
Calling event includes:Attend to anything else transmitted after obtaining IntentSender from system AMS using the process a1 in a IntentSender to
Attend to anything else using the process b1 in b, in response to following certain event for occurring, when such as user clicks on and specifies control, process b1 is excited
System AMS, system AMS send to target element a1 and perform message.Wherein using component a1 as target element be process a1 from
System AMS obtains what is just pre-set during IntentSender, but does not recognize component a1 due to system so that the execution message
Transmission be failure.To solve this problem, intercepted when process a1 obtains IntentSender from system AMS and set
The target element put replaces with the component 1 understood systematicly from a1, and preserves the mapping relations of replacement.Sent after system is excited
When performing message, what is be activated is component 1, then it is a1 to find real target element from the mapping relations for preserving just now, then will
The corresponding message that performs is transmitted to component a1 so that component a1 is able to carry out the corresponding operation of asynchronous call event.
Fig. 3 shows a kind of processing unit of the asynchronous call mechanism of Android application according to an embodiment of the invention
Schematic diagram, as shown in figure 3, the processing unit 300 of the asynchronous call mechanism of the Android application includes:
Environment construction unit 310, is suitable to virtual machine constructor environment, should by one or more the specified Androids in Android system
Attend to anything else to apply and be put into virtual machine so that attending to anything else for each specified Android application is applied and with corresponding Android can be specified to answer
Use parallel running.
Resident service unit 320, is suitable to the asynchronous call of the application of attending to anything else to the specified Android application on virtual machine
Event carries out agency's treatment so that the application of attending to anything else of the specified Android application in virtual machine is able to carry out the asynchronous call event
Corresponding operation.
It can be seen that, device shown in Fig. 3 in order to realize the parallel running of multiple identical Android applications in Android system, in Android
Virtual machine environment is constructed in system, by specified Android application attend to anything else using put into the virtual machine run, and in order to gram
Taking application of attending to anything else is unknown for Android system and then attends to anything else using the asynchronous call event that cannot respond in Android system
Problem, this programme carries out agency's treatment to the asynchronous call event of the application of attending to anything else of the specified Android application on virtual machine,
So that the application of attending to anything else of the specified Android application in virtual machine is able to carry out the corresponding operation of the asynchronous call event, can be with complete
The parallel running of the tall and erect its corresponding application of attending to anything else of application in Android system middle finger Dingan County is beauteously realized, even for asynchronous call machine
The realization of system is also very smooth.
Fig. 4 shows a kind of processing unit of the asynchronous call mechanism of Android application in accordance with another embodiment of the present invention
Schematic diagram, as shown in figure 4, the processing unit 400 of the asynchronous call mechanism of the Android application includes:Environment construction unit 310,
Resident service unit 320 and information configuration unit 330;
It is above-mentioned that environment construction unit 310, the partial function of resident service unit 320 has been noted above.
Information configuration unit, is suitable in Android system state Agent components in advance;Resident service unit 320, is suitable to prison
Listen the asynchronous call event in Android system;When there is asynchronous call event in listening to Android system, intercept described asynchronous
Event is called, judges whether the corresponding target element performed in message of the asynchronous call event is specified peace in virtual machine
The component of the application of attending to anything else of Zhuo Yingyong;It is then, the corresponding target element performed in message of the asynchronous call event to be replaced
It is the Agent components, record replaces the corresponding message that performs of the preceding asynchronous call event as original execution message, and
Let pass after replacement the asynchronous call event;Otherwise, directly let pass the asynchronous call event.
In one embodiment of the invention, resident service unit 320, is further adapted for sending institute after Android system is excited
State asynchronous call event it is corresponding perform message when, the target element in the execution message be replace after the Agent components,
The Agent components receive the execution message.
In one embodiment of the invention, information configuration unit 330, are further adapted in Android system statement adaptation in advance
In the obligating process of different component types;The resident service unit 320, is further adapted for receiving Android system when the Agent components
During the execution message that system sends, the corresponding original execution message of the execution message that lookup is recorded;Selection one adapts to institute
State the obligating process of the component type belonging to the target element in original execution message;The original execution message is sent to institute
In the obligating process of selection so that the target element in the original execution message runs in selected obligating process.
Specifically, the resident service unit 320, is adapted for listening for being called for obtaining IntentSender in Android system
The event of the method for object;When the event for calling the method for obtaining IntentSender objects is listened to, intercept corresponding
IntentSender objects, from the IntentSender objects extract Intent message, judge the Intent message institute
The target element of instruction whether be specified Android application in virtual machine application of attending to anything else component.
In one embodiment of the invention, resident service unit 320, is further adapted for described on the finger in virtual machine
Before the asynchronous call event of the application of attending to anything else of the tall and erect application in Dingan County carries out agency's treatment, obtaining attending to anything else for each specified Android application should
With in the relevant information and preservation to distribution management table of the component registered;The resident service unit 320, is suitable to judge to be somebody's turn to do
Whether the relevant information of the target element in Intent message is matched with the related letter of the component recorded in the distribution management table
Breath;It is then, to determine that the target element indicated by the Intent message is the application of attending to anything else of the specified Android application in virtual machine
Component;Otherwise it is not.
In one embodiment of the invention, the resident service unit 320, is suitable to obtain the peace of each specified Android application
Dress cladding part is simultaneously preserved to assigned catalogue, used as the installation kit of the application of attending to anything else of each specified Android application;Parse each specified Android
Configuration file in the installation kit of the application of attending to anything else of application, obtains and applies in respective profiles each specified attending to anything else for Android application
The relevant information of middle registered component is simultaneously preserved into the distribution management table.
In one embodiment of the invention, the resident service unit 320, be suitable to be intercepted described in
The target element indicated by Intent message in IntentSender objects replaces with the Agent components, and will be from described
The Intent message extracted in IntentSender objects is as original I ntent message and records;Let pass described after replacing
IntentSender objects so that the IntentSender objects are passed to corresponding treatment side, corresponding treatment side exists
Preset Time excites Android system to send the Intent message after being replaced accordingly.
Wherein, the Intent message after being correspondingly replaced is sent after Android system is excited, the Intent message institute
The target element of instruction is the Agent components, and the Agent components receive the Intent message.Wherein, the resident service list
Unit 320, is suitable to when the Agent components receive the Intent message, and the Intent message that lookup is recorded is corresponding
Original I ntent message;The original I ntent message is sent to selected obligating process, according to the original I ntent
Target element indicated by message loads the target element in the obligating process, and the target element is instantiated, and makes
Obtain action executing operation of the target element according to indicated by the original I ntent message.
In one embodiment of the invention, the resident service unit 320, is suitable to by the resident service in virtual machine
Asynchronous call event to the application of attending to anything else of the specified Android application on virtual machine carries out agency's treatment.
It should be noted that each embodiment of Fig. 3-Fig. 4 shown devices is corresponding with each embodiment of method shown in Fig. 1-Fig. 2
It is identical, it has been described in detail above, will not be repeated here.
In sum, in the inventive solutions, in order to realize multiple identical Android applications in Android system and
Capable operation, constructs virtual machine environment in Android system, and the application of attending to anything else of specified Android application is put into the virtual machine
Operation, and attend to anything else using for Android system being unknown and then attend to anything else different in Android system using cannot respond to overcome
The problem of step event, this programme enters to the asynchronous call event of the application of attending to anything else of the specified Android application on virtual machine
Row agency is processed so that it is corresponding that the application of attending to anything else of the specified Android application in virtual machine is able to carry out the asynchronous call event
Operation, can ideally realize the parallel running of the tall and erect its corresponding application of attending to anything else of application in Android system middle finger Dingan County, or even right
It is also very smooth in the realization of asynchronous call mechanism.
It should be noted that:
Algorithm and display be not inherently related to any certain computer, virtual bench or miscellaneous equipment provided herein.
Various fexible units can also be used together with based on teaching in this.As described above, construct required by this kind of device
Structure be obvious.Additionally, the present invention is not also directed to any certain programmed language.It is understood that, it is possible to use it is various
Programming language realizes the content of invention described herein, and the description done to language-specific above is to disclose this hair
Bright preferred forms.
In specification mentioned herein, numerous specific details are set forth.It is to be appreciated, however, that implementation of the invention
Example can be put into practice in the case of without these details.In some instances, known method, structure is not been shown in detail
And technology, so as not to obscure the understanding of this description.
Similarly, it will be appreciated that in order to simplify one or more that the disclosure and helping understands in each inventive aspect, exist
Above to the description of exemplary embodiment of the invention in, each feature of the invention is grouped together into single implementation sometimes
In example, figure or descriptions thereof.However, the method for the disclosure should be construed to reflect following intention:I.e. required guarantor
The application claims of shield features more more than the feature being expressly recited in each claim.More precisely, such as following
Claims reflect as, inventive aspect is all features less than single embodiment disclosed above.Therefore,
Thus the claims for following specific embodiment are expressly incorporated in the specific embodiment, and wherein each claim is in itself
All as separate embodiments of the invention.
Those skilled in the art are appreciated that can be carried out adaptively to the module in the equipment in embodiment
Change and they are arranged in one or more equipment different from the embodiment.Can be the module or list in embodiment
Unit or component be combined into a module or unit or component, and can be divided into addition multiple submodule or subelement or
Sub-component.In addition at least some in such feature and/or process or unit exclude each other, can use any
Combine to all features disclosed in this specification (including adjoint claim, summary and accompanying drawing) and so disclosed appoint
Where all processes or unit of method or equipment are combined.Unless expressly stated otherwise, this specification (including adjoint power
Profit is required, summary and accompanying drawing) disclosed in each feature can the alternative features of or similar purpose identical, equivalent by offer carry out generation
Replace.
Although additionally, it will be appreciated by those of skill in the art that some embodiments described herein include other embodiments
In included some features rather than further feature, but the combination of the feature of different embodiments means in of the invention
Within the scope of and form different embodiments.For example, in the following claims, embodiment required for protection is appointed
One of meaning mode can be used in any combination.
All parts embodiment of the invention can be realized with hardware, or be run with one or more processor
Software module realize, or with combinations thereof realize.It will be understood by those of skill in the art that can use in practice
Microprocessor or digital signal processor (DSP) realize the asynchronous call mechanism of Android application according to embodiments of the present invention
Processing unit in some or all parts some or all functions.The present invention is also implemented as performing this
In described method some or all equipment or program of device (for example, computer program and computer program
Product).It is such to realize that program of the invention be stored on a computer-readable medium, or can be with one or many
The form of individual signal.Such signal can be downloaded from internet website and obtained, or be provided on carrier signal, or with
Any other form is provided.
It should be noted that above-described embodiment the present invention will be described rather than limiting the invention, and ability
Field technique personnel can design alternative embodiment without departing from the scope of the appended claims.In the claims,
Any reference symbol being located between bracket should not be configured to limitations on claims.Word "comprising" is not excluded the presence of not
Element listed in the claims or step.Word "a" or "an" before element is not excluded the presence of as multiple
Element.The present invention can come real by means of the hardware for including some different elements and by means of properly programmed computer
It is existing.If in the unit claim for listing equipment for drying, several in these devices can be by same hardware branch
To embody.The use of word first, second, and third does not indicate that any order.These words can be explained and run after fame
Claim.
The invention discloses A1, a kind of processing method of the asynchronous call mechanism of Android application, wherein, including:
Virtual machine constructor environment, attending to anything else for one or more the specified Android applications in Android system is virtual using being put into
In machine so that attending to anything else for each specified Android application is applied and can specify Android application parallel running with corresponding;
Asynchronous call event to the application of attending to anything else of the specified Android application on virtual machine carries out agency's treatment so that
The application of attending to anything else of the specified Android application in virtual machine is able to carry out the corresponding operation of the asynchronous call event.
A2, the method as described in A1, wherein, the method is further included:State Agent components in advance in Android system;
The asynchronous call event of the application of attending to anything else of the specified Android application on virtual machine carries out agency's treatment
Including:
Monitor the asynchronous call event in Android system;
When there is asynchronous call event in listening to Android system, the asynchronous call event is intercepted, judging described different
The corresponding target element performed in message of step event whether be specified Android application in virtual machine application of attending to anything else
Component;
It is then, the target element in the corresponding execution message of the asynchronous call event to be replaced with into the Agent components,
Record replaces the corresponding message that performs of the preceding asynchronous call event as original execution message, and lets pass described different after replacement
Step event;
Otherwise, directly let pass the asynchronous call event.
A3, the method as described in A2, wherein, the application of attending to anything else of the specified Android application on virtual machine it is different
Step carries out agency's treatment with event also to be included:
When sent after Android system is excited the asynchronous call event it is corresponding perform message when, in the execution message
Target element is the Agent components after replacing, and the Agent components receive the execution message.
A4, the method as described in A3, wherein, the method is further included:Statement is adapted to not in advance in Android system
With the obligating process of component type;
The asynchronous call event of the application of attending to anything else of the specified Android application on virtual machine carries out agency's treatment
Also include:
When the Agent components receive the execution message that Android system sends, the execution message pair that lookup is recorded
The original execution message answered;
The obligating process of the component type belonging to one target element adapted in the original execution message of selection;
The original execution message is sent into selected obligating process so that the mesh in the original execution message
Mark component runs in selected obligating process.
A5, the method as any one of A2-A4, wherein, the asynchronous call event monitored in Android system;When
Listen to when there is asynchronous call event in Android system, intercept the asynchronous call event, judge the asynchronous call event
Whether target element in corresponding execution message is that the component of application of attending to anything else of specified Android application in virtual machine includes:
The event of the method for obtaining IntentSender objects is called in monitoring Android system;
When the event for calling the method for obtaining IntentSender objects is listened to, intercept corresponding
IntentSender objects, extract Intent message from the IntentSender objects, judge that the Intent message is signified
The target element for showing whether be specified Android application in virtual machine application of attending to anything else component.
A6, the method as described in A5, wherein, in the application of attending to anything else of the specified Android application on virtual machine
Before asynchronous call event carries out agency's treatment, the method is further included:Obtain and apply institute each attending to anything else for specified Android application
The relevant information of the component of registration is simultaneously preserved into distribution management table;
Judge whether the target element indicated by the Intent message is that attending to anything else for specified Android application in virtual machine should
Component includes:Judge whether the relevant information of the target element in the Intent message is matched with the distribution management table
The relevant information of the component of record;It is then, to determine that the target element indicated by the Intent message is the specified peace in virtual machine
The component of the application of attending to anything else of Zhuo Yingyong;Otherwise it is not.
A7, the method as described in A6, wherein, described acquisition applies registered component attending to anything else for each specified Android application
Relevant information and preserving to distribution management table includes:
Obtain the installation kit copy of each specified Android application and preserve to assigned catalogue, as dividing for each specified Android application
The installation kit of body application;
Configuration file in the installation kit of the application of attending to anything else for parsing each specified Android application, obtains each specified Android application
Attend to anything else and apply the relevant information of the component registered in respective profiles and preserve into the distribution management table.
A8, the method as described in A5, wherein, it is described by the corresponding target group performed in message of the asynchronous call event
Part replaces with the Agent components, and record is replaced the corresponding message that performs of the preceding asynchronous call event and disappeared as original execution
Cease, and the asynchronous call event of being let pass after replacement includes:
The target element indicated by Intent message in the IntentSender objects that will be intercepted replaces with institute
State Agent components, and the Intent message that will be extracted from the IntentSender objects as original I ntent message simultaneously
Record;
The IntentSender objects let pass after replacing so that the IntentSender objects are passed to accordingly
Treatment side, corresponding treatment side excites Android system to send the Intent message after being replaced accordingly in Preset Time.
A9, the method as described in A8, wherein, it is described that the asynchronous call event correspondence is sent after Android system is excited
Execution message when, the target element in the execution message is the Agent components after replacing, and the Agent components are received should
Performing message includes:
The Intent message after being correspondingly replaced is sent after Android system is excited, indicated by the Intent message
Target element is the Agent components, and the Agent components receive the Intent message.
A10, the method as described in A9, wherein, it is described to disappear when the Agent components receive the execution that Android system sends
During breath, the corresponding original execution message of the execution message that lookup is recorded includes:
When the Agent components receive the Intent message, the corresponding original of Intent message that lookup is recorded
Beginning Intent message;
It is described to send into selected obligating process the original execution message so that in the original execution message
Target element run in selected obligating process and include:The original I ntent message is sent to selected and is reserved
Process, the target element according to indicated by the original I ntent message loads the target element in the obligating process, right
The target element is instantiated so that action executing behaviour of the target element according to indicated by the original I ntent message
Make.
A11, the method as any one of A1-A10, wherein, the specified Android application on virtual machine
Application of attending to anything else asynchronous call event carry out agency treatment include:
By the resident service in virtual machine to the asynchronous tune of the application of attending to anything else of the specified Android application on virtual machine
Agency's treatment is carried out with event.
The invention also discloses B12, a kind of processing unit of the asynchronous call mechanism of Android application, wherein, including:
Environment construction unit, is suitable to virtual machine constructor environment, by one or more the specified Android applications in Android system
Attend to anything else using being put into virtual machine so that each specified Android application is attended to anything else using can be with corresponding specified Android application
Parallel running;
Resident service unit, is suitable to the asynchronous call event of the application of attending to anything else to the specified Android application on virtual machine
Carry out agency's treatment so that the application of attending to anything else of the specified Android application in virtual machine is able to carry out the asynchronous call event correspondence
Operation.
B13, the device as described in B12, wherein, the device is further included:Information configuration unit, is suitable in Android system
In in advance statement Agent components;
The resident service unit, is adapted for listening for the asynchronous call event in Android system;In Android system is listened to
During generation asynchronous call event, the asynchronous call event is intercepted, in judging the corresponding execution message of the asynchronous call event
Target element whether be specified Android application in virtual machine application of attending to anything else component;It is then, by the asynchronous call thing
The corresponding target element performed in message of part replaces with the Agent components, record asynchronous call event correspondence before replacing
Execution message as original execution message, and the asynchronous call event of being let pass after replacement;Otherwise, directly let pass described different
Step event.
B14, the device as described in B13, wherein,
The resident service unit, is further adapted for being sent after Android system is excited that the asynchronous call event is corresponding to be held
During row message, the target element in the execution message is the Agent components after replacing, and the Agent components receive the execution
Message.
B15, the device as described in B14, wherein, information configuration unit is further adapted in Android system statement adaptation in advance
In the obligating process of different component types;
The resident service unit, is further adapted for when the Agent components receive the execution message that Android system sends,
The corresponding original execution message of the execution message that lookup is recorded;One mesh adapted in the original execution message of selection
The obligating process of the component type belonging to mark component;The original execution message is sent into selected obligating process, is made
The target element obtained in the original execution message runs in selected obligating process.
B16, the device as any one of B13-B15, wherein,
The resident service unit, is adapted for listening in Android system calling the method for obtaining IntentSender objects
Event;When the event for calling the method for obtaining IntentSender objects is listened to, intercept corresponding
IntentSender objects, extract Intent message from the IntentSender objects, judge that the Intent message is signified
The target element for showing whether be specified Android application in virtual machine application of attending to anything else component.
B17, the device as described in B16, wherein, the resident service unit is further adapted for described in virtual machine
Specified Android application application of attending to anything else asynchronous call event carry out agency's treatment before, obtain each specified Android application point
The relevant information of the component that body application is registered simultaneously is preserved into distribution management table;
The resident service unit, is suitable to judge whether the relevant information of the target element in the Intent message is matched with
The relevant information of the component recorded in the distribution management table;It is then, to determine that the target element indicated by the Intent message is
The component of the application of attending to anything else of the specified Android application in virtual machine;Otherwise it is not.
B18, the device as described in B17, wherein,
The resident service unit, is suitable to obtain the installation kit copy of each specified Android application and preserves to assigned catalogue,
As the installation kit of the application of attending to anything else of each specified Android application;In the installation kit of the application of attending to anything else for parsing each specified Android application
Configuration file, obtains and applies the relevant information of the component registered in respective profiles simultaneously attending to anything else for each specified Android application
Preserve into the distribution management table.
B19, the device as described in B16, wherein,
The resident service unit, the Intent message being suitable in the IntentSender objects that will be intercepted is signified
The target element for showing replaces with the Agent components, and the Intent message that will be extracted from the IntentSender objects
As original I ntent message and record;The IntentSender objects let pass after replacing so that described
IntentSender objects are passed to corresponding treatment side, and corresponding treatment side excites Android system to send phase in Preset Time
Answer be replaced after Intent message.
B20, the device as described in B19, wherein,
The Intent message after being correspondingly replaced is sent after Android system is excited, indicated by the Intent message
Target element is the Agent components, and the Agent components receive the Intent message.
B21, the device as described in B20, wherein,
The resident service unit, is suitable to when the Agent components receive the Intent message, and lookup is recorded
The corresponding original I ntent message of the Intent message;By the original I ntent message send to it is selected reserve into
Journey, the target element according to indicated by the original I ntent message loads the target element in the obligating process, to this
Target element is instantiated so that action executing operation of the target element according to indicated by the original I ntent message.
B22, the device as any one of B12-B21, wherein,
The resident service unit, being suitable to should to the specified Android on virtual machine by the resident service in virtual machine
With the asynchronous call event of application of attending to anything else carry out agency's treatment.