Method for supporting cross-process running and display of android in-vehicle application
Through the exported application interface library and TaskView manager, cross-process operation and display are achieved without the need for Android source code, solving the problem of insufficient utilization of system architecture in Android in-vehicle application development and improving development ease of use and system efficiency.
Patent Information
- Application Number
- CN202311098449.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-29
- Publication Date
- 2025-10-10
- Estimated Expiration
- 2043-08-29
AI Technical Summary
Existing Android in-vehicle applications cannot fully utilize the architectural characteristics and special functions of the in-vehicle system, resulting in insufficient entertainment in the smart cockpit. In addition, the development process relies on Android source code and lacks support for cross-process operation and display.
By using the exported application interface library, factory mode and TaskView manager, a method of cross-process running and display is implemented, including element control initialization, interface library initialization, TaskView task listener setting and cross-process startup, bypassing system-level interface restrictions and supporting fast switching and resource management of cross-process applications.
It supports cross-process operation and displays system application functions without the need for Android source code, improves the ease of development and system efficiency, supports the reuse of TaskView and the timely release of resources, and ensures efficient operation of the system.
Smart Images

Figure CN119536864B_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] The Android Automotive Operating System (AAOS) is a full-stack, open-source, and highly customizable platform built on Android's common framework, language, and interfaces. Developed over a decade of iterative development, its existing security model, compatibility procedures, developer tools, and infrastructure have made AAOS a mainstream in-vehicle architecture. Consequently, a growing number of Android automotive developers are investing in the smart cockpit space using the AAOS platform.
[0003] AAOS is not a fork of Android or a parallel development. The entire in-vehicle system and in-vehicle application development have 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 poorly adapted for in-vehicle smart cockpit scenarios and cannot meet the experience of in-vehicle cockpit entertainment systems. Whether in user interface design or functional interaction, application development 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 value 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 in-vehicle 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 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 Android in-vehicle applications, comprising 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 project main activity creates a layout file, including basic element controls for setting multiple cross-process start states and a CardView element control for loading a TaskView and using a whole area as a cross-process application display area;
[0010] The application main activity sequentially completes the following settings: element control initialization; application interface library initialization; establishment of a TaskView task listener; information setting of a TaskView display layer; loading of the TaskView display layer;
[0011] Cross-process start application.
[0012] In a possible implementation manner, the element control initialization includes declaration of a basic element object, binding and setting of an ID of a click event listener, and declaration and ID binding of a CardView element object, the click event listener being used for switching a cross-process start state to enable the TaskView to display a different target application running interface corresponding to an intent.
[0013] In a possible implementation manner, the application interface library initialization includes initializing a 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 a possible implementation manner, the TaskView task listener is used for management and feedback of four stage states of initialization, creation, end and resource release of a TaskView start task, and the TaskView task listener is effective after being bound to a TaskView object created by the application interface library through the TaskView manager.
[0015] In a possible implementation manner, the loading of the TaskView display layer includes: integrating, by the TaskView manager, a CardView object and the created TaskView task listener into an internal program of the application interface library; creating, by the application interface library, a TaskView object in the internal program by bypassing a system-level application interface limitation, binding the integrated TaskView task listener to the TaskView object, and adding the TaskView object to the CardView element; and the TaskView task listener is ready, and waits for a cross-process task to be started to trigger processing logic of a corresponding stage of the TaskView task listener.
[0016] In one 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 so, the release method provided by the TaskView manager is called to release the resources occupied by the current TaskView cross-process startup task, and at the same time, the CardView object integrated into the application interface library is released to start a new cross-process application. At the same time, a new TaskView object is recreated within the application interface library and the integrated TaskView task listener is bound to facilitate the rapid start of a new cross-process application 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: after 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) Program design introduces factory mode, relative to TaskView of Android system source code itself, further improves the ease of use;
[0025] (3) Support TaskView reuse, enable TaskView to quickly switch between multiple applications;
[0026] (4) Add TaskView resource management, can release TaskView cross-process display application occupied resources and memory in time, ensure the efficient operation of system. BRIEF DESCRIPTION OF DRAWINGS
[0027] Figure 1 The step flow chart of the method for supporting the cross-process running and display of the Android vehicle-mounted application is shown. DETAILED DESCRIPTION
[0028] The technical solutions in the embodiments of the application will be described clearly and completely below with reference to the drawings in the embodiments of the application. Obviously, the described embodiments are part of the embodiments of the application, rather than all the embodiments. Based on the embodiments in the application, all other embodiments obtained by those skilled in the art without creative labor fall within the protection scope of the application.
[0029] Referring to Figure 1 , the step flow chart of the method for supporting the cross-process running and display of the Android vehicle-mounted application is shown, including the following steps:
[0030] S10, open an Android application development tool, and create an Android application project; wherein the application package name is customized, independent, and avoids 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 an interface library directory customized by the developer; the application interface library can be configured as a project link library by using the shortcut setting or modifying the project dependency file compilation mode;
[0032] S30, the project main activity creates a layout file, including basic element controls (such as Button or Switch) and CardView element controls, the basic element controls are used to set multiple cross-process start states, and the CardView element controls are used to load TaskView and use the whole area as a cross-process application display area;
[0033] S40, the application main activity 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 status, 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 at different stages while maintaining the order, and the effects are the same. TaskView is constructed based on the native library of the Android framework, and the interface layer is designed based on the factory pattern. 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 to manage and provide feedback on the status of the four stages 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 circumventing 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.
[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 at the same time as the CardView object integrated into the application interface library is released 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) that needs to start the application, 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 startup to operate. Finally, TaskView uses the internal intent as a parameter to call its own startActivity method to start the application, and then displays it 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 in-vehicle 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 an embodiment of the present application, TaskView is designed based on the original surface of Android, adopts a double-thread working mode (UI thread and rendering thread), and the TaskView manager created by the interface layer can call the startActivity method and pass in the Intent parameter to start the APP 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 original surface of Android, when the application is initialized and directly starts and displays the cross-process application, the isResumed method of the TaskView manager needs to be called to judge the Activity lifecycle of the current application, to ensure that the current application process enters the onResume stage, to 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 cross-process application startup, and the black screen phenomenon of application display. Android presents the running screen of the APP by simulating the screen display of the surface, and the system internally limits the number of virtual display channels, which causes TaskView to fail to achieve the effect 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 from the upper layer application, the TaskView manager will preferentially release the resources occupied by the cross-process application started by the current TaskView, and then internally create a new TaskView object and bind the CardView and task start listener, and then call the startActivity method to cross-process start the target application corresponding to the passed-in Intent. In this way, it is not necessary to create a manager for each TaskView, but only need to release the resources of the old TaskView process when a new Intent is passed in, and then start a new cross-process application task to achieve the reuse effect of TaskView.
[0046] The above method of supporting cross-process running and display of Android car applications makes it possible for developers to develop third-party applications that support cross-process running and display of system applications without the Android TaskView source code, achieving the effect of developing special system functions without the Android source code.
[0047] It should be understood that the example embodiments described herein are illustrative and non-limiting. Although one or more embodiments of the present application are described in connection with the accompanying drawings, it will be understood by those skilled in the art that various changes in form and details can be made without departing from the spirit and scope of the application as defined by the appended claims.
Claims
1. A method for supporting cross-process operation and display of Android in-vehicle 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 project main activity 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 in-vehicle applications according to claim 1, characterized in that: 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 cross-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 in-vehicle applications according to 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 in-vehicle applications according to 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, end 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 in-vehicle applications according to 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 in-vehicle applications according to 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 so, the release method provided by the TaskView manager is called to release the resources occupied by the current TaskView cross-process startup task, and at the same time, the CardView object integrated into the application interface library is released to start a new cross-process application. At the same time, a new TaskView object is recreated within 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 in-vehicle applications according to 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 startup application.
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