Disclosure of Invention
The technical problem to be solved by the present invention is to provide a source list display method, an Android television and a storage medium, aiming at solving the problem that in the prior art, the source code of Launcher cannot be modified, and a user cannot select a newly added source list, which is very inconvenient.
The technical scheme adopted by the invention for solving the technical problem is as follows:
a source list display method, comprising:
when the Android television is started, acquiring a source list of the starting, and detecting whether data corresponding to the source list exists in a database;
when the data corresponding to the information source list does not exist in the database, storing the data corresponding to the information source list into the database;
and after the data corresponding to the information source list is stored, sending an updating instruction to a Launcher interface, and displaying the data corresponding to the information source list on the Launcher interface.
Further, when the Android television is started, acquiring the information source list of the current starting, and detecting whether data corresponding to the information source list exists in the database specifically includes:
when receiving a starting broadcast or detecting that a television application is started, acquiring an information source list of the starting, and detecting whether Channel data corresponding to the information source list exists in a database.
Further, when the data corresponding to the source list does not exist in the database, the storing the data corresponding to the source list to the database specifically includes:
when Channel data corresponding to the information source list does not exist in the database, Channel data corresponding to the information source list are newly established, and the newly established Channel data are stored in the database;
converting each information source in the information source list into Program data corresponding to the newly-built Channel data, and storing the Program data into a database;
and when Channel data corresponding to the information source list exists in the database, directly converting each information source in the information source list into Program data corresponding to the Channel data.
Further, after the data corresponding to the information source list is stored, sending an update instruction to a Launcher interface, and displaying the data corresponding to the information source list on the Launcher interface specifically includes:
after the Program data are stored, sending an updating instruction to a Launcher interface;
and modifying the configuration of the customized application, and displaying the Channel data of the source list at a specified position of the Launcher interface.
Further, the source list display method further includes:
and monitoring the state of the information source in real time, and executing the step of detecting whether the data corresponding to the information source list exists in the database when the state of the information source is monitored to be changed.
The invention also provides an Android television, which comprises a processor and a memory connected with the processor, wherein the memory stores an information source list display program, and the information source list display program realizes the following steps when executed by the processor:
when the Android television is started, acquiring a source list of the starting, and detecting whether data corresponding to the source list exists in a database;
when the data corresponding to the information source list does not exist in the database, storing the data corresponding to the information source list into the database;
after the data corresponding to the information source list is stored, sending an updating instruction to a Launcher interface, and displaying the data corresponding to the information source list on the Launcher interface;
the processor is configured to invoke the source list display program instruction.
Further, when executed by the processor, the source list display program further implements the steps of:
when a starting broadcast is received or the starting of a television application is detected, acquiring an information source list of the starting, and detecting whether Channel data corresponding to the information source list exists in a database;
when Channel data corresponding to the information source list does not exist in the database, Channel data corresponding to the information source list are newly established, and the newly established Channel data are stored in the database;
converting each information source in the information source list into Program data corresponding to the newly-built Channel data, and storing the Program data into a database;
and when Channel data corresponding to the information source list exists in the database, directly converting each information source in the information source list into Program data corresponding to the Channel data.
Further, when executed by the processor, the source list display program further implements the steps of:
after the Program data are stored, sending an updating instruction to a Launcher interface;
and modifying the configuration of the customized application, and displaying the Channel data of the source list at a specified position of the Launcher interface.
Further, when executed by the processor, the source list display program further implements the steps of:
and monitoring the state of the information source in real time, and executing the step of detecting whether the data corresponding to the information source list exists in the database when the state of the information source is monitored to be changed.
The present invention also provides a storage medium storing a computer program executable for implementing the source list display method as described above.
The information source list display method, the Android television and the storage medium provided by the invention comprise the following steps: when the Android television is started, acquiring a source list of the starting, and detecting whether data corresponding to the source list exists in a database; when the data corresponding to the information source list does not exist in the database, storing the data corresponding to the information source list into the database; and after the data corresponding to the information source list is stored, sending an updating instruction to a Launcher interface, and displaying the data corresponding to the information source list on the Launcher interface. The invention realizes the purpose of adding the information source list to the Launcher interface without modifying the source code, is convenient for a user to check and switch the information source on the Launcher interface, can select the newly added information source list, and is very convenient.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention clearer and clearer, the present invention is further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
Referring to fig. 1, fig. 1 is a flowchart of a source list display method according to the present invention. As shown in fig. 1, the source list display method according to the embodiment of the present invention includes the following steps:
s100, when the Android television is started, obtaining an information source list of the starting, and detecting whether data corresponding to the information source list exists in a database.
The invention aims at an Android television (an intelligent television with an Android operating system), in particular to an intelligent television with an Android system of 8.0 or above. At present, Android televisions can support more and more information sources, and developers package an application program (television application, hereinafter referred to as TV application) for switching and managing the information sources for the convenience of users. The TV application mainly corresponds to live broadcast information sources such as digital televisions, analog televisions, television signals transmitted by traditional coaxial cables and the like, and information sources supporting access to external equipment such as high-definition multimedia interfaces, audio and video, free online Flash music players, video graphic arrays and the like. And other network applications correspond to custom sources. In addition, a tv database is stored in the TIF in the Android television, and the database stores data corresponding to a source list in the original Launcher interface. TIF, which is a label image file format, is a flexible bitmap format, and is mainly used for storing images including photos and art drawings.
In a preferred embodiment of the present invention, the step S100 specifically includes: when receiving a starting broadcast or detecting that a television application is started, acquiring an information source list of the starting, and detecting whether Channel data corresponding to the information source list exists in a database.
Specifically, when the Android television is started, a start broadcast is received in a TV application, or it is detected that the TV application is started, that is, the Android television may receive the start broadcast in the TV application first, or may detect that the TV application is started first, and when one of the two situations occurs, the information source list of the start is obtained. After the information source list of the startup is obtained, whether the information source list of the startup is a new information source list is judged. Specifically, whether Channel data corresponding to the starting information source list exists in an original database or not is detected. The Channel data refers to a Channel list which can be displayed on a Launcher interface, and includes the name of an application, an icon of the application, a display name corresponding to the application, and the like. When a new piece of Channel data is created, the Launcher interface will be filled with the icon and name of the TV application and display the name Sources, which is a field in the data.
S200, when the data corresponding to the information source list does not exist in the database, storing the data corresponding to the information source list into the database.
The step S200 specifically includes:
s210, when Channel data corresponding to the information source list does not exist in the database, newly establishing Channel data corresponding to the information source list, and storing the newly established Channel data to the database;
s220, converting each information source in the information source list into Program data corresponding to the newly-built Channel data, and storing the Program data into a database.
Specifically, when Channel data corresponding to the information source list does not exist in the original database, the information source list obtained by starting up at this time is proved to be a new information source list, Channel data of the information source list is newly established, and the Channel data is inserted into the database by using a newly added Channel API of Android 8.0. Converting each source in the source list into Program data of the Channel, wherein important parameters for converting the source into the Program comprise: the source name, the source id, the source icon, the Activity started by the source switching and the inputId parameter required to be transmitted form intent. After conversion, Program data is populated into the tv database of the TIF. The Program data is data stored in Channel data, and includes source list code, source icon, Intent (for skip interface), and the like. The translated Program data specifies which Channel data it belongs to, and binds to the Channel data, such as HDMI1, HDMI2, HDMI3, AV, icon containing display, textual description of display, and Intent when clicking invisible. The invention creates a Channel data storage of Sources in the TV application, and creates Program data of information Sources supported by TV such as HDMI1, HDMI2. The user can check Channel data on a Launcher interface, directly check information source lists supported by televisions such as HDMI1.
When Channel data corresponding to the information source list exists in an original database, each information source in the information source list is directly converted into Program data of the Channel, and the Program data are filled into a tv database of the TIF.
S300, after the data corresponding to the information source list is stored, sending an updating instruction to a Launcher interface, and displaying the data corresponding to the information source list on the Launcher interface.
The step S300 specifically includes:
s310, after the Program data are stored, sending an updating instruction to a Launcher interface;
s320, modifying the configuration of the customized application, and displaying the Channel data of the information source list at the specified position of the Launcher interface.
And after the Program data is stored, if the corresponding database has data, comparing the data, and if the data is inconsistent, updating the data of the database.
And after data is updated or data is filled, sending an updating instruction to a Launcher interface, modifying the configuration of the Google customized application, and designating the Channel of the source list acquired this time to be displayed in a row fixed by the Google Launcher. And reading Channel data and Program data of the source list by the Launcher, and displaying the Channel data and the Program data at a specified position of a Launcher interface, wherein the convenience of using the television by a user is greatly improved by adding the source list on the Launcher interface.
According to the method, under the condition that a Google Launcher source code is not modified, the purpose of adding the source list to the Launcher interface is achieved by ingeniously utilizing a newly added Channel interface and mechanism of Andriod 8.0, the source list is positioned to a specified row through Google customized application, and a user can conveniently check and switch the source on the Launcher interface.
In a preferred embodiment of the present invention, the step S200 further includes: and monitoring the state of the information source in real time, and executing the step of detecting whether the data corresponding to the information source list exists in the database when the state of the information source is monitored to be changed.
Specifically, when the Android television is started, the information source list of the starting is obtained, which is the situation of passively obtaining the information source list. However, in the present invention, there is another situation, namely, in the case of actively acquiring the source list, when the user actively downloads some application programs, the Android television also acquires the source list. Therefore, the Android television monitors whether the information source state changes in real time, and registers information source list state monitoring at first, and the method comprises the following steps: information source addition, information source deletion and information source attribute change. And if the information source state changes, acquiring the appeared information source list, detecting whether the data corresponding to the information source list exists in the database, and continuing the steps of S200 and S300.
As shown in fig. 2, an embodiment of the present invention further provides an Android television. The Android television comprises aprocessor 10 and amemory 20 connected with theprocessor 10, wherein thememory 20 stores a source list display program, and the source list display program realizes the following steps when executed by the processor 10:
when the Android television is started, acquiring a source list of the starting, and detecting whether data corresponding to the source list exists in a database;
when the data corresponding to the information source list does not exist in the database, storing the data corresponding to the information source list into the database;
after the data corresponding to the information source list is stored, sending an updating instruction to a Launcher interface, and displaying the data corresponding to the information source list on the Launcher interface;
theprocessor 10 is configured to invoke the information source list display program instruction; as described above.
Further, when executed by theprocessor 10, the source list display program further implements the steps of:
when a starting broadcast is received or the starting of a television application is detected, acquiring an information source list of the starting, and detecting whether Channel data corresponding to the information source list exists in a database;
when Channel data corresponding to the information source list does not exist in the database, Channel data corresponding to the information source list are newly established, and the newly established Channel data are stored in the database;
converting each information source in the information source list into Program data corresponding to the newly-built Channel data, and storing the Program data into a database;
when Channel data corresponding to the information source list exists in the database, each information source in the information source list is directly converted into Program data corresponding to the Channel data; as described above.
Further, when executed by theprocessor 10, the source list display program further implements the steps of:
after the Program data are stored, sending an updating instruction to a Launcher interface;
modifying the configuration of the customized application, and displaying Channel data of the information source list at a specified position of a Launcher interface; as described above.
Further, when executed by theprocessor 10, the source list display program further implements the steps of:
monitoring the state of an information source in real time, and executing the step of detecting whether data corresponding to the information source list exists in the database when the state of the information source is monitored to be changed; as described above.
An embodiment of the present invention further provides a storage medium, where the storage medium stores a computer program, where the computer program can be executed to implement the information source list display method described above; as described above.
In summary, the information source list display method, the Android television and the storage medium disclosed by the invention include: when the Android television is started, acquiring a source list of the starting, and detecting whether data corresponding to the source list exists in a database; when the data corresponding to the information source list does not exist in the database, storing the data corresponding to the information source list into the database; and after the data corresponding to the information source list is stored, sending an updating instruction to a Launcher interface, and displaying the data corresponding to the information source list on the Launcher interface. The invention realizes the purpose of adding the information source list to the Launcher interface without modifying the source code, is convenient for a user to check and switch the information source on the Launcher interface, can select the newly added information source list, and is very convenient.
It is to be understood that the invention is not limited to the examples described above, but that modifications and variations may be effected thereto by those of ordinary skill in the art in light of the foregoing description, and that all such modifications and variations are intended to be within the scope of the invention as defined by the appended claims.