Disclosure of Invention
In order to solve the defects in the prior art, the invention aims to provide a method for realizing simultaneous operation of double APPs on a double-screen intelligent terminal, which can autonomously control the APPs of a system to be presented on a main screen or an auxiliary screen and can dynamically switch display areas according to scene requirements.
In order to achieve the above object, the method for implementing simultaneous operation of dual APPs on a dual-screen intelligent terminal provided by the present invention comprises the following steps:
1) starting recentsActivity, selecting TaskView which is required to be displayed on the auxiliary screen, and moving the TaskView to a designated area;
2) starting a task in DockedMode, and setting a STACK ID as a DOCKD _ STACK _ ID so that the size of the current auxiliary screen is the size of a STACK;
3) starting Activity from the recent task list and creating a DOCKED STACK;
4) starting the activity, and displaying the activity on the auxiliary screen;
5) selecting an APP to be realized on a main screen, starting Activity, and displaying the Activity on the main screen;
6) and switching the APP between the main screen and the auxiliary screen.
Further, before the step 1), a step of configuring a resizableActivity attribute of a configuration file of an Android system as true to support simultaneous operation of the two APPs is further included.
Further, in the step 2), when the stack is created in the sub-screen, the size of the current sub-screen is set to the stack size in the tasksack.
Further, the step 3) includes,
when the stack is created on the auxiliary screen, setting the displayId of the screen in an activityStackSupervisor.
Java file, set it to have the ability to get focus after the secondary creates the stack.
Further, the step 4) includes, when the activity is started, setting an activity state.
The method for realizing simultaneous operation of the double APPs on the double-screen intelligent terminal enables the system to simultaneously operate the two APPs and dynamically switch between double screens on the premise of complying with the application starting and displaying framework of the system standard. Modification of a WindowManagerservice class and a TaskStack class in a window management mechanism and an ActivityStackSupervisor class and an ActivityStack of an Activity management mechanism can greatly improve the presentation effect and the user experience of the APP on two screens. Meanwhile, for third-party APP in the application market, the dual APP adaptation can be realized only by setting android, resizableActivity as true in the android Manifest file, and the customization cost is extremely low. In addition, the scheme belongs to modification of a pure software layer of a system Framework (Framework), so that the difference of bottom hardware does not need to be considered, and certain universality is achieved.
The invention completely follows the system standard application to start the display frame, ensures the stability of the system in operation, and enables the auxiliary screen to obtain the same APP display function as the main screen on the premise of not increasing any system resource consumption. Meanwhile, for third-party APP on the application market, the realization of double APP adaptation only needs to increase corresponding attributes, and the customization cost is extremely low.
Additional features and advantages of the invention will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention.
Detailed Description
The preferred embodiments of the present invention will be described in conjunction with the accompanying drawings, and it will be understood that they are described herein for the purpose of illustration and explanation and not limitation.
Fig. 1 is a flowchart of a method for implementing simultaneous operation of dual APPs on a dual-screen intelligent terminal according to the present invention, and the method for implementing simultaneous operation of dual APPs on a dual-screen intelligent terminal according to the present invention will be described in detail with reference to fig. 1.
Firstly, in step 101, configuring a resizableActivity attribute of an Android Manifest configuration file of an Android system as true, so that the Android system supports simultaneous operation of two APPs.
At step 102, RecentrsActivity is initiated and the TaskView desired to be displayed on the secondary screen is selected.
In step 103, judging whether the Android system supports simultaneous operation of two APPs, if not, prompting the user, and ending; otherwise, the next step is carried out.
In step 104, the TaskView is moved to a designated area, in the step, the Android system prompts a user to move the selected TaskView to the designated area, and the user drags the TaskView to the designated area according to the prompt.
In step 105, the Android system receives an instruction of the user, and starts a task in dockadmode (starttaskindockadmode).
In step 106, the STACK ID is set to dock _ STACK _ ID so that the size of the current sub-screen is the size of the STACK.
In the Android system, a window manager not only manages windows, but also interacts with an Activity manager, and when a stack is created in the secondary screen, the window manager is required to set the size of the current secondary screen to be the size of the stack. Fig. 2 is a schematic diagram of codes added to a tasksack.java file according to the present invention, and as shown in fig. 2, the following codes are added to the tasksack.java file, where the main modified content of the codes is to determine whether the tasksack is in a dual APP mode at this time, and if the tasksack is in the dual APP mode and is to be displayed on a secondary screen, the size of a current secondary screen may be set to be the size of stack.
When setting the stack size of activity displayed on the main screen, it is set to the size of the main screen.
At step 107, Activity is initiated from the recent tasks list (records) and a DOCKED STACK is created. When the dock STACK is created, the display id of the screen is reset, and the APP is displayed on the secondary screen.
The Android platform designs a stacking mechanism for managing the Activity, and the aim of the stacking mechanism is to acquire or create a corresponding stack for the application when the application is started, and the APP is created by default on a main screen and then displayed on the main screen. By defining the getStackInEpd function instead of the standard get stack interface, the screen displayId can be reset when the stack is created. Fig. 3 is a schematic diagram of adding codes in an activtystackmultivisor.java file according to the present invention, and as shown in fig. 3, the codes are added in the activtystackmultivisor.java file, the codes first obtain the number of devices, directly obtain all the stacks in the secondary screen if there is a secondary screen, directly return the stacks that need to be created if the stacks already exist in the secondary screen, or call createStackOnDisplay to specify that the stacks are created on the secondary screen and return, so that the APP is displayed on the secondary screen.
Since only the stack of the main screen has the ability to get focus by default, it needs to have the ability to get focus after the stack is created on the sub-screen. Fig. 4 is a schematic diagram of adding code to an activtystack.java file according to the present invention, and as shown in fig. 4, code is added to the activtystack.java file, which mainly modifies the content to be an increase judgment condition, and when the stack id is in the dual APP mode and the APP is displayed on the secondary screen, the stack also has the capability of obtaining focus.
In step 108, the activity is started, the activity is displayed on the sub-screen, and the APP selected by the user is operated on the sub-screen.
Since the activities started by the Android default from the APP are all displayed on the main screen, it is common to start multiple activities inside the application first, so in this step, the application needs to be adapted. When the Activity is started in the application, only the stack id of the current APP stored in the intent needing the Activity is needed to be obtained, the frame layer obtains information, and the Activity is set in the stack of the auxiliary screen. Fig. 5 is a schematic diagram of adding codes to an actitystate. The code is called when starting new activity, a target stack is set for the new activity, and if the new activity is started from the auxiliary screen and the system is in a double APP mode at the moment, the auxiliary screen stack is assigned to the target stack again.
At step 109, the APP displayed on the home screen is selected.
At step 110, Activity is started, and the Activity is displayed on the main screen, so that the APP selected by the user is operated on the main screen.
The APP is switched between the primary and secondary screens at step 111. If the switching of the APPs between the main screen and the auxiliary screen is to be realized, only one APP is selected to be displayed on the auxiliary screen, the other APP is selected to be displayed on the main screen, then the APP displayed on the main screen before is selected to be displayed on the auxiliary screen by exiting from the double APP mode, and the APP displayed on the auxiliary screen before is displayed on the main screen, so that the switching of the APPs between the main screen and the auxiliary screen can be easily realized.
The method for realizing simultaneous operation of the double APPs on the double-screen intelligent terminal enables the system to simultaneously operate the two APPs and dynamically switch between double screens on the premise of complying with the application starting and displaying framework of the system standard. Modification of a WindowManagerservice class and a TaskStack class in a window management mechanism and an ActivityStackSupervisor class and an ActivityStack of an Activity management mechanism can greatly improve the presentation effect and the user experience of the APP on two screens. Meanwhile, for third-party APP in the application market, the dual APP adaptation can be realized only by setting android, resizableActivity as true in the android Manifest file, and the customization cost is extremely low.
The method for realizing simultaneous operation of the double APPs on the double-screen intelligent terminal can be applied to the double-screen intelligent terminal of any android system, wherein the double-screen intelligent terminal of the android system is not limited to a double-screen smart phone, a tablet computer and the like.
The method for realizing the simultaneous operation of the double APPs on the double-screen intelligent terminal fully considers the following aspects during design:
on the first hand, since the activity management framework only supports the ability of apps to be displayed on the default home screen, special handling must be used to enable their display on different screens.
In a second aspect, a window management service (windowmanager service) of the Android system displays on different screens according to the APP, and the size of the APP displayed on the screens is adapted according to the screens. The influence of the special treatment on the effect of the auxiliary screen display APP needs to be comprehensively evaluated, and then appropriate shielding and modification are carried out, and the operation stability is fully considered.
In a third aspect, since the activities started from the APPs by the Android default are all displayed on the main screen, the activity started from the APP displayed on the sub-screen is still displayed on the main screen, and the activity started from the sub-screen needs to be processed.
In the fourth aspect, the application start process, the display process are modified, and the dual APPs switch between the two screens, so that the stability of the system needs to be fully considered.
Those of ordinary skill in the art will understand that: although the present invention has been described in detail with reference to the foregoing embodiments, it will be apparent to those skilled in the art that changes may be made in the embodiments and/or equivalents thereof without departing from the spirit and scope of the invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.