Method for supporting cross-process running and displaying of Android vehicle-mounted application
Through the exported application interface library, it supports Android vehicle applications to run and display across processes, solving the problem that existing Android vehicle applications cannot effectively utilize the functions of the vehicle system, and realizes third-party application development of cross-process operation and display system application functions, improving ease of use and system efficiency.
Patent Information
- Application Number
- CN202311098449.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-29
- Publication Date
- 2025-02-28
- Estimated Expiration
- 2043-08-29
AI Technical Summary
Existing Android in-vehicle applications cannot effectively utilize the architectural features and special functions of the in-vehicle system, resulting in a gap between the Android application market and the in-vehicle application field, and the entertainment of the smart cockpit cannot be reflected.
Provides a method to support Android vehicle-mounted applications running and display across processes. Through the exported application interface library, developers can customize and develop third-party applications that support cross-process running and display system application functions, leaving Android source code projects.
It realizes the development of third-party applications that have cross-process running and display system application functions without Android TaskView source code, improves ease of use, supports TaskView reuse, and timely releases resources to ensure efficient system operation.
Smart Images

Figure CN119536864A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of Android vehicle-mounted technology, and in particular relates to a method for supporting cross-process running and display of Android vehicle-mounted applications. Background Art
[0002] Android Automotive Operating System (AAOS) is a full-stack, open-source, and highly customizable platform based on Android's general framework, language, and interface. It has undergone more than 10 years of iterative development. The existing security model, compatibility program, developer tools, and infrastructure make AAOS the mainstream in-vehicle architecture. Therefore, more and more Android in-vehicle developers have invested in the smart cockpit field of the AAOS platform.
[0003] AAOS is not a branch or parallel development of Android. The development of the entire in-vehicle system and in-vehicle applications has corresponding specifications and requirements. The development of in-vehicle applications needs to focus on safety, stability and performance from beginning to end. Android in-vehicle applications are also different from Android mobile or tablet applications. The existing Android application ecosystem is relatively lacking in adaptation to in-vehicle smart cockpit scenarios and cannot meet the experience of in-vehicle cockpit entertainment systems. Whether in user interface design or functional interaction, the development of applications has failed to fully utilize the architectural characteristics and special functions of the in-vehicle system, resulting in a gap between the Android application market and the in-vehicle application field, and the entertainment of the smart cockpit cannot be reflected. Summary of the invention
[0004] In view of the above problems, the present invention provides a method for supporting cross-process running and display of Android vehicle-mounted applications, so that developers can use the exported application interface library to customize and develop third-party applications that support cross-process running and display of system application functions without the Android TaskView source code, thereby achieving the effect of developing system special functions independently of the Android source code project.
[0005] In order to solve the above technical problems, the present invention adopts the following technical solutions:
[0006] A method for supporting cross-process running and display of an Android vehicle-mounted application comprises the following steps:
[0007] Open the Android application development tool and create an Android application project;
[0008] Import the exported application interface library into the libs directory corresponding to the project, and configure the application interface library as the project link library;
[0009] The main activity of the project creates a layout file, including a basic element control and a CardView element control. The basic element control is used to set multiple cross-process startup states, and the CardView element control is used to load TaskView and use the entire area as a cross-process application display area;
[0010] The main activity of the application completes the following settings in order: element control initialization; application interface library initialization; establishment of TaskView task listener; setting of TaskView display layer information; loading of TaskView display layer;
[0011] Launch applications across processes.
[0012] In one possible implementation, the element control initialization includes the declaration of the basic element object, the binding of the ID and the setting of the click event listener, as well as the declaration and ID binding of the CardView element object. The click event listener is used to switch the process startup state, allowing TaskView to display the target application running interface corresponding to different intentions.
[0013] In a possible implementation, the initialization of the application interface library includes initializing the TaskView factory class in the application interface library based on the main activity Activity of the application program, and then creating a TaskView manager through the TaskView factory class.
[0014] In one possible implementation, the TaskView task listener is used to manage and provide feedback on the four stages of initialization, creation, termination and resource release of the TaskView-started task. After the TaskView task listener is bound to the TaskView object created by the application interface library by the TaskView manager, the TaskView task listener takes effect.
[0015] In one possible implementation, the loading of the TaskView display layer includes: the TaskView manager integrates the CardView object and the created TaskView task listener into the internal program of the application interface library; by bypassing the system-level application interface restrictions, the application interface library is used to create a TaskView object inside it, the TaskView object is bound to the integrated TaskView task listener, and then the TaskView object is added to the CardView element; the TaskView task listener is ready, waiting for the start of the cross-process task and thereby triggering the processing logic of the corresponding stage of the TaskView task listener.
[0016] In a possible implementation, the cross-process application startup includes: the upper-layer application determines whether TaskView has already started the cross-process application startup task through the isTaskViewDeploy method provided by the TaskView manager. If it has been started, the release method provided by the TaskView manager is called to release the resources occupied by the current TaskView cross-process startup task, and while releasing the CardView object integrated into the application interface library to start a new cross-process application, a new TaskView object is recreated inside the application interface library and the integrated TaskView task listener is bound to facilitate the rapid start of a new cross-process application startup task; if it has not been started, the configuration is performed in the following order:
[0017] The TaskView manager integrates the CardView object and the created TaskView task listener into the internal program of the application interface library;
[0018] By bypassing the system-level application interface restrictions, the application interface library is used to create a TaskView object inside it, the TaskView object is bound to the integrated TaskView task listener, and then the TaskView object is added to the CardView element;
[0019] The TaskView task listener is ready, waiting for the start of the cross-process task to trigger the processing logic of the corresponding stage of the TaskView task listener;
[0020] The upper-level application encapsulates the intent to start the application, and then passes the intent as a parameter to the startActivity method provided by the TaskView manager. The intent passed to the application interface library is used by the internally created TaskView as the target application for cross-process startup. Finally, TaskView uses the internal intent as a parameter to call its own startActivity method to start the application, which is then displayed in the CardView.
[0021] A possible implementation further includes: when the application exits, the TaskView manager calls release in the destruction phase onDestroy of the application life cycle to release the memory and resources occupied by the intermediate cross-process startup application.
[0022] The present invention has the following beneficial effects:
[0023] (1) It is possible to develop third-party applications that can run across processes and display system applications without going through the Android source code process;
[0024] (2) The factory mode is introduced in the programming, which further improves the usability compared with the TaskView in the Android system source code;
[0025] (3) Support TaskView reuse, allowing TaskView to quickly switch between multiple applications;
[0026] (4) New TaskView resource management can promptly release the resources and memory occupied by the TaskView cross-process display application to ensure efficient operation of the system. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] Figure 1 This is a flowchart of the steps of a method for supporting cross-process running and display of Android in-vehicle applications according to an embodiment of the present invention. DETAILED DESCRIPTION
[0028] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0029] Reference Figure 1 , which is a flowchart of a method for supporting cross-process running and display of an Android vehicle-mounted application according to an embodiment of the present invention, comprising the following steps:
[0030] S10, open the Android application development tool and create an Android application project; the application package name is customized to maintain independence and avoid duplication with the system application package name; the minimum API version of the Android system needs to be less than or equal to 30 to ensure that the application interface library can be used normally;
[0031] S20, import the exported application interface library into the libs directory corresponding to the project, and configure the application interface library as a project link library; the libs directory can also be a developer-defined interface library directory; the application interface library can be configured as a project link library by using quick settings or modifying the project dependency file compilation method;
[0032] S30, the main activity of the project creates a layout file, including a basic element control (which can be a Button or Switch, etc.) and a CardView element control. The basic element control is used to set multiple cross-process startup states, and the CardView element control is used to load TaskView and use the entire area as a cross-process application display area;
[0033] S40, the main activity of the application completes the following settings in order: element control initialization; application interface library initialization; establishment of TaskView task listener; setting of TaskView display layer information; loading of TaskView display layer;
[0034] S50, starting an application across processes.
[0035] In one embodiment of the present invention, the element control initialization in S40 includes the declaration of the basic element object, the binding of the ID and the setting of the click event listener, as well as the declaration and ID binding of the CardView element object, wherein the click event listener is used to switch the process startup state, allowing TaskView to display the target application running interface corresponding to different intentions.
[0036] In one embodiment of the present invention, the initialization of the application interface library in S40 includes initializing the TaskView factory class in the application interface library based on the main activity Activity of the application program, and then creating the TaskView manager through the TaskView factory class. In a specific application instance, the initialization of the TaskView factory class and the creation of the TaskView manager can be performed in different stages on the basis of maintaining the sequence, and the effect is the same. TaskView is constructed based on the Android framework native library, and the interface layer is designed based on the factory mode. The factory class is initialized through the constructor method of the ArcVideoActivityViewFactory class, and then the createActivityViewManager method of the factory class is called to create the TaskView manager and return it to the application layer for APP to call.
[0037] In one embodiment of the present invention, the TaskView task listener in S40 is used for the management and feedback of the four stage states of initialization, creation, termination and resource release of the TaskView startup task. After the TaskView task listener is bound to the TaskView object created by the application interface library through the TaskView manager, the TaskView task listener takes effect.
[0038] In one embodiment of the present invention, the loading of the TaskView display layer in S40 includes: the TaskView manager integrates the CardView object and the created TaskView task listener into the internal program of the application interface library; by bypassing the system-level application interface restrictions, the application interface library is used to create a TaskView object inside it, the TaskView object is bound to the integrated TaskView task listener, and then the TaskView object is added to the CardView element; the TaskView task listener is ready, waiting for the start of the cross-process task and thereby triggering the processing logic of the corresponding stage of the TaskView task listener.
[0039] In one embodiment of the present invention, the cross-process application startup of S50 includes: the upper-layer application determines whether TaskView has already started the cross-process application startup task through the isTaskViewDeploy method provided by the TaskView manager (confirm whether it is the first time to start the cross-process task). If it has been started, the release method provided by the TaskView manager is called to release the resources occupied by the current TaskView cross-process startup task, and while releasing the CardView object integrated into the application interface library to start a new cross-process application, a new TaskView object is recreated inside the application interface library and the integrated TaskView task listener is bound to facilitate the rapid start of a new cross-process application startup task; if it has not been started, the configuration is performed in the following order:
[0040] The TaskView manager integrates the CardView object and the created TaskView task listener into the internal program of the application interface library;
[0041] By bypassing the system-level application interface restrictions, the application interface library is used to create a TaskView object inside it, the TaskView object is bound to the integrated TaskView task listener, and then the TaskView object is added to the CardView element;
[0042] The TaskView task listener is ready, waiting for the start of the cross-process task to trigger the processing logic of the corresponding stage of the TaskView task listener;
[0043] The upper-level application encapsulates the intent (Intent) of the application to be launched, and then passes the intent (Intent) as a parameter to the startActivity method provided by the TaskView manager. The intent passed to the application interface library is used by the internally created TaskView as the target application for cross-process launch to operate. Finally, TaskView uses the passed internal intent as a parameter to call its own startActivity method to start the application, which is then displayed in the CardView.
[0044] Based on S10 to S50, another embodiment of the present invention provides a method for supporting cross-process running and display of Android vehicle-mounted applications, further including: when the application exits, the TaskView manager calls release in the destruction phase onDestroy of the application life cycle to release the memory and resources occupied by the intermediate cross-process startup application, so as to leave a clean operating environment for the entire system.
[0045] In one embodiment of the present invention, TaskView is designed based on the native Android surface and adopts a dual-threaded working mode (UI thread and rendering thread). The TaskView manager created by the interface layer can call the startActivity method and pass in the intent parameter to start the APP that needs to be displayed. When the interface call ends or the application exits, the TaskView manager needs to release the memory and resources occupied by TaskView by calling the release method. Since TaskView is designed based on the native Android surface, when the application is directly started and displayed across processes after initialization, it is necessary to call the isResumed method of the TaskView manager to judge the Activity life cycle of the current application, ensure that the current application process enters the onResume stage, avoid the conflict between the surface thread of the current application and the surface process of the TaskView-started application, resulting in the failure of the cross-process startup of the application, and the application display also presents a black screen phenomenon. Android presents the screen of the APP running by simulating the screen display through the surface. The system limits the number of virtual display channels internally, resulting in the inability of TaskView to achieve the effect of coexistence of multiple instances (similar to the effect of split screen, displaying the running interfaces of two APPs at the same time). By passing different Intents to the interface layer TaskView manager through the upper-layer application, the TaskView manager will give priority to releasing the resources occupied by the current TaskView after launching the application across processes, and then recreate a new TaskView object internally and bind the CardView and task launch listener, and then call the startActivity method to cross-process launch the target application corresponding to the passed Intent. In this way, there is no need to create a manager for each TaskView. You only need to release the old TaskView process resources when a new Intent is passed in, and then start a new cross-process application launch task to achieve the reuse effect of TaskView.
[0046] The above-mentioned method of supporting cross-process running and display of Android in-vehicle applications allows developers to use the exported application interface library to customize the development of third-party applications that support cross-process running and display of system application functions without the Android TaskView source code, thereby achieving the effect of developing system special functions independently of the Android source code project.
[0047] It should be understood that the exemplary embodiments described herein are illustrative rather than restrictive. Although one or more embodiments of the present invention have been described in conjunction with the accompanying drawings, it should be understood by those skilled in the art that various changes in form and detail may be made without departing from the spirit and scope of the present invention as defined by the appended claims.
Claims
1. A method for supporting cross-process running and display of Android vehicle-mounted applications, characterized in that: The following steps are involved: Open the Android application development tool and create an Android application project; Import the exported application interface library into the libs directory corresponding to the project, and configure the application interface library as the project link library; The main activity of the project creates a layout file, including a basic element control and a CardView element control. The basic element control is used to set multiple cross-process startup states, and the CardView element control is used to load TaskView and use the entire area as a cross-process application display area; The main activity of the application completes the following settings in order: element control initialization; Initialize the application interface library; establish the TaskView task listener; set the information of the TaskView display layer; load the TaskView display layer; Launch applications across processes.
2. The method for supporting cross-process operation and display of Android vehicle-mounted applications as claimed in claim 1, characterized in that: The element control initialization includes the declaration of basic element objects, ID binding and setting of click event listeners, as well as the declaration and ID binding of CardView element objects. The click event listener is used to switch the process startup state, allowing TaskView to display the target application running interface corresponding to different intentions.
3. The method for supporting cross-process operation and display of Android vehicle-mounted applications as claimed in claim 2, characterized in that: The initialization of the application interface library includes initializing the TaskView factory class in the application interface library based on the main activity Activity of the application program, and then creating a TaskView manager through the TaskView factory class.
4. The method for supporting cross-process operation and display of Android vehicle-mounted applications as claimed in claim 3, characterized in that: The TaskView task listener is used for the management and feedback of the four stages of status of initialization, creation, termination and resource release of the TaskView startup task. After the TaskView task listener is bound to the TaskView object created by the application interface library through the TaskView manager, the TaskView task listener takes effect.
5. The method for supporting cross-process operation and display of Android vehicle-mounted applications as claimed in claim 4, characterized in that: The loading of the TaskView display layer includes: the TaskView manager integrates the CardView object and the created TaskView task listener into the internal program of the application interface library; by bypassing the system-level application interface restrictions, the application interface library is used to create a TaskView object inside it, the TaskView object is bound to the integrated TaskView task listener, and then the TaskView object is added to the CardView element; the TaskView task listener is ready, waiting for the start of the cross-process task and then triggering the processing logic of the corresponding stage of the TaskView task listener.
6. The method for supporting cross-process operation and display of Android vehicle-mounted applications as claimed in claim 5, characterized in that: The cross-process application startup includes: the upper-layer application determines whether TaskView has already started the cross-process application startup task through the isTaskViewDeploy method provided by the TaskView manager. If it has been started, the release method provided by the TaskView manager is called to release the resources occupied by the current TaskView cross-process startup task, and while releasing the CardView object integrated into the application interface library to start a new cross-process application, a new TaskView object is recreated inside the application interface library and the integrated TaskView task listener is bound to facilitate the rapid start of a new cross-process application startup task; if it has not been started, the configuration is performed in the following order: The TaskView manager integrates the CardView object and the created TaskView task listener into the internal program of the application interface library; By bypassing the system-level application interface restrictions, the application interface library is used to create a TaskView object inside it, the TaskView object is bound to the integrated TaskView task listener, and then the TaskView object is added to the CardView element; The TaskView task listener is ready, waiting for the start of the cross-process task to trigger the processing logic of the corresponding stage of the TaskView task listener; The upper-level application encapsulates the intent to start the application, and then passes the intent as a parameter to the startActivity method provided by the TaskView manager. The intent passed to the application interface library is used by the internally created TaskView as the target application for cross-process startup. Finally, TaskView uses the internal intent as a parameter to call its own startActivity method to start the application, which is then displayed in the CardView.
7. The method for supporting cross-process operation and display of Android vehicle-mounted applications as claimed in claim 6, characterized in that: Further including: When the application exits, the TaskView manager calls release in the destruction phase of the application life cycle, onDestroy, to release the memory and resources occupied by the intermediate cross-process application launch.
Citation Information
Patent Citations
Android system application program data file generation and invocation method and device
CN106598974A
Fast display method of vehicle-mounted system
CN108897487A
Method for quickly loading multimedia application list applied to Android vehicle-mounted system
CN110188211A
Process management method and device, electronic equipment and storage medium
CN114968551A
Vehicle-user interaction system and interaction method
CN115703475A