Application program starting method and device, equipment and storage medium
By detecting user operations to optimize the application startup process, the problem of cold starting optimization effects caused by hardware performance restrictions and inaccurate pre -loading in existing technology has achieved a faster cold startup speed and better users with better users and better users. Experience.
Patent Information
- Application Number
- CN202411415698.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-10
- Publication Date
- 2025-01-28
AI Technical Summary
When optimizing the cold start speed of an application, the prior art is susceptible to factors such as hardware performance limitations and inaccurate preloading, resulting in poor optimization results in some scenarios and affecting the user experience.
By detecting the operation of the user's application and loosening the target application icon, in response to these operations to optimize the startup process of the application. The specific method includes the Activity of the target application when the user presses the target application icon, and suspend the call of other functions after the onCreate function is executed; when the user loose the target application icon and meet the preset conditions, resume calling the Activity cycle of life cycle Other functions are displayed to display the interface.
Effectively reduce the waiting time of the application interface, increase the speed of cold start, improve the user experience, and stably play the optimization role in more scenarios.
Smart Images

Figure CN119376816A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of smart terminal technology, and relate to but are not limited to a method and apparatus, device, and storage medium for starting an application. Background Art
[0002] With the development of technology, various applications (APPs) installed on mobile phones, tablets and other terminal devices have become closely connected with people's daily lives. The application needs to be started before the corresponding application interface can be displayed on the terminal device. Optimizing the startup speed of the application is crucial to improving user satisfaction and usage experience.
[0003] In related technologies, in order to speed up the cold start of applications, performance resources can be tilted by increasing the frequency, binding cores, and increasing process priority, or by predicting the application based on the user's usage habits and preloading the application to optimize the cold start of the application. However, the above methods may be affected by the performance limitations of the hardware itself or inaccurate predictions, resulting in the inability of the application startup optimization measures to fully play a role in some scenarios, thereby affecting the startup speed of the application and the final user experience. Summary of the invention
[0004] In view of this, the application startup method, device, equipment, and storage medium provided in the embodiments of the present application can reduce the waiting time for displaying the application interface when the user selects the target application for cold startup, so as to speed up the cold startup speed and improve the user experience. The application startup method, device, equipment, and storage medium provided in the embodiments of the present application are implemented as follows:
[0005] In one aspect of an embodiment of the present application, a method for starting an application program is provided, which is applied to a terminal device, and the method includes:
[0006] The terminal device detects a first operation of a user pressing a target application icon, and in response to the first operation, starts an Activity of a target application corresponding to the target application icon, calls and executes an onCreate function in the Activity life cycle, and after the onCreate function is executed, suspends the calling of other functions in the Activity life cycle;
[0007] The terminal device detects a second operation of the user releasing the target application icon, and if the second operation meets a preset condition, in response to the second operation, resumes calling other functions in the Activity life cycle to display the Activity corresponding interface.
[0008] Another aspect of the embodiment of the present application further provides an application startup device, including:
[0009] A detection module, used to detect a first operation of a user pressing a target application icon;
[0010] A first response module, configured to start the Activity of the target application corresponding to the target application icon in response to the first operation, call and execute the onCreate function in the Activity life cycle, and suspend the calling of other functions in the Activity life cycle after the onCreate function is executed;
[0011] The detection module is further used to detect a second operation of the user releasing the target application icon;
[0012] The second response module is used to respond to the second operation and resume calling other functions in the Activity life cycle to display the Activity corresponding interface when the second operation meets the preset conditions.
[0013] The computer device provided in the embodiment of the present application includes a memory and a processor. The memory stores a computer program that can be run on the processor. When the processor executes the program, the method of the embodiment of the present application is implemented.
[0014] The computer-readable storage medium provided in the embodiment of the present application has a computer program stored thereon, and when the computer program is executed by a processor, the method provided in the embodiment of the present application is implemented.
[0015] In the application startup method, apparatus, device, and storage medium provided in the embodiments of the present application, the terminal device can detect a first operation in which a user presses a target application icon, and in response to the first operation, start the Activity of the target application corresponding to the target application icon, call and execute the onCreate function in the Activity life cycle, and implement initialization operations on the Activity of the target application, such as setting the layout, binding controls, and obtaining data; after the onCreate function is executed, suspend the call of other functions in the Activity life cycle, such as the onStart function, the onResume function, etc., to avoid occupying too many performance resources.
[0016] After detecting the first operation of the user pressing the target application icon, the terminal device detects the second operation of the user releasing the target application icon. When the second operation meets the preset conditions, it resumes calling other functions in the Activity life cycle, such as the onStart function, the onResume function, etc. Since the onCreate function in the Activity life cycle has been executed, the terminal device can quickly display the corresponding interface of the Activity, complete the cold start of the target application, and improve the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] The drawings herein are incorporated into the specification and constitute a part of the specification. These drawings illustrate embodiments consistent with the present application and are used together with the specification to illustrate the technical solution of the present application.
[0018] Figure 1 A schematic diagram of an application scenario of the application startup method provided in an embodiment of the present application;
[0019] Figure 2 A schematic diagram of the software architecture of a terminal device provided in an embodiment of the present application;
[0020] Figure 3 A schematic diagram of the hardware structure of a terminal device provided in an embodiment of the present application;
[0021] Figure 4 A flowchart of a method for starting an application program provided in an embodiment of the present application;
[0022] Figure 5a A schematic diagram of the Activity corresponding interface provided in the embodiment of the present application;
[0023] Figure 5b Another schematic diagram of the Activity corresponding interface provided in the embodiment of the present application;
[0024] Figure 6 Another flowchart of the method for starting an application program provided in an embodiment of the present application;
[0025] Figure 7 Another flowchart of the application startup method provided in the embodiment of the present application;
[0026] Figure 8 A flowchart of a method for starting an application provided in an embodiment of the present application when the interval between the second operation and the first operation is greater than a preset third interval;
[0027] Fig. 9 A schematic diagram of an interface for displaying a card corresponding to a target application provided in an embodiment of the present application;
[0028] Fig.10 A schematic diagram of the structure of an application startup device provided in an embodiment of the present application;
[0029] Fig.11 A schematic diagram of the structure of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0030] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the specific technical solution of the present application will be further described in detail below in conjunction with the drawings in the embodiments of the present application. The following embodiments are used to illustrate the present application, but are not used to limit the scope of the present application.
[0031] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.
[0032] In the following description, reference is made to “some embodiments”, which describe a subset of all possible embodiments, but it will be understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.
[0033] It should be pointed out that the terms "first\second\third" involved in the embodiments of the present application are used to distinguish similar or different objects, and do not represent a specific ordering of the objects. It can be understood that "first\second\third" can be interchanged in a specific order or sequence where permitted, so that the embodiments of the present application described here can be implemented in an order other than that illustrated or described here.
[0034] In the related art, the startup methods of an application are generally divided into cold startup, hot startup and warm startup. The three methods have different startup times and different effects during the startup process of the application.
[0035] Cold start, cold start means that the application starts from scratch: the system process creates the application process after the cold start. Cold start occurs when the application is started for the first time since the device started or the system terminated the application. When the application cold starts, the system has three tasks: load and start the application; display a blank window for the application; create the application process. After the application process is created, the subsequent tasks are to create the application object; start the main thread (ActivityThread); create the main activity (MainActivity); create views; layout the screen (onLayout); perform drawing (onDraw). After drawing MainActivity, the blank window is replaced with the MainActivity display.
[0036] Hot start, when the application is in the foreground, you can switch the current foreground application to the background by pressing the Home button of the terminal device or starting other applications. At this time, the process of the application will still remain in the background. At this time, starting the application in the background with an existing process can be called hot start. Hot start does not need to repeat the process of creating views, laying out screens, and performing drawing in cold start.
[0037] Warm start, warm start includes some operations that occur during cold start; at the same time, its overhead is higher than hot start. There are many potential states that can be considered warm start. For example: the user restarts the application after exiting the application. The application process may continue to run, but the application must recreate the Activity from scratch by calling the onCreate function. For example, the user presses the return key to exit the application and then restart the application. As the user's usage time increases, a large number of cached processes in the operating system are killed due to memory shortage or reaching the upper limit of the number of processes, and the Activity data cached in the Activity Manager Service (AMS) of the application corresponding to the killed process still exists. In this case, the application needs to restart the process to start the application.
[0038] Among the above three startup methods, when the application is cold started, it involves a comprehensive initialization process from scratch, such as the creation of system processes, the generation of application processes, and a series of subsequent tasks (including object creation, main thread startup, activity creation, view construction, screen layout and drawing execution, etc.), which leads to a relatively long startup delay and poor user experience, and needs to be optimized.
[0039] In the related technology, in order to improve the response speed of the application during cold start, the cold start can be optimized by pulling performance resources, preloading or blanking the process. For example, for the pulling performance resources method, the cold start can be optimized by tilting performance resources, such as increasing the frequency, binding the core, and increasing the process priority; for the preloading method, the cold start can be optimized by preloading the process in the background according to the user's usage habits and predicting the application in the background in advance; for the blank process method, a blank process pool can be created in the background in advance, and when the process is cold started, the blank process can be used directly, reducing the time of incubating the process.
[0040] However, when using the above methods for cold start optimization, the cold start optimization by pulling up performance resources depends on the hardware performance of the terminal device itself, which can be regarded as a tilt of performance resources and is not applicable to terminal devices with weaker performance; the cold start optimization by preloading has the problem of inaccurate preloading, resulting in waste of background resources, or the application that the user needs to start is not preloaded, resulting in a long waiting time; and the cold start optimization by blank process. The cold start optimization effect is not obvious, and it only has a short optimization effect on the incubation process (creating a new process by copying its own resources, including memory space, code library, etc. through the Zygote process), and occupies performance resources for a long time.
[0041] In view of this, in order to optimize the startup speed of an application during a cold start and enhance the stability of cold start optimization so that it can be applied in more scenarios, an embodiment of the present application provides an application startup method, which can reduce the waiting time for displaying the application interface when a user selects a target application for cold start, thereby speeding up the cold start speed and improving the user experience.
[0042] The following explains the actual scenario in which the application startup method provided in the embodiment of the present application is applied and the objects included in the scenario.
[0043] See also Figure 1 , Figure 1 A schematic diagram of an application scenario of the application startup method provided in the embodiment of the present application, such as Figure 1 The scenario shown may include a terminal device 10 and a user 20 .
[0044] like Figure 1 The screen interface displayed on the display screen of the terminal device 10 shown includes 14 application icons (icon 1 to icon 14), each of which corresponds to an application program, that is, icons 1 to icon 14 are pairs of application programs 1 to application programs 14. For example, each application program can be a calculator, calendar, camera application, or other application programs pre-installed when the terminal device 10 leaves the factory, or other application programs can be installed according to the needs of the user. This is not limited here.
[0045] In the embodiment of the present application, the terminal device 10 can detect the user 20 pressing or releasing the target application icon corresponding to the target application to be started. Figure 1 The independent application icons shown in icons 1 to 5 may also be one of the application icons in a large folder as shown in icons 6 to 14, which is not limited here.
[0046] like Figure 1In the illustrated embodiment, the finger of the user 20 is at the icon 13, and the terminal device 10 can cold start the application 13 corresponding to the icon 13 through the application startup method provided in the present application, so as to speed up the display of the corresponding interface of the Activity of the application 13 and improve the user experience.
[0047] It should be noted that Activity refers to the presentation layer of an APP in the Android system. Every user interface (UI) of an APP is displayed through the Activity class. Each Activity uses fragments and views to layout and display information, as well as respond to user operations.
[0048] The cold start time of an application is the time it takes from the user clicking the application icon to the application being fully loaded and presenting the first interface. During the cold start process of an application, the first Activity presented is usually the MainActivity, which is responsible for displaying the main functions and content of the application.
[0049] The life cycle of an Activity involves multiple callback functions (methods) to start or close an Activity. The callback functions include: onCreate function: called when the Activity is started for the first time, in which the global resources and states that the Activity can use are initialized, such as binding events, creating threads, etc.; onStart function: called when the Activity is visible to the user, that is, the Activity is displayed on the front end, this method is generally used to initialize or start resources related to updating the interface; onResume function: called when the user interacts with the Activity, at this time the Activity is at the top of the return stack and is in a running state, this method completes some lightweight work to avoid the user waiting; onPause function: called when starting or resuming another Activity, this method is generally used to save persistent information of the interface, submit unsaved data, and release resources that consume the CPU; onStop function: this method is called when the Activity is not visible, such as: when other Activities are started or resumed and overwritten; onDestory function: called before the Activity is destroyed; onRestart function: called before the Activity is destroyed.
[0050] It can be understood that the application startup method provided in the present application is used to optimize the cold start of the application. The application's Activity will not be displayed before it is determined that an application needs to be cold started rather than the user accidentally clicking the application's icon. Therefore, before it is determined that the application needs to be cold started, other functions in the Activity life cycle, such as the onStart function and the onResume function, will not be called.
[0051] like Figure 1 The terminal device 10 shown takes a mobile phone as an example. Optionally, the terminal device 10 may include but is not limited to tablets, mobile phones, wearable devices, vehicle-mounted devices, augmented reality (AR) / virtual reality (VR) devices, laptops, ultra-mobile personal computers (UMPC), netbooks, personal digital assistants (PDA) and other devices. The user 20 can click, long press or slide the terminal device 10 with a finger or with the help of an input device such as a stylus, mouse, or touchpad to control the terminal device 10.
[0052] The following introduces the software architecture of the terminal device, taking the terminal device as the execution subject.
[0053] See also Figure 2 , Figure 2 A schematic diagram of the software architecture of a terminal device provided in an embodiment of the present application is shown in FIG. Figure 2 As shown, the software architecture of the terminal device may include: an application (APP) layer, an application framework (FWK) layer, a system library and a kernel layer.
[0054] The application layer, referred to as the application layer, can include a series of applications, such as cameras, photo galleries, browsers, video playback software, and games. When these applications are running, they can access the various service modules provided by the application framework layer through the application programming interface (API) and perform corresponding intelligent services. In addition, the application layer can also include Android core applications such as the application monitoring process (apTouchDaemon), the desktop launcher (launcher), and the system user interface (systemUI).
[0055] Usually, after the Android system is started, the launcher can be used as a core application to run in the Android system. The application icon of the application is generally set in the launcher. Specifically, the launcher can monitor the user's operation on the application icon through the input subsystem. When the input subsystem detects that the user clicks on the application icon of a certain application, it distributes the input event to the launcher. The launcher processes the input event, generates a startup message of the application and sends it to the relevant services in the application framework layer, starts the application process of the application through these services, and draws the startup window, and then the systemUI displays the drawn interface. It should be understood that when the user clicks on the icons of different applications, the launcher will generate startup messages for different applications, thereby starting the application processes corresponding to different applications.
[0056] It should be noted that in this application, the launcher needs to distinguish between the user's press (down) event, release (up) event, and long press event on the application icon. Among them, the down event refers to the touch event recorded by the system at the moment when the user's finger first touches the surface of the application icon, marking the beginning of the interaction between the user and the icon. The up event is the touch event recorded by the system at the moment when the user's finger moves away from the application icon, marking the end of the direct interaction between the user and the icon. According to the interval duration, position change and other information between the down event and the up event, it can be determined whether the user's touch operation is a short press, long press or sliding operation to judge the user's intention, and then determine whether to start the application corresponding to the touched application icon to avoid wasting performance resources.
[0057] The application framework layer, referred to as the framework layer, can provide APIs and programming frameworks for applications in the application layer. The programming framework includes some predefined functions, such as the system server process and the Zygote process.
[0058] Among them, the systemserver process can provide almost all system services for the APP in the application layer, such as activity manager service (AMS), power management service (PMS), window management service (WMS), and input method management service (IMS). These system services can reside in the systemserver process in the form of threads.
[0059] The Zygote process is a very important daemon service in the Android system. Almost all application processes are forked through the Zygote process. Since each application is written in Java, each application needs to run in its own independent virtual machine as a process. When an application is started, the Zygote process can hatch the virtual machine of the application and share the virtual machine memory and various services provided by the systemserver process.
[0060] Usually, after the launcher detects that the user clicks on the application icon of a certain application, it can send a startup message of the application to the systemserver process. If the application process of the application does not exist in the current application process, then it is necessary to create an application process for the application. The systemserver process can call AMS to communicate with the Zygote process and request the Zygote process to create a corresponding application process for the application. After receiving the request, the Zygote process responds to the request and creates an application process. The application process includes the main thread (ActivityThread) of the application. In order to start running the application code normally, the application process needs to initialize the main thread of the application first and load the class file of the application into the memory. Among them, the main thread can complete the initialization of the main thread by executing the main function of ActivityThread. By initializing the main thread of the application, a virtual machine environment in which the application can run can be built, the application process of the application can be registered in AMS, various directories when the application is running, and a message distribution mechanism for various services between the application and the systemserver process can be created when the application is running.
[0061] In the embodiment of the present application, processes such as launcher, systemserver, systemUI and Zygote can communicate with each other through binder (an inter-process communication mechanism).
[0062] The system library may include multiple functional modules, such as surface manager, media libraries, 3D graphics processing library (such as OpenGL ES), 2D graphics engine (such as SGL), etc.
[0063] Android runtime includes core libraries and virtual machines. Android runtime is responsible for scheduling and management of the Android system. The core library consists of two parts: one is the function that the Java language needs to call, and the other is the Android core library. The application layer and the application framework layer run in the virtual machine. The virtual machine executes the Java files of the application layer and the application framework layer as binary files. The virtual machine is used to perform object life cycle management, stack management, thread management, security and exception management, and garbage collection.
[0064] The kernel layer is a layer between hardware and software. The kernel layer at least includes display driver, audio driver, sensor driver, etc., and the embodiment of the present application does not impose any restrictions on this.
[0065] It should be noted that Figure 2 The layers in the software structure shown and the components contained in each layer do not constitute a specific limitation on the terminal device. In other embodiments, the terminal device may include more layers than shown in the figure. Each layer may include more or fewer components than shown in the figure. In addition, the above-mentioned functional modules may also be combined into one functional module, and one functional module may also be composed of multiple functional modules.
[0066] Through the above software architecture, the terminal device can detect and identify the user's touch operation on the application icon, thereby implementing cold start optimization for the selected application. This effectively shortens the response time from the user pressing the application icon to the display of the application interface, improving the user experience.
[0067] The above explains the software architecture of the terminal device. In order to explain the structure of the terminal device more comprehensively, the hardware structure of the terminal device is explained below.
[0068] See also Figure 3 , Figure 3 A schematic diagram of the hardware structure of the terminal device provided in the embodiment of the present application is shown in FIG. Figure 3 As shown, the terminal device may include components such as a processor 310, a memory 320, a transceiver 330, a display unit 340, and an input unit 350.
[0069] The processor 310 is the control center of the terminal device, and uses various interfaces and lines to connect various parts of the entire terminal device. By running or executing software programs and / or modules stored in the memory 320, and calling data stored in the memory 320, the processor 310 performs various functions of the terminal device and processes data, thereby monitoring the terminal device as a whole. Optionally, the processor 310 may include one or more processing units; optionally, the processor 310 may integrate an application processor, which mainly processes operating devices, user interfaces, and application programs, etc. Of course, other processors may also be included, which are not limited here.
[0070] The memory 320 can be used to store software programs and modules. The processor 310 executes various functional applications and data processing of the terminal device by running the software programs and modules stored in the memory 320. The memory 320 mainly includes a program storage area and a data storage area, wherein the program storage area can store operating devices, at least one application required for a function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area can store data created according to the use of the terminal device (such as audio data, a phone book, etc.), etc. In addition, the memory 320 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.
[0071] The transceiver 330 can provide wireless communication solutions applied to terminal devices, including wireless local area networks (WLAN) (such as wireless fidelity (WiFi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc. The transceiver 330 can be one or more devices integrating at least one communication processing module, for example, an antenna and a baseband processor are integrated into the transceiver 330, or an antenna and a modem processor are integrated into the transceiver 330, etc., which are not limited here.
[0072] The display unit 340 can be used to display information input by the user or information provided to the user and various menus of the terminal device. The display unit 340 can be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), etc., which is not limited here.
[0073] The input unit 350 can be used to receive input digital or character information, and to generate signal inputs related to user settings and function controls of the terminal device. Among them, the input unit 350 can collect the user's operations on or near it, and drive the corresponding connection device according to a pre-set program. In addition, the input unit 350 may include a touch panel, which can be implemented in various types such as resistive, capacitive, infrared, and surface acoustic waves. In addition to the touch panel, the input unit 350 may also include other input devices. Among them, other input devices may include but are not limited to one or more of function keys (such as volume control buttons, switch buttons, etc.), trackballs, joysticks, etc.
[0074] It is to be understood that the structure illustrated in the embodiments of the present application does not constitute a specific limitation on the terminal device. In other embodiments of the present application, the terminal device may include more or fewer components than shown in the figure, or combine certain components, or split certain components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0075] In order to solve the deficiencies existing in the aforementioned related technologies, an application startup method is provided in an embodiment of the present application, and the specific implementation process of the application startup method is explained in detail below.
[0076] See also Figure 4 , Figure 4 A flowchart of the application startup method provided in the embodiment of the present application is shown in FIG. Figure 4 As shown, the method may include the following steps:
[0077] S401, the terminal device detects a first operation in which a user presses a target application icon, and in response to the first operation, starts the Activity of the target application corresponding to the target application icon, calls and executes the onCreate function in the Activity life cycle, and after the onCreate function is executed, suspends the calling of other functions in the Activity life cycle.
[0078] It should be noted that the first operation is the operation detected by the terminal device when the user presses the target application icon. The user can complete this operation in a variety of ways, such as fingers, stylus, external mouse, etc., which are not limited here. In the cold start process of the target application, a series of steps are also involved, such as loading and starting the target application, displaying a blank window for the target application, and creating a target application process. In this application, these steps can be performed before starting the Activity associated with the target application icon, or when the first operation is detected, which is not limited here.
[0079] For example, taking the case where a user touches a target application icon displayed on the display screen of a terminal device with a finger or a stylus, the hardware of the terminal device (such as a touch screen sensor) is responsible for capturing this operation. After obtaining the user's point reporting data (which may include the point reporting and touch time), the point reporting data is passed to the input subsystem. The input subsystem distributes the down event detected based on the point reporting data to the launcher, thereby detecting the first operation of the user pressing the target application icon, so as to perform a subsequent cold start of the target application corresponding to the target application icon.
[0080] In an embodiment of the present application, after the terminal device detects a first operation in which the user presses a target application icon, the Activity of the target application corresponding to the target application icon can be started in response to the first operation, and the onCreate function in the Activity life cycle can be called and executed.
[0081] It is understandable that the Activity life cycle contains multiple callback functions, such as the onCreate function, onStart function, and onResume function. Since when the terminal device detects the first operation of the user pressing the target application icon, it cannot determine whether the user intends to start the target application, or the user accidentally touches the icon, or the user intends to turn the page but the first touch point happens to be on the target application icon, therefore, in order to avoid the inconvenience caused to the user by the incorrect display of the Activity corresponding interface, only the onCreate function in the Activity life cycle is called, and after the onCreate function is executed, the call to other functions in the Activity life cycle is suspended, that is, it stops at the onCreate callback.
[0082] Optionally, after the onCreate function is executed, the calls to other functions in the Activity life cycle are suspended, which can be achieved through the terminal device system mechanism. For example, a flag or status code is set to identify the status of the Activity, and the subsequent functions of the Activity life cycle are controlled accordingly. When the target application is subsequently determined to be started based on the detection conditions, the flag or status is adjusted to call subsequent functions such as onStart and onResume to display the corresponding interface of the Activity and complete the cold start of the target application.
[0083] S402, the terminal device detects a second operation of the user releasing the target application icon, and if the second operation meets a preset condition, in response to the second operation, resumes calling other functions in the Activity life cycle to display the Activity corresponding interface.
[0084] The preset conditions can be set according to actual needs and the sensitivity requirements for preventing misoperation. If there are extremely high requirements for preventing misoperation, the preset conditions can be set more strictly. For example, it can be set that the second operation (i.e., the action of releasing the target application icon) must occur within a certain time window, which is immediately after the first operation (i.e., the action of pressing the target application icon), and it must also be satisfied that the reporting point when the second operation is detected is still within the display area of the target application icon, so as to exclude the possibility that the user may accidentally touch the icon while performing other operations.
[0085] It should be noted that, taking a mobile phone as an example, when a user operates a mobile phone, a series of actions from the moment the finger presses the screen of the mobile phone until the finger is completely released and leaves the screen can constitute a complete touch operation process. In this application, the second operation is the operation of releasing the target application icon for the first time after the terminal device detects that the user has pressed the target application icon for the first operation.
[0086] In some possible embodiments, the terminal device may determine whether the second operation meets the preset condition by detecting the time of the first operation and the time of the second operation. For example, if the interval between the first operation and the second operation is less than a preset time, it is determined that the second operation meets the preset condition, otherwise it is determined that the second operation does not meet the preset condition.
[0087] In some possible embodiments, the terminal device may determine whether the second operation meets the preset condition by detecting the user's line-drawing operation (the user's sliding track on the terminal device display interface) between the first operation and the second operation, that is, between the user pressing and releasing the target application icon. For example, if there are many reported points (long sliding track) during the line-drawing operation, it is determined that the second operation does not meet the preset condition, otherwise it is determined that the second operation meets the preset condition.
[0088] In some possible embodiments, the terminal device may also determine whether the second operation meets the preset condition according to the user's usage habits. For example, usually after a user normally launches an application, if he wants to launch the next application, the two application launches usually require a certain interval, and the user will not directly switch back to the desktop to select another application to launch after just launching an application.
[0089] In some possible embodiments, the application startup method further includes:
[0090] The terminal device obtains the start time of the most recently started target application other than the target application;
[0091] When the interval between the trigger time and the start time of the first operation is greater than or equal to the preset second time, the terminal device determines that the second operation meets the preset condition.
[0092] By calculating the interval between the trigger time of the user's first operation on the target application icon and the startup time of other applications recently launched by the terminal device (the display time of the Activity of other applications), and when the interval is greater than or equal to the preset second time, judging that the second operation meets the preset conditions, it is possible to avoid accidental startup of applications due to quick double-clicking or accidental touching, thereby providing users with a smoother and more accurate interactive experience.
[0093] When it is determined that the second operation meets the preset conditions, the terminal device will trigger a response based on this operation, restart other related functions in the Activity life cycle, display the Activity corresponding interface of the target application, and complete the startup of the target application. Exemplarily, the onStart function is called to display the Activity corresponding interface; the onResume function is called to enable the displayed Activity corresponding interface to be interacted with by the user.
[0094] It is understandable that in order to implement the application startup method in the embodiment of the present application, the terminal device includes hardware and / or software modules corresponding to the execution of each function. In combination with the algorithm steps of each example described in the embodiment disclosed herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application in combination with the embodiments.
[0095] Figure 5aA schematic diagram of an Activity corresponding interface provided in an embodiment of the present application. In some possible embodiments, the Activity corresponding interface of the target application may be as follows: Figure 5a As shown in the startup interface, after the target application is started, the Activity corresponding interface displayed may include the icon and program name of the target application. At the same time, in order to improve the visual effect and intuitiveness, it may also include a background image, version number, development team logo, copyright information or a simple welcome message. Taking the target application as the "shopping" application as an example, after resuming the call to other functions in the Activity life cycle, the Activity corresponding interface displayed may be as follows Figure 5a As shown, including the icon, application name and version number, the content can be displayed, but actual interaction may not be possible, and it will jump to other interactive function interfaces after a period of time. This type of activity corresponding interface helps users immediately identify the application they are launching, and can serve as a buffer to give users time to prepare to interact with the application, especially when a large amount of other data still needs to be loaded after the application is launched, which is used to hide the loading time of the application and provide a smoother user experience.
[0096] Figure 5b Another schematic diagram of the Activity corresponding interface provided in the embodiment of the present application. In some possible embodiments, the Activity corresponding interface of the target application can be as follows Figure 5b The function interface shown in the figure, after the target application is started, the displayed Activity corresponding interface may include various function controls of the target application, so that users can interact through the function controls in the Activity corresponding interface. Taking the target application as the "shopping" application as an example, after resuming the call of other functions in the Activity life cycle, the displayed Activity corresponding interface may be as follows Figure 5b As shown, it includes multiple controls such as "Favorites", "Recommendations", and "Search". Users can interact with each control to use the target application. This type of Activity corresponding interface does not require an additional startup interface to start using the application, and is more suitable for high-performance terminal devices or applications with low data requirements.
[0097] It should be noted that the Activity corresponding interface displayed after each application is started can be set by the application developer or the terminal device can be optimized and generated for each application separately. The type and style of the Activity corresponding interface are not limited here.
[0098] In some possible embodiments, if the user releases the finger or stylus on the terminal device and is not in the area corresponding to the target application icon, that is, the terminal device does not detect the second operation of the user releasing the target application icon, the Activity is destroyed.
[0099] In some possible embodiments, if the terminal device determines that the second operation does not meet the preset condition, the Activity is destroyed.
[0100] In the application startup method provided in the embodiment of the present application, when the terminal device detects the first operation of the user pressing the target application icon, it can call the onCreate function to initialize the Activity of the target application, and after the execution is completed, it suspends other functions in the Activity life cycle to avoid the incorrect display of the Activity corresponding interface; the terminal device detects the second operation of the user releasing the target application icon, and when the second operation meets the preset conditions, it resumes calling other functions in the Activity life cycle. Since the Activity has completed initialization, the terminal device can quickly display the Activity corresponding interface, complete the cold start of the target application, and improve the user experience. In addition, even if the second operation does not meet the preset conditions, since the call of other functions in the Activity life cycle is suspended after the onCreate function is executed, during the process of starting and destroying the Activity, the performance resources are less occupied, reducing the impact on other processes running in the terminal device.
[0101] The following is an explanation of the implementation process of determining whether the second operation of the user releasing the target application icon meets the preset conditions in the embodiment of the present application.
[0102] See also Figure 6 , Figure 6 Another flowchart of the application startup method provided in the embodiment of the present application is as follows: Figure 6 As shown, the method may include the following steps:
[0103] S601, the terminal device detects a first operation in which a user presses a target application icon, and in response to the first operation, starts the Activity of the target application corresponding to the target application icon, calls and executes the onCreate function in the Activity life cycle, and after the onCreate function is executed, suspends the calling of other functions in the Activity life cycle.
[0104] Among them, S601 is similar to S401 and will not be described in detail here.
[0105] S602: The terminal device detects a second operation of the user releasing the target application icon, and obtains the interval time between the second operation and the first operation.
[0106] In some possible embodiments, the preset condition includes that the interval between the second operation and the first operation is less than or equal to a preset first interval.
[0107] It should be noted that when the interval between the user pressing the target application icon (first operation) and releasing the target application icon (second operation) is different, it has different processing significance for the terminal device. For example, when the interval between the first operation and the second operation is long, that is, the interval is greater than or a certain set threshold, the terminal device can determine that the user is long pressing the target application icon, and can make a different response from the user clicking (short press, the interval is less than a certain set threshold) the target application icon, so as to enrich the user's interactive experience and improve the flexibility of control.
[0108] S603, when the interval duration is less than or equal to the preset first duration, the terminal device responds to the second operation and resumes calling other functions in the Activity life cycle to display the corresponding interface of the Activity.
[0109] It should be noted that when the interval between the first operation and the second operation is less than or equal to the preset first duration, that is, the user wants to start the target application, the terminal device determines that the second operation meets the preset conditions, and can respond to the second operation and resume calling other functions in the Activity life cycle to display the corresponding interface of the Activity. Exemplarily, the preset first duration can be 500ms or other values, which are not limited here.
[0110] When the interval between the first operation and the second operation is longer than the preset first duration, the first operation and the second operation can be judged as a long press event. At this time, a card (prompt box) can be popped up on the display interface of the terminal device to prompt the user to perform the next operation, and determine whether to continue to suspend other functions of the Activity life cycle except the onCreate function according to the user's next operation, or resume calling other functions in the Activity life cycle to start the target application, or destroy the Activity and release the resources occupied by the Activity so that other tasks or services in the terminal device system can allocate these resources. In this way, it is possible to flexibly and intelligently determine whether to start the target application and manage the life cycle of the Activity according to the user's operation intention, thereby providing a smoother user experience.
[0111] In the application startup method provided in the embodiment of the present application, whether the second operation meets the preset condition can be determined based on whether the interval between the first operation and the second operation is greater than or equal to the preset first time length, and if it is determined that the second operation meets the preset condition, other functions in the Activity life cycle are resumed to display the Activity corresponding interface. This avoids the interface being displayed when the user long presses, which affects the user experience.
[0112] Another implementation process of determining whether the second operation of releasing the target application icon by the user meets the preset conditions in the embodiment of the present application is explained below.
[0113] See also Figure 7 , Figure 7 Another flowchart of the application startup method provided in the embodiment of the present application is as follows: Figure 7 As shown, the method may include the following steps:
[0114] S701, the terminal device detects a first operation in which a user presses a target application icon, and in response to the first operation, starts the Activity of the target application corresponding to the target application icon, calls and executes the onCreate function in the Activity life cycle, and after the onCreate function is executed, suspends the calling of other functions in the Activity life cycle.
[0115] S702, the terminal device obtains touch data of the user's line-drawing operation on the terminal device after the first operation, where the touch data includes a plurality of reported points.
[0116] In some possible embodiments, after the terminal device detects a first operation in which the user presses the target application icon, the method further includes: the terminal device acquires touch data of the user's line-drawing operation on the terminal device after the first operation, the touch data including a plurality of reporting points; the terminal device determines whether the first operation is an erroneous operation according to the plurality of reporting points and a preset anti-mistaken touch strategy, wherein the preset anti-mistaken touch strategy includes determining that the first operation is an erroneous operation when the number of reporting points is greater than a preset threshold; when the first operation is an erroneous operation, the terminal device performs a destroy operation on the Activity;
[0117] The method also includes: when the first operation is an erroneous operation, the terminal device detects a second operation of the user releasing the target application icon, and determines that the second operation does not meet the preset condition.
[0118] It should be noted that the stroke operation refers to a series of actions performed by the user after performing the first operation and before the second operation. This may include keeping the finger or stylus still on the screen, or sliding on the screen. Reporting refers to the touch point information reported to the system by an input device such as a touch screen or touchpad. This information includes the location, pressure, movement trajectory, etc. of the touch point. The touch screen driver periodically detects the touch points and sends an event to the system when a touch operation is detected. In the present application, the terminal device can determine whether the first operation is an erroneous operation through the acquired touch data, that is, whether the first operation is an operation that the user intends to start the target application.
[0119] In some possible embodiments, when the user interacts with the terminal device and performs the second operation on the target application icon, the terminal device captures and records this moment. Subsequently, the terminal device can obtain the touch data generated when the user performs the line operation between the first operation and the second operation from its record.
[0120] S703: The terminal device determines whether the first operation is an erroneous operation according to the multiple reporting points and the preset anti-mis-touch strategy.
[0121] In some possible embodiments, the preset anti-mis-touch strategy includes determining that the first operation is an erroneous operation when the number of reported points is greater than a preset threshold.
[0122] It should be noted that when the user's finger or stylus remains still or moves only slightly on the target application icon, some terminal devices may choose not to report subsequent touch points whose coordinates have not changed or have changed slightly, or only generate reporting points based on a preset minimum sampling interval, so as to reduce unnecessary data redundancy. Based on this mechanism, the number of reported points between the user's first operation and the second operation can be used to evaluate whether the user's finger or stylus has moved significantly in the display area of the target application icon (that is, whether the number of reported points exceeds the preset threshold). When the number of reported points is greater than the preset threshold, it is judged that the user did not intend to start the target application, that is, the first operation is judged to be an erroneous operation. Among them, the preset threshold can be determined based on the interval between the first operation and the second operation. The longer the interval, the larger the preset threshold.
[0123] In some possible embodiments, the touch data also includes multiple timestamps corresponding to multiple reporting points or a sequential relationship between multiple reporting points. The preset anti-mistouch strategy also includes determining the number of sliding events (move events) between the first operation and the second operation based on the multiple reporting points, and judging that the first operation is an erroneous operation when the number of sliding events is greater than a preset event threshold.
[0124] It should be noted that, through the multiple reporting points corresponding to the multiple reporting points or the order between the multiple reporting points, the previous reporting point and the next reporting point of any reporting point among the multiple reporting points can be determined. Furthermore, the coordinate difference between any two adjacent reporting points, or between two reporting points separated by a specified number of reporting points, can be calculated. When the coordinate difference is greater than a preset coordinate threshold, it is determined that the two reporting points correspond to a sliding event. When the number of sliding events is greater than or equal to the preset event threshold, it is determined that the user's finger or stylus has moved significantly on the screen between the first operation and the second operation, and the first operation is judged to be an erroneous operation.
[0125] Exemplarily, the preset event threshold can be set to 3. When the number of sliding events is determined to be 2 according to the reporting point of the system layer input report of the terminal device, it is determined that the first operation is not an erroneous operation; when the number of sliding events is determined to be 5, it is determined that the first operation is an erroneous operation.
[0126] In some possible embodiments, the preset anti-mis-touch strategy also includes determining that the first operation is an erroneous operation if the coordinates corresponding to any of the multiple reported points are not located in the target application icon corresponding area. When the user performs the first operation, if the trajectory of the finger or stylus moving on the screen has deviated from the target application icon corresponding area, even if the finger or stylus is in the target application icon corresponding area when the user releases the finger, the terminal device will determine that the first operation is an erroneous operation to avoid the target application being started by mistake.
[0127] In S703, if it is determined that the first operation is an erroneous operation, the process proceeds to S704, and if it is determined that the first operation is not an erroneous operation, the process proceeds to S705.
[0128] S704: The terminal device determines that the second operation does not meet the preset condition and destroys the Activity.
[0129] When the terminal device determines that the first operation is an erroneous operation and the second operation does not meet the preset conditions, it will not resume calling other functions in the Activity life cycle, but will destroy the Activity to release the resources occupied by the Activity and avoid unnecessary resource consumption.
[0130] It should be noted that the Activity can be destroyed by calling the finish function. When the finish function is called, the Activity destruction process will be triggered, including executing the onDestroy function and releasing all resources associated with the Activity, such as the view hierarchy, memory, and any held system service connections.
[0131] S705, the terminal device determines that the second operation meets the preset condition, and in response to the second operation, resumes calling other functions in the Activity life cycle to display the corresponding interface of the Activity.
[0132] When the terminal device determines that the first operation is not an erroneous operation and that the second operation meets the preset conditions, the terminal device can respond to the second operation and resume calling other functions in the Activity life cycle to display the corresponding interface of the Activity.
[0133] In the application startup method provided in the embodiment of the present application, the touch data of the user's line operation on the terminal device between the first operation and the second operation can be obtained to determine whether the first operation is an erroneous operation, and then determine whether to perform the subsequent steps of starting the target application or destroy the Activity of the target application. It should be noted that different anti-mistouch strategies or different preset conditions for detecting the second operation can be used in combination to improve the sensitivity of determining whether to start the target application.
[0134] The following explains how to start a target application in an embodiment of the present application when a long press is performed on the target application (the interval between the first operation and the second operation is greater than a set threshold).
[0135] See also Figure 8 , Figure 8 A flow chart of a method for starting an application program provided in an embodiment of the present application when the interval between the second operation and the first operation is greater than a preset third interval, such as Figure 8 As shown, the following steps may be included:
[0136] S801, the terminal device detects a first operation in which a user presses a target application icon, and in response to the first operation, starts the Activity of the target application corresponding to the target application icon, calls and executes the onCreate function in the Activity life cycle, and after the onCreate function is executed, suspends the calling of other functions in the Activity life cycle.
[0137] S802: The terminal device detects a second operation of the user releasing the target application icon, and obtains the interval time between the second operation and the first operation.
[0138] S803, the terminal device determines whether the interval duration is greater than a preset third duration.
[0139] In some possible embodiments, when the interval between the first operation and the second operation is longer than the preset third time period, the first operation and the second operation can be determined as a long press event together, and S805 is performed, otherwise S804 is performed. Exemplarily, the preset third time period can be set to 500ms or other values, which are not limited here.
[0140] S804, the terminal device determines that the second operation meets the preset condition, and in response to the second operation, resumes calling other functions in the Activity life cycle to display the corresponding interface of the Activity.
[0141] When the interval between the first operation and the second operation is less than or equal to the preset third time period, the terminal device determines that the second operation meets the preset condition, and in response to the second operation, resumes calling other functions in the Activity life cycle to display the corresponding interface of the Activity.
[0142] S805: The terminal device determines that the second operation does not meet the preset condition, and displays a card corresponding to the target application, wherein the card includes a startup control corresponding to the target application.
[0143] When the interval between the first operation and the second operation is greater than the preset third time period, the terminal device determines that the second operation does not meet the preset conditions and displays the card corresponding to the target application. At this time, other functions of the Activity life cycle of the target application except the onCreate function are still in a paused state. The terminal device will not display the corresponding interface of the Activity, but will display the card corresponding to the target application.
[0144] It should be noted that a card refers to an interactive interface component (prompt box) that appears on the screen after a user long presses an application icon on a terminal device such as a smartphone or tablet. Application cards can be used to quickly access application functions. For example, users can directly start specific functions or manage applications (such as uninstalling) through application cards. The purpose is to allow users to perform common operations in a faster and more direct way.
[0145] See also Fig. 9 , Fig. 9 The interface diagram of the display target application corresponding card provided by the embodiment of the present application. Fig. 9 In the illustrated embodiment, if the interval between a first operation in which the user presses the icon 4 displayed on the terminal device and a second operation in which the user releases the icon 4 is greater than a preset third interval, the terminal device determines that the second operation does not meet the preset conditions and displays a card corresponding to the application 4 corresponding to the icon 4. Fig. 9In the example, the target application icon 91 is icon 4, and the card 92 includes, in addition to the start control 93, a function control, a share control, a detail control, and an uninstall control corresponding to function 1. The user can perform touch operations on different controls in the card 92 to implement different shortcut control methods.
[0146] S806, the terminal device detects a third operation of the user on the target application icon or the startup control, and in response to the third operation, resumes calling other functions in the Activity life cycle to display the corresponding interface of the Activity.
[0147] When the terminal device displays the card corresponding to the target application, the user can perform a third operation on the target application icon or the startup control in the card so that the terminal device can respond to the third operation and resume calling other functions in the Activity life cycle to display the corresponding interface of the Activity.
[0148] For example, in Fig. 9 In the illustrated embodiment, the user can start the target application program by performing a third operation on the target application icon 91 or the start control 93 in the card 92 .
[0149] It should be noted that the user's third operation on the target application icon or startup control can be an operation in which the user presses the target application icon or startup control, or it can be a complete click or long press operation in which the user presses and releases the target application icon or startup control, which is not limited here.
[0150] Because, when the user presses the target application icon for the first operation, the terminal device has completed the onCreate function, therefore, when the terminal device detects the user's third operation on the target application icon or the startup control, it can directly resume calling other functions in the Activity life cycle in response to the third operation, thereby reducing the waiting time for displaying the corresponding interface of the Activity of the target application and improving the user experience.
[0151] In some possible embodiments, since a number of preparatory tasks including process creation have been completed during the process of initializing the Activity of the target application, when the user clicks on the function control in the card, the time required to display the corresponding function interface can be significantly shortened.
[0152] In some possible embodiments, after the terminal device displays a card corresponding to the target application, the application startup method further includes:
[0153] The terminal device detects a fourth operation of the user on the target area, and in response to the fourth operation, destroys the Activity and ends the display of the card, wherein the target area includes the interface area outside the target application icon and the card in the terminal interface of the terminal device.
[0154] It should be noted that if the terminal device detects the fourth operation of the user on the target area, it will end the display of the card of the target application and then destroy the Activity to release all resources occupied by the Activity and the target application. The fourth operation includes pressing the target area, or pressing and then releasing the target area, which is not limited here. For example, Fig. 9 As shown, the target area may be the entire interface area in the display area of the terminal device except the target application icon 91 and the card 92 .
[0155] In some possible embodiments, the terminal device performs a destroy operation on the Activity in response to the fourth operation, including:
[0156] When the terminal device detects the fourth operation, it starts the destruction timer;
[0157] When the timing duration of the destruction timer is greater than or equal to the preset fourth duration and the terminal device does not detect a triggering operation on the target application icon, the Activity is destroyed.
[0158] It should be noted that after the user performs the fourth operation on the target area, the terminal device can provide a buffer period for destroying the Activity by starting the destruction timer, so as to give the user a certain amount of time to regret or adjust before confirming that the user does not start the target application. During this buffer period, the terminal device will continue to monitor the timing of the destruction timer, and at the same time check whether any triggering operation has occurred on the target application icon. If the user interacts with the target application icon again within this time period (that is, before the timing duration reaches the preset fourth duration), it means that the user still needs to start the target application. The terminal device can immediately resume calling other functions in the Activity life cycle to display the corresponding interface of the Activity. Otherwise, when the timing duration is greater than or equal to the preset fourth duration, the relevant resources are automatically released.
[0159] In the application startup method provided in the embodiment of the present application, the terminal device can detect the interval between the user's first operation and the second operation. When the interval exceeds a preset threshold, the card of the target application is displayed to provide the user with a convenient quick access function and improve the startup speed of the target application. At the same time, possible misoperations of the user are taken into account. After the card is displayed, if it is detected that the user performs a fourth operation on the target application icon and the target area outside the card, a destruction timer will be started to provide the user with a buffer period for regret or adjustment. When the timer reaches the preset time and no re-triggering of the target application icon is detected, the Activity is automatically destroyed and resources are released to ensure the effective use of system resources.
[0160] It should be understood that, although the steps in the above-mentioned flowcharts are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a part of the steps in the above-mentioned flowcharts may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these sub-steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the sub-steps or stages of other steps.
[0161] Based on the foregoing embodiments, the embodiments of the present application provide an application startup device, which includes the modules included and the units included in the modules, and can be implemented by a processor; of course, it can also be implemented by a specific logic circuit; in the implementation process, the processor can be a central processing unit (CPU), a microprocessor (MPU), a digital signal processor (DSP) or a field programmable gate array (FPGA), etc.
[0162] Fig.10 A schematic diagram of the structure of the application startup device provided in the embodiment of the present application, such as Fig.10 As shown, the application startup device includes a detection module 1001, a first response module 1002 and a second response module 1003, wherein:
[0163] A detection module 1001 is used to detect a first operation of a user pressing a target application icon;
[0164] A first response module 1002 is used to start the activity of the target application corresponding to the target application icon in response to the first operation, call and execute the onCreate function in the life cycle of the activity, and suspend the calling of other functions in the life cycle of the activity after the onCreate function is executed;
[0165] The detection module 1001 is further used to detect a second operation of the user releasing the target application icon;
[0166] The second response module 1003 is used to resume calling other functions in the life cycle of the Activity in response to the second operation when the second operation meets a preset condition, so as to display the corresponding interface of the Activity.
[0167] In some possible embodiments, the preset condition includes that the interval between the second operation and the first operation is less than or equal to a preset first duration, and the second response module 1003 is further used to obtain the interval between the second operation and the first operation; when the interval is less than or equal to the preset first duration, in response to the second operation, resume calling other functions in the Activity life cycle.
[0168] In some possible embodiments, the application startup device also includes a false touch detection module, which is used to obtain touch data of the user's stroke operation on the terminal device after the first operation, and the touch data includes multiple reporting points; based on the multiple reporting points and a preset anti-false touch strategy, determine whether the first operation is an erroneous operation, wherein the preset anti-false touch strategy includes determining that the first operation is an erroneous operation when the number of reporting points is greater than a preset threshold; if the first operation is an erroneous operation, destroy the Activity; the second response module 1003 is also used to detect the second operation of the user releasing the target application icon when the first operation is an erroneous operation, and determine that the second operation does not meet the preset conditions.
[0169] In some possible embodiments, the false touch detection module is also used to obtain the startup time of the most recently started target application other than the target application; when the interval between the trigger time of the first operation and the startup time is greater than or equal to a preset second time, it is judged that the second operation meets the preset condition.
[0170] In some possible embodiments, the second response module 1003 is also used to obtain the interval duration between the second operation and the first operation; when the interval duration is greater than a preset third duration, it is determined that the second operation does not meet the preset condition, and the card corresponding to the target application is displayed, wherein the card includes a startup control corresponding to the target application.
[0171] In some possible embodiments, the second response module 1003 is further used to detect a third operation of the user on the target application icon or the startup control, and in response to the third operation, resume calling other functions in the Activity life cycle to display the corresponding interface of the Activity.
[0172] In some possible embodiments, the second response module 1003 is further used to detect a fourth operation of the user on the target area, and in response to the fourth operation, destroy the Activity and end the display of the card, wherein the target area includes the target application icon in the terminal interface of the terminal device and the interface area outside the card.
[0173] In some possible embodiments, the second response module 1003 is further used to start a destruction timer when the fourth operation is detected; when the timing duration of the destruction timer is greater than or equal to the preset fourth duration and no triggering operation on the target application icon is detected, the Activity is destroyed.
[0174] The description of the above device embodiment is similar to the description of the above method embodiment, and has similar beneficial effects as the method embodiment. For technical details not disclosed in the device embodiment of the present application, please refer to the description of the method embodiment of the present application for understanding.
[0175] It should be noted that in the embodiments of this application Fig.10 The division of modules by the application startup device shown is schematic and is only a logical functional division. There may be other division methods in actual implementation. In addition, each functional unit in each embodiment of the present application may be integrated into a processing unit, or may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of a software functional unit. It may also be implemented in the form of a combination of software and hardware.
[0176] It should be noted that in the embodiment of the present application, if the above method is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the embodiment of the present application can be essentially or partly embodied in the form of a software product that contributes to the relevant technology. The computer software product is stored in a storage medium, including several instructions to enable an electronic device to execute all or part of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a U disk, a mobile hard disk, a read-only memory (ROM), a magnetic disk or an optical disk. In this way, the embodiment of the present application is not limited to any specific combination of hardware and software.
[0177] The embodiment of the present application provides a computer device, which may be a server, and its internal structure diagram may be as follows: Fig.11 As shown. The computer device includes a processor, a memory and a network interface connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, the above method is implemented.
[0178] An embodiment of the present application provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps in the method provided in the above embodiment are implemented.
[0179] An embodiment of the present application provides a computer program product including instructions, which, when executed on a computer, enables the computer to execute the steps of the method provided in the above method embodiment.
[0180] Those skilled in the art will understand that Fig.11 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0181] In one embodiment, the application launching device provided by the present application can be implemented in the form of a computer program. The computer program can be Fig.11The computer device shown in the figure is run. The memory of the computer device can store various program modules constituting the above-mentioned device. The computer program composed of various program modules enables the processor to execute the steps in the method of each embodiment of the present application described in this specification.
[0182] It should be noted here that the description of the above storage medium and device embodiments is similar to the description of the above method embodiments, and has similar beneficial effects as the method embodiments. For technical details not disclosed in the storage medium, storage medium and device embodiments of this application, please refer to the description of the method embodiments of this application for understanding.
[0183] It should be understood that "one embodiment" or "an embodiment" or "some embodiments" mentioned throughout the specification means that specific features, structures or characteristics related to the embodiment are included in at least one embodiment of the present application. Therefore, "in one embodiment" or "in one embodiment" or "in some embodiments" appearing throughout the specification may not necessarily refer to the same embodiment. In addition, these specific features, structures or characteristics can be combined in one or more embodiments in any suitable manner. It should be understood that in various embodiments of the present application, the size of the sequence number of the above-mentioned processes does not mean the order of execution, and the execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present application. The above-mentioned sequence numbers of the embodiments of the present application are only for description and do not represent the advantages and disadvantages of the embodiments. The above description of each embodiment tends to emphasize the differences between the various embodiments, and the same or similarities can be referenced to each other. For the sake of brevity, this article will not repeat them.
[0184] The term "and / or" in this article is only a description of the association relationship of associated objects, indicating that there may be three relationships. For example, object A and / or object B can represent three situations: object A exists alone, object A and object B exist at the same time, and object B exists alone.
[0185] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.
[0186] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The embodiments described above are only schematic. For example, the division of the modules is only a logical function division. There may be other division methods in actual implementation, such as: multiple modules or components can be combined, or can be integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the components shown or discussed can be through some interfaces, and the indirect coupling or communication connection of devices or modules can be electrical, mechanical or other forms.
[0187] The modules described above as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical modules; they may be located in one place or distributed on multiple network units; some or all of the modules may be selected according to actual needs to achieve the purpose of the present embodiment.
[0188] In addition, all functional modules in the embodiments of the present application may be integrated into one processing unit, or each module may be a separate unit, or two or more modules may be integrated into one unit; the above-mentioned integrated modules may be implemented in the form of hardware or in the form of hardware plus software functional units.
[0189] A person skilled in the art can understand that all or part of the steps of implementing the above method embodiment can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above method embodiment; and the aforementioned storage medium includes: mobile storage devices, read-only memories (ROM), magnetic disks or optical disks, etc., various media that can store program codes.
[0190] Alternatively, if the above-mentioned integrated unit of the present application is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application can essentially or in other words, the part that contributes to the relevant technology can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for enabling an electronic device to execute all or part of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, ROMs, magnetic disks, or optical disks.
[0191] The methods disclosed in several method embodiments provided in this application can be arbitrarily combined without conflict to obtain new method embodiments.
[0192] The features disclosed in several product embodiments provided in this application can be arbitrarily combined without conflict to obtain new product embodiments.
[0193] The features disclosed in several method or device embodiments provided in this application can be arbitrarily combined without conflict to obtain new method embodiments or device embodiments.
[0194] The above is only an implementation method of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A method for starting an application, characterized in that: Applied to a terminal device, the method comprises: The terminal device detects a first operation of a user pressing a target application icon, and in response to the first operation, starts an Activity of a target application corresponding to the target application icon, calls and executes an onCreate function in the life cycle of the Activity, and after the onCreate function is executed, suspends the calling of other functions in the life cycle of the Activity; The terminal device detects a second operation of the user releasing the target application icon, and when the second operation meets a preset condition, in response to the second operation, resumes calling other functions in the Activity life cycle to display the corresponding interface of the Activity.
2. The method according to claim 1, characterized in that: The preset condition includes that the interval between the second operation and the first operation is less than or equal to a preset first duration, and when the second operation meets the preset condition, the terminal device responds to the second operation and resumes calling other functions in the Activity life cycle, including: The terminal device obtains the interval between the second operation and the first operation; When the interval duration is less than or equal to a preset first duration, the terminal device resumes calling other functions in the Activity life cycle in response to the second operation.
3. The method according to claim 1 or 2, characterized in that: After the terminal device detects a first operation in which the user presses the target application icon, the method further includes: The terminal device acquires touch data of the line drawing operation of the user on the terminal device after the first operation, wherein the touch data includes a plurality of reporting points; The terminal device determines whether the first operation is an erroneous operation according to the multiple reporting points and a preset anti-mistaken touch strategy, wherein the preset anti-mistaken touch strategy includes determining that the first operation is an erroneous operation when the number of reporting points is greater than a preset threshold; In the case that the first operation is an erroneous operation, the terminal device destroys the Activity; The method further comprises: When the first operation is an erroneous operation, the terminal device detects the second operation of the user releasing the target application icon, and determines that the second operation does not meet the preset condition.
4. The method according to claim 1, characterized in that The method further comprises: The terminal device obtains the start time of the most recently started target application other than the target application; When the interval between the triggering time of the first operation and the start time is greater than or equal to a preset second time, the terminal device determines that the second operation meets the preset condition.
5. The method according to claim 1, characterized in that After the terminal device detects a second operation in which the user releases the target application icon, the method further includes: The terminal device obtains the interval between the second operation and the first operation; When the interval duration is greater than a preset third duration, the terminal device determines that the second operation does not meet the preset condition, and displays a card corresponding to the target application, wherein the card includes a startup control corresponding to the target application.
6. The method according to claim 5, characterized in that After the terminal device displays the card corresponding to the target application, the method further includes: The terminal device detects a third operation performed by the user on the target application icon or the startup control, and in response to the third operation, resumes calling other functions in the life cycle of the Activity to display an interface corresponding to the Activity.
7. The method according to claim 5, characterized in that After the terminal device displays the card corresponding to the target application, the method further includes: The terminal device detects a fourth operation of the user on a target area, and in response to the fourth operation, destroys the Activity and ends display of the card, wherein the target area includes the target application icon in a terminal interface of the terminal device and an interface area outside the card.
8. The method according to claim 7, characterized in that The terminal device performs a destroy operation on the Activity in response to the fourth operation, including: When the terminal device detects the fourth operation, starting a destruction timer; When the timing duration of the destruction timer is greater than or equal to the preset fourth duration and the terminal device does not detect a triggering operation on the target application icon, the Activity is destroyed.
9. An application startup device, characterized in that: include: A detection module, used to detect a first operation of a user pressing a target application icon; a first response module, configured to, in response to the first operation, start the Activity of the target application corresponding to the target application icon, call and execute the onCreate function in the life cycle of the Activity, and suspend the calling of other functions in the life cycle of the Activity after the execution of the onCreate function is completed; The detection module is further used to detect a second operation of the user releasing the target application icon; The second response module is used to respond to the second operation and resume calling other functions in the life cycle of the Activity to display the corresponding interface of the Activity when the second operation meets the preset conditions.
10. A computer device comprising a memory and a processor, wherein the memory stores a computer program that can be run on the processor, characterized in that: When the processor executes the program, the steps of the method according to any one of claims 1 to 8 are implemented.
11. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 8 is implemented.