Embodiment
, in order to make purpose of the present invention, technical scheme and advantage clearer, below in conjunction with drawings and Examples, the present invention is further elaborated.Should be appreciated that specific embodiment described herein, only in order to explain the present invention, is not intended to limit the present invention.
In embodiments of the present invention, when the application program launching on the Android system, read preset configuration file, if this application program is configured in this preset configuration file, by ccf layer, camera being distributed to separately this application program uses, solve the problem that clashes when a plurality of application programs take camera simultaneously, for the user uses camera, provide mode of operation simply and easily.
Need to prove, in embodiments of the present invention, set forth based on the Android intelligent television control method that above-mentioned Android equipment camera uses, solve in Android equipment the problem that clashes when a plurality of application programs take camera simultaneously, described method also can run on other equipment that carried the Android system.
The realization flow of the control method that the Android equipment camera that Fig. 1 shows the embodiment of the present invention to be provided uses, details are as follows:
In step S101, when application program launching, read preset configuration file, configured in described preset configuration file that in described Android equipment, all need to use the information of the application program of described camera.
The system partitioning of Android system is used for placing preset application program, system file and user interface etc., and data partition is used for placing user's data, as associated person information and third party application etc.And the ccf layer of Android system has comprised the framework that need to use while writing kernel service, in the Android system starting process, can carry out and starts kernel service and read the preset operations such as configuration file when ccf layer starts.
In embodiments of the present invention, when application program launching, read preset configuration file from data partition.Before reading this preset configuration file, also need to carry out following steps: for the Android system, add configuration file as preset configuration file in system partitioning, this configuration file has configured that in preset application program, all need to use the information of the application program of camera.When the Android system starts, detect data partition by ccf layer and whether have required configuration file, if do not have, copy is a in data partition from system partitioning.
In embodiments of the present invention, read preset configuration file from data partition,, if there is the situation that reads failure, from system partitioning, read above-mentioned configuration file, simultaneously, copy is a in data partition again from system partitioning.Like this, when the factory reset of Android system, the above-mentioned preset configuration file in system partitioning can not disposed by the user, guarantees to read successfully.
The user is when using Android equipment, except preset application program, also need download and many third party applications be installed to meet its individual demand, for example in the Android intelligent television, the application program of Web TV etc. usually all is installed, but the user also can download and install other third party application, and as somatic sensation television game, the good experience and the whole family that bring with enjoyment TV giant-screen participate in the enjoyment of playing together.And also may need to use camera in these third party applications, therefore also should comprise the information of the third party application of user installation in above-mentioned preset configuration file.
For compatible third party application, installed while needing to use the application program of camera when described Android equipment being detected, the information of the described application program of installing is added in described preset configuration file; When described Android unit deletion having been detected and need to have used the application program of camera, the information of the described application program of deletion from described preset configuration file.
When third party application is disposed in the application shop, whether this third party application is needed to use camera to identify, and be recorded in the database of server, obtain this sign by the data interaction of this third party application and server, judge whether it needs to use camera.
In embodiments of the present invention, when third party application is installed, detect this sign,, if need to use camera, the information of this third party application is added in the preset configuration file of data partition; In unloading during third party application, the information of this third party application of deletion in above-mentioned preset configuration file from data partition.Can dynamically update so the above-mentioned preset configuration file in data partition.
When the Android system starts, read the above-mentioned configuration file that has configured preset application program and third party application information from data partition, if there is the situation that reads failure, from system partitioning, read the configuration file that only comprises preset application program, produce the problem of conflict in the time of so both can having solved preset application program and third party application and need to take camera simultaneously, also can guarantee when the factory reset of Android system, configuration file preset in system partitioning can not disposed by the user, still can successfully read.
In step S102, by ccf layer, judge whether the described application program that starts is configured in described preset configuration file.
In the Android system, need to carry out whether being met the condition of this application program launching by the configuration of ccf layer decision-making system alternately with ccf layer when application program launching.In embodiments of the present invention, if information in preset configuration file detected in step S101, the application program that ccf layer will start is mated with the information from the preset configuration file that data partition reads; , if the situation of failure occurred reading in step S101, this application program and the information from the preset configuration file that system partitioning reads are mated.If this application program is configured in above-mentioned preset configuration file, represent that it will use camera, otherwise, representing that it can not use camera, ccf layer notifies this application program to continue to carry out its original startup flow process.
In step S103,, if the described application program that starts is configured in described preset configuration file, by the described application program that described ccf layer is distributed to separately startup with described camera, use.
After judging that by ccf layer the application program that needs startup is configured in above-mentioned preset configuration file, as one embodiment of the present of invention, as shown in Figure 2, step S103 is specially:
In S201, detect described camera by described ccf layer and whether by other application programs, taken.
In S202,, if described camera is taken by other application programs, by described ccf layer, close the current application program that takies described camera.
In embodiments of the present invention, if camera is occupied, inquiry is taking the progress information of camera, progress information comprises the identification (Identity of process, ID) number etc., according to the process ID number that takies camera, ccf layer is closed corresponding application program, the camera resource of release busy., if camera is unoccupied, perform step S203.
In S203, by the described application program that described ccf layer is distributed to separately startup with described camera, use.
In embodiments of the present invention, ccf layer uses the application program that described camera is distributed to separately startup, notifies this application program to carry out its original startup flow process.
In embodiments of the present invention, when the application program launching on the Android system, read preset configuration file, if this application program is configured in this preset configuration file, by ccf layer, camera being distributed to separately this application program uses, solve the problem that clashes when a plurality of application programs take camera simultaneously, for the user uses camera, provide mode of operation simply and easily.
The structured flowchart of the control device that the Android equipment camera that Fig. 3 shows the embodiment of the present invention to be provided uses, this device can be arranged in the terminal devices such as smart mobile phone, intelligent television, panel computer, is used for carrying out the control method of Fig. 1 of the present invention and the described a kind of terminal camera use of Fig. 2 embodiment.For convenience of explanation, only show the part relevant to the present embodiment.As shown in Figure 3, this device comprises:
Reading unit 31, when application program launching, read preset configuration file, configured in described preset configuration file that in described Android equipment, all need to use the information of the application program of described camera.
Judgingunit 32, judge by ccf layer whether the described application program that starts is configured in described preset configuration file.
Allocation units 33,, if the described application program that starts is configured in described preset configuration file, use by the described application program that described ccf layer is distributed to separately startup with described camera.
Alternatively, described device also comprises:
Adding device, add described preset configuration file in the system partitioning of described Android system.
Copy cell, when described Android system starts, copy the described preset configuration file in described system partitioning in the data partition of described Android system to.
Described reading unit specifically is used for reading described preset configuration file from described data partition
Alternatively, described device also comprises:
The application information adding device, installed while needing to use the application program of camera when described Android equipment being detected, and the information of the described application program of installing is added in described preset configuration file.
The application information delete cells, unloaded while needing to use the application program of camera when described Android equipment being detected, the information of the described application program of deletion from described preset configuration file.
Alternatively,allocation units 33 comprise:
Whether detection sub-unit, detect described camera by described ccf layer and taken by other application programs.
Close subelement,, if described camera is taken by other application programs, by described ccf layer, close the current application program that takies described camera.
Distribute subelement, by the described application program that described ccf layer is distributed to separately startup with described camera, use.
In embodiments of the present invention, when the application program launching on the Android system, read preset configuration file, if this application program is configured in this preset configuration file, by ccf layer, camera being distributed to separately this application program uses, solve the problem that clashes when a plurality of application programs take camera simultaneously, for the user uses camera, provide mode of operation simply and easily.
The foregoing is only preferred embodiment of the present invention,, not in order to limit the present invention, all any modifications of doing within the spirit and principles in the present invention, be equal to and replace and improvement etc., within all should being included in protection scope of the present invention.