WO2016150325A1 - Application screen-splitting running method and device - Google Patents

Application screen-splitting running method and device Download PDF

Info

Publication number
WO2016150325A1
WO2016150325A1 PCT/CN2016/076567 CN2016076567W WO2016150325A1 WO 2016150325 A1 WO2016150325 A1 WO 2016150325A1 CN 2016076567 W CN2016076567 W CN 2016076567W WO 2016150325 A1 WO2016150325 A1 WO 2016150325A1
Authority
WO
WIPO (PCT)
Prior art keywords
split screen
application
page
mark
split
Prior art date
Application number
PCT/CN2016/076567
Other languages
French (fr)
Chinese (zh)
Inventor
颜伟民
盛春冬
Original Assignee
阿里巴巴集团控股有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 阿里巴巴集团控股有限公司 filed Critical 阿里巴巴集团控股有限公司
Publication of WO2016150325A1 publication Critical patent/WO2016150325A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/14Digital output to display device ; Cooperation and interconnection of the display device with other functional units

Definitions

  • the present application relates to the field of software technologies, and in particular, to a method and an apparatus for split screen operation applications.
  • the architecture of electronic devices such as mobile phones and tablet computers generally includes: hardware, operating system, framework layer, and application layer.
  • the framework layer is mainly responsible for receiving user input events, processing, and feeding back the results of the processing to the user in the form of text, images, sounds, vibrations, and the like.
  • existing framework layers typically use the same stack to manage data for all applications, making it difficult to distinguish between different split screens, so on the same screen Only one application can get focus, receive user input events, and interact with the user; while other applications run in the background and cannot interact with the user.
  • the prior art has some split screen technical solutions, mainly by modifying the data structure of the framework layer, and changing the data structure originally using the same stack for data management to the data structure for managing different split screen data by using different stacks, so that To achieve multi-tasking multi-window operation in the same screen.
  • aspects of the present application provide a method and apparatus for running a split screen application, which is used to implement a split screen running application without modifying the data structure of the framework layer.
  • An aspect of the present application provides a method for running a split screen application, including:
  • the application is run on a split screen according to the split screen mark.
  • an apparatus for operating a split screen including:
  • a receiving module configured to receive a split screen instruction for instructing the split screen to run the application
  • a marking module configured to set a split screen mark for the application according to the split screen instruction
  • a split screen module configured to run the application in a split screen according to the split screen mark.
  • a split screen instruction for instructing a split screen running application is received, and according to the split screen instruction, a split screen mark is set for the application, and the application is run by the split screen according to the split screen mark. Since the application that needs to be split screen can be marked by the split screen mark, the data structure of the stack layer change stack can be modified, and the purpose of running the application on the split screen can be achieved.
  • FIG. 1 is a schematic flowchart of a method for running a split screen application according to an embodiment of the present application
  • FIG. 2 is a schematic diagram of a sidebar according to an embodiment of the present application.
  • FIG. 3 is a schematic diagram of a split screen preview interface according to an embodiment of the present application.
  • FIG. 4 is a schematic diagram of a data structure of an AMS according to an embodiment of the present application.
  • FIG. 5 is a schematic diagram of a data structure of a WMS according to an embodiment of the present application.
  • Figure 6a is an overall UML diagram provided by an embodiment of the present application.
  • 6b is a schematic flowchart of a split screen running application implemented by using a UML diagram according to an embodiment of the present disclosure
  • FIG. 7 is a schematic structural diagram of an apparatus for running a split screen according to an embodiment of the present application.
  • FIG. 1 is a schematic flowchart diagram of a method for running a split screen application according to an embodiment of the present application.
  • the method can be performed by the framework layer, but is not limited thereto. As shown in Figure 1, the method includes:
  • a split screen command may be issued to instruct the split screen to run the application. This embodiment does not limit the manner in which the split screen command is issued.
  • a split screen launch entry can be provided to the user for the user to issue a launch command for launching the application, and the launch command issued by the split screen launch entry actually instructs the split screen to run the application.
  • the above-mentioned split screen instruction may specifically be a start command issued by the user through the split screen start entry for starting the application.
  • the above-mentioned split-screen boot entry can have various implementations, such as a sidebar application set on the screen.
  • the left part of the screen shown in FIG. 2 is a sidebar in which icons of various applications supporting split screen operation, such as icons of applications such as notes, videos, albums, information, and browsers, are preset in advance.
  • icons of various applications supporting split screen operation such as icons of applications such as notes, videos, albums, information, and browsers, are preset in advance.
  • the user can issue a start command for instructing the split screen to run the application by dragging an application's icon onto the home screen (the right portion in FIG. 2).
  • the user can also operate an icon of an application in the sidebar by clicking, touching, hovering, etc., thereby implementing a startup instruction for instructing the split screen to run the application through the sidebar.
  • the split screen startup portal may be a split screen preview interface
  • the split screen preview interface may be one or more.
  • the two solid line boxes on the main screen are split screen preview interfaces.
  • the user can call up or hide the split screen preview interface by long pressing the Home button, or the user can press or hold the power button or volume adjustment button to call up or hide the split screen preview interface.
  • the long press of various buttons can be distinguished from the existing long press operation by long press time.
  • the user can drag an icon of an application to the split screen preview interface, so that a startup instruction for instructing the split screen to run the application is sent through the split screen preview interface.
  • the user can click on the add symbol on the split screen preview interface, such as “+”, to add an application to the split screen preview interface, thereby enabling the launch of the application to be indicated by the split screen preview interface for instructing the split screen to run the application. instruction.
  • API application program interface
  • context.startActivity is used to start a page (Activity).
  • the framework layer can set a split screen mark for the application that needs to be split screen according to the split screen instruction.
  • the split screen mark can identify that the application needs to be split screen, and on the other hand, can be combined with other Split screens are distinguished.
  • the framework layer is mainly responsible for interacting with the user and is responsible for processing the user interface, the framework layer sets the split screen markup for the application, which is actually setting the split screen mark for the data of the application layer in the framework layer, so that it can be understood
  • the application needs to be split screen and the split screen corresponding to the application can be distinguished from other split screens.
  • the framework layer manages the application through a task list (TaskRecord). Based on this, the framework layer sets the split screen markup for the application according to the split screen instruction, including: according to the split screen instruction, in the application program A split screen mark is set in the task list, and the task list corresponds to a page that the application needs to display on a split screen. That is, through the task list, it is possible to determine the page that the application needs to display in a split screen.
  • a task list can store an application's page record (ActivityRecord).
  • ActivityRecord also has only the framework layer, which is used to store the basic information of the page that the application needs to display on a split screen.
  • the basic information of the page generally includes: the name of the page, the identifier of the application to which the page belongs, and the like.
  • the AMS includes a page stack manager (ActivityStackSuperVior), and the ActivityStackSuperVior is managed by the page stack (ActivityStack).
  • ActivityStackSuperVior the ActivityStackSuperVior is managed by the page stack (ActivityStack).
  • TaskRecord each TaskRecord includes multiple ActivityRecord, that is, each ActivityRecord belongs to a TaskRecord, each ActivityRecord is responsible for managing an application's page (Activity), that is, the application's internal Activity has an ActivityRecord.
  • the WMS includes a task stack (TaskStack), and the TaskStack includes a plurality of tasks (Tasks), and each Task corresponds to a plurality of application window tokens (AppWindowToken).
  • the task stack in the WMS corresponds to the page stack (ActivityStack) in the AMS shown in Figure 4, and the two and their substructures are kept in sync. That is to say, the data structures in the WMS and the AMS are correspondingly related.
  • the TaskRecord in the AMS corresponds to the Task in the WMS
  • the ActivityRecord in the AMS corresponds to the AppWindowToken in the WMS.
  • the mTasks of the TaskStack in the WMS need to be consistent with the mTaskHistory order of the ActivityStack in the AMS.
  • the above ActivityRecord is mainly used to describe a single Activity, which is the basic unit in ActivityStack; the ActivityRecord IBinder object can be expressed as ActivityRecord::Token, which can be regarded as the local handle of the remote object, which can be used for LPC and can be used as a unique identifier in the mapping. (unique ID), often dual-use.
  • the mActivities in the above TaskRecord are a list of ActivityRecords, which are sorted in historical order. ActivityRecord is managed indirectly through the TaskRecord layer.
  • the above ActivityStackSupervisor is the manager of the ActivityStack.
  • the TaskRecord can be used to identify an application, and the split screen mark is set in the TaskRecord to achieve the purpose of marking and distinguishing the split screen of the application.
  • the pages that the application needs to display on a split screen generally include a first page (main activity) and a non-first page.
  • the front page refers to the first page to be displayed.
  • the process of setting up split screen markers in the application's task list will vary depending on the type of page you want to split.
  • a specific implementation of setting a split screen mark includes:
  • the page that needs to be displayed on the split screen is the first page, since it is the first page of the application, there is no task linked list, so it is necessary to create a task linked list for the first page, and obtain a split screen mark according to the split screen instruction.
  • the screen mark is set in the created task list; in addition, a page linked list is created for the first page, the page linked list is located in the task linked list, and basic information of the first page needs to be stored in the page linked list;
  • the existing task linked list may be a task linked list corresponding to the first page, or may be a task linked list that does not previously share the non-first page of the task linked list with the first page, and obtain a split screen mark, and set the split screen mark in the new task linked list.
  • a page linked list is also created for the non-first page, the page linked list is located in the created new task linked list, and the basic information of the non-first page needs to be stored in the page linked list; if the non-first page and the first page In the shared task list, since the split screen mark already exists in the task list corresponding to the first page, only the page linked list is created for the non-first page, and the basic information of the non-first page is stored in the page linked list.
  • the split screen flag may be included in the split screen command.
  • obtaining the split screen mark may specifically: obtaining the split screen mark from the split screen command.
  • an intent message may be sent by calling the context.startActivity interface, and a split screen mark is added to the message.
  • the split screen command does not carry the split screen mark, but the frame layer itself generates a split screen mark for different applications according to the split screen instruction.
  • the framework layer directly uses the split-screen instructions as split screen markers.
  • the framework layer can know that the application needs to be divided into screens according to the split screen mark, and the application can be corresponding to other applications.
  • the split screens are separated to achieve the purpose of running the application in split screen.
  • the framework layer runs the application according to the split screen mark
  • the split screen is configured to: set the split screen parameter of the split screen window for the application according to the split screen mark, where the split screen parameter is mainly used to indicate the score
  • the size and position of the screen window may include information such as the coordinates, width, and height of the upper left corner of the split screen window on the entire screen; and the split screen parameters of the split screen window are provided to the application to supply the program.
  • the split screen parameter the page that needs to be displayed by the split screen is displayed in the split screen window.
  • the value of the split screen mark may be preset, and different values correspond to different split screen numbers.
  • the split screen mark has a value of 2, which means that it needs to be divided into two screens; A value of 3 means that it needs to be divided into three screens; a split screen marker has a value of 4, which means that 4 screens need to be split.
  • the usage mode of each screen can also be preset.
  • an implementation manner of setting a split screen parameter for a split screen window according to a split screen mark includes: dividing the entire screen into at least two sub screens according to the split screen mark, specifically, according to the split screen mark The value determines the number of divided sub-screens; determines the target sub-screen where the application's split-screen window is located; and sets the split-screen parameters of the split-screen window according to the screen parameters of the target sub-screen.
  • the order of use of the sub-screens is preset, and the sub-screen in which the split screen window corresponding to the current application is located is determined according to the order of use.
  • the sub-screen with the location may be randomly selected as the sub-screen where the split screen window corresponding to the current application is located. It is worth noting that the screen parameters of the sub-screen are mainly used to indicate the size and position of the sub-screen.
  • the framework layer may specifically send a first message to the application to notify the application to prepare a page that needs to be displayed by the split screen; send a second message to the application, where the second message includes
  • the split screen parameter of the split screen window determines the split screen window by the application program; for the application, the first message sent by the frame layer is received, and the page that needs to be displayed by the screen is prepared according to the first message, and is received by the frame layer.
  • the second message obtains the split screen parameter from the second message, determines the position of the split screen window on the screen according to the split screen parameter, and further sends a message to the frame layer to notify the frame layer after preparing the page that needs to be displayed by the split screen.
  • the page is prepared; after receiving the message sent by the application for notifying the prepared page, the framework layer sends a third message to the application to instruct the application to display the prepared page in the split screen window.
  • each Activity of the application is associated with a Window object.
  • the inheritance class of this Window object is com.android.internal.policy.impl.PhoneWindow, and the inheritance of the Window object.
  • the class provides a setAttributes(WindowManager.LayoutPrams) method, which can make some settings for the Activity property. For example, you can set the top left corner coordinates (x, y), width (width), height (height), etc. in the Activity property. parameter.
  • the application can call this method to set the coordinates, width and height of the upper left corner of the Activity, so that an Activity only occupies the area where the split screen window is located, and let other activities occupy the rest of the screen, so that the application can be ready.
  • the page is displayed in the split screen window, which realizes the purpose of the application split screen operation.
  • the application may need to display various dialogs in addition to displaying the page in a split screen.
  • the framework layer can also display the application's dialog box in the corresponding split screen window of the application.
  • the application needs to display the dialog box, it is determined that the dialog box is associated with the currently displayed page of the split screen window; according to the split screen parameter of the split screen window, the size of the dialog box and the popup position are determined; according to the size of the dialog box and The pop-up position pops up a dialog box on the split screen window.
  • the size of the corresponding window container (container) of the dialog box can be limited to the size of the associated split screen window, and the maximum size of the dialog box can only be displayed as the size of the window container, which can be smaller than the window container. If the dialog box is smaller, then The normal display does not fill the window container.
  • a full screen mode may be adopted to improve screen utilization. Based on this, before setting the split screen markup for the application, it can be judged whether the application is the first running application, and if the judgment result is yes, it is prohibited to set the split screen mark in the task list, thereby prohibiting setting for the application.
  • Split screen mark if the judgment result is no, the split screen mark is set to the task list, so as to achieve the purpose of running the application by split screen. It should be noted that, in the case that the judgment result is negative, it is also required to send a message including the split screen parameters corresponding to the other already running applications to other already running applications, so that other applications according to the split screen parameters. Display the pages that need to be displayed in other split screens corresponding to other applications.
  • the embodiment receives the split screen instruction for indicating the split screen running application, sets the split screen mark for the application according to the split screen instruction, and runs the application program according to the split screen mark. Since the application that needs to be split screen can be marked by the split screen mark, the data structure of the frame layer does not need to be modified, so that the application of the split screen running application can be achieved. In addition, by controlling the size and position of the split screen window corresponding to a single page, there is greater freedom, which makes the split screen scheme more flexible.
  • UML Unified Modeling Language
  • the UML diagram of the present application includes an application portion, a split screen entry portion, and a framework layer.
  • the application part includes: component adjuster (ActivityThread), window adjuster (WindowScalor) and page (Activity), WindowScalor is a tool to control Activity zoom; split screen entry part includes: multi-window controller (MultiWindowController), multi-window management MultiWindowManager and MultiWindowManagerService; the framework layer includes: StackManager (ActivityStackSuperVior), Activity Stack, TaskRecord, ActivityRecord, and Floating Window Layer (FloatWindowLayor).
  • Figure 6b shows the flow of a split-screen running application based on a UML diagram. A detailed description of the process is as follows:
  • the user invokes the context.startActivity interface provided by the Android system through the split-screen startup portal on the terminal device (for example, the sidebar or the split-screen preview interface) to the framework layer in the Android system (the framework layer here mainly refers to the image in FIG. 6b).
  • ActivityStackSuperVior sends an intent message, and adds a split screen mark to the intent message, which is marked as a flag, and is used to instruct the split screen to run the application while issuing an instruction to launch the application to the framework layer.
  • the framework layer After receiving the intent message transmitted by the context.startActivity interface, the framework layer enters the startup page (StartActivityLocked) process, and needs to determine whether the flag in the intent message needs to be removed, so that it is determined whether the flag in the intent message needs to be removed.
  • the process can be recorded as startActivityUncheckedLocked.
  • This operation mainly has the ActivityStackSuperVior in Figure 6b indicating the ActivityStack to complete. It is worth noting that the "Locked" in the above process is only to indicate that the method flow is thread-safe, and Locked itself has no specific meaning.
  • the framework layer determines whether to remove the flag (removeFloatFlagIfNeeded) according to whether the application is the first application to run, and if it is the first application to run, it needs to be removed if It is not the first application to request to run, it will not be removed. If you need to enter the full screen state, the page blocked by the desktop will be cleared (finishNoneFloatAcitivityUnderHome) to run the application in full screen. If it is necessary to enter the split screen state, it is determined that the split screen parameter of the split screen window needs to be set according to the flag. So, enter the default process of starting the Activity in the framework layer.
  • ActivityStack determines whether to remove the flag (removeFloatFlagIfNeeded) according to whether the application is the first application to run, and if it is the first application to run, it needs to be removed if It is not the first application to request to run, it will not be removed. If you need to enter the full screen state, the page blocked by the desktop will be cleared (finishN
  • the constructor of the TaskRecord will fetch the data from the intent message. Since the intent message contains the split-screen flag, ie flag, it will get the flag and save it to Inside TaskRecord, the TaskRecord will be marked as needing to be split.
  • the ActivityStack will instruct the ActivitySupervisor to enter the RealStartActivityLocked process of the ActivitySupervisor.
  • the framework layer requests the application to prepare the page to be displayed, specifically sending the first message to the application to request the application to prepare the page to be displayed; further, sending the second message to the application, passing the second message Passing the split screen parameter of the split screen window to the application, and determining the split screen window by the application program; when the application prepares the page, sending a notification message to the framework layer, and the framework layer receives the notification After the message, a third message is sent to the application to instruct the application to display the prepared page in the split screen window. For the application, after receiving the third message, you can set the size of the main Activity to make it suitable for the split-screen window. This process can be mainly completed by the ActivitySupervisor, ActivityRecord, ActivityThread, WindowScalor and Activity in Figure 6b.
  • the application can call FloatWindowLayor.layoutActivityRecord() to construct a LayoutParams object and assign values to the top left corner coordinates (x, y), width (width), height (height) of the LayoutParams object.
  • FloatWindowLayor.layoutActivityRecord() the main function of FloatWindowLayor.layoutActivityRecord() is to set the location of the main Activity and specifically position it to the split screen window. Then, the application calls the setAttributes(WindowManager.LayoutPrams) method of the main Activity to set the properties of the main Activity.
  • the realStartActivityLocked process can be directly executed, and in the realStartActivityLocked process, the application will also set the non-main Activit to The same size as the main Activity.
  • the non-main Activity For a non-main Activity, if the non-main Activity does not share the same TaskRecord with the main Activity, you need to find out whether there is already a TaskRecord corresponding to the other Activity of the application. Specifically, you can determine whether the package name (packageName) corresponding to the TaskRecord exists with the application. The package name is the same. If it exists, the flag in the TaskRecord is set to the current non-main Activity TaskRecord, ensuring that the non-main Activity and the main Activity correspond to the same flag. After that, enter the realStartActivityLocked process, and in the realStartActivityLocked process, the application will also set the non-main Activit to the same size as the main Activity.
  • packageName package name
  • the present application runs the application by split screen according to the split screen mark by setting a split screen mark for the application. Since the application that needs to be split screen can be marked by the split screen mark, the data structure of the frame layer does not need to be modified, so that the application of the split screen running application can be achieved.
  • FIG. 7 is a schematic structural diagram of an apparatus for running a split screen according to an embodiment of the present application. As shown in FIG. 7, the device includes a receiving module 71, a marking module 72, and a split screen module 73.
  • the receiving module 71 is configured to receive a split screen instruction for indicating a split screen running application
  • a marking module 72 configured to set a split screen mark for the application according to the split screen instruction
  • the split screen module 73 is configured to run the application in a split screen according to the split screen mark.
  • the marking module 72 is specifically configured to:
  • a split screen mark is set in the application's task list, and the task list corresponds to a page that the application needs to display on a split screen.
  • the marking module 72 is specifically configured to:
  • a task linked list is created for the first page, and according to the split screen instruction, the split screen mark is obtained, and the split screen mark is set in the task linked list;
  • the marking module 72 is specifically configured to:
  • a split screen mark is generated according to the split screen command.
  • the split screen module 73 is specifically configured to:
  • the split screen parameters are provided to the application, and the application program displays the page in the split screen window according to the split screen parameters.
  • the split screen module 73 is specifically configured to:
  • the second message includes a split screen parameter, and the application program determines the split screen window
  • a third message is sent to the application to instruct the application to display the page in the split screen window.
  • the split screen module 73 is specifically configured to:
  • the split screen module 73 is further configured to:
  • the application's dialog box is displayed in the split screen window.
  • the split screen module 73 is specifically configured to:
  • the determination dialog box is associated with the currently displayed page of the split screen window
  • a dialog box pops up in the split screen window.
  • the apparatus of this embodiment further includes: a determining module, configured to determine whether the application is the first running application; if the determination result is yes, the prohibiting marking module sets the split screen flag to the task linked list If the result of the determination is no, the trigger tag module sets the split screen tag to the task list.
  • the split screen command is a startup command sent by the user through the split screen startup entry to start the application.
  • the device provided in this embodiment receives a split screen instruction for instructing a split screen running application, and sets a split screen mark for the application according to the split screen instruction, and runs the application program according to the split screen mark. Since the application that needs to be split screen can be marked by the split screen mark, the data structure of the frame layer does not need to be modified, so that the application of the split screen running application can be achieved.
  • the disclosed system, apparatus, and method may be implemented in other manners.
  • the device embodiments described above are merely illustrative.
  • the division of the unit is only a logical function division.
  • there may be another division manner for example, multiple units or components may be combined or Can be integrated into another system, or some features can be ignored or not executed.
  • the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, and may be in an electrical, mechanical or other form.
  • the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
  • each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
  • the above integrated unit can be implemented in the form of hardware or in the form of hardware plus software functional units.
  • the above-described integrated unit implemented in the form of a software functional unit can be stored in a computer readable storage medium.
  • the above software functional unit is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor to perform the methods of the various embodiments of the present invention. Part of the steps.
  • the foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, and the like, which can store program codes. .

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • User Interface Of Digital Computer (AREA)
  • Stored Programmes (AREA)

Abstract

Provided are an application screen-splitting running method and device. The method comprises: receiving a screen-splitting instruction for instructing an application program to be run in a screen-splitting manner; setting a screen-splitting marker for the application program according to the screen-splitting instruction; and running the application program in a screen-splitting manner according to the screen-splitting marker. The present application can fulfil the purpose of application screen-splitting running on the basis of no modification of a data structure of a frame layer.

Description

分屏运行应用的方法及装置Method and device for running application by split screen
本申请要求2015年03月26日递交的申请号为201510135127.9、发明名称为“分屏运行应用的方法及装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。The present application claims priority to Chinese Patent Application Serial No. No. No. No. No. No. No. No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No
技术领域Technical field
本申请涉及软件技术领域,尤其涉及一种分屏运行应用的方法及装置。The present application relates to the field of software technologies, and in particular, to a method and an apparatus for split screen operation applications.
背景技术Background technique
目前,手机、平板电脑等电子设备的架构一般包括:硬件、操作系统、框架层、应用层。框架层主要负责接收用户的输入事件、进行处理以及将处理的结果通过文字、图像、声音、震动等形式反馈给用户。随着电子设备的处理能力越来越强,电子设备可以支持多个应用同时工作,但是现有框架层一般使用同一堆栈管理所有应用的数据,导致较难区分不同分屏,所以在同一屏幕上只有一个应用可以获得焦点,能够接收用户的输入事件,和用户交互;而其他应用在后台运行,无法和用户交互。现有技术存在一些分屏技术方案,主要是通过对框架层的数据结构进行修改,将原来使用同一堆栈进行数据管理的数据结构,改成使用不同堆栈分别管理不同分屏数据的数据结构,以便于实现同屏多任务多窗口运行。At present, the architecture of electronic devices such as mobile phones and tablet computers generally includes: hardware, operating system, framework layer, and application layer. The framework layer is mainly responsible for receiving user input events, processing, and feeding back the results of the processing to the user in the form of text, images, sounds, vibrations, and the like. As electronic devices become more powerful, electronic devices can support multiple applications working simultaneously, but existing framework layers typically use the same stack to manage data for all applications, making it difficult to distinguish between different split screens, so on the same screen Only one application can get focus, receive user input events, and interact with the user; while other applications run in the background and cannot interact with the user. The prior art has some split screen technical solutions, mainly by modifying the data structure of the framework layer, and changing the data structure originally using the same stack for data management to the data structure for managing different split screen data by using different stacks, so that To achieve multi-tasking multi-window operation in the same screen.
上述实现多任务多窗口运行的方案需要对堆栈的数据结构进行修改,工作量较大,实现起来较为困难,且很容易引入新的漏洞(bug)。针对该问题,亟需一种不用改动堆栈的数据结构即可分屏运行应用的方案。The above scheme for implementing multi-tasking and multi-window operation needs to modify the data structure of the stack, has a large workload, is difficult to implement, and is easy to introduce new bugs. In response to this problem, there is a need for a solution for running applications on a split screen without changing the data structure of the stack.
发明内容Summary of the invention
本申请的多个方面提供一种分屏运行应用的方法及装置,用以在不修改框架层的数据结构的基础上,实现分屏运行应用的目的。Aspects of the present application provide a method and apparatus for running a split screen application, which is used to implement a split screen running application without modifying the data structure of the framework layer.
本申请的一方面,提供一种分屏运行应用的方法,包括:An aspect of the present application provides a method for running a split screen application, including:
接收用于指示分屏运行应用程序的分屏指令;Receiving a split screen instruction for instructing the split screen to run the application;
根据所述分屏指令,为所述应用程序设置分屏标记;Setting a split screen mark for the application according to the split screen instruction;
根据所述分屏标记,分屏运行所述应用程序。The application is run on a split screen according to the split screen mark.
本申请的另一方面,提供一种分屏运行应用的装置,包括:In another aspect of the present application, an apparatus for operating a split screen is provided, including:
接收模块,用于接收用于指示分屏运行应用程序的分屏指令; a receiving module, configured to receive a split screen instruction for instructing the split screen to run the application;
标记模块,用于根据所述分屏指令,为所述应用程序设置分屏标记;a marking module, configured to set a split screen mark for the application according to the split screen instruction;
分屏模块,用于根据所述分屏标记,分屏运行所述应用程序。a split screen module, configured to run the application in a split screen according to the split screen mark.
在本申请中,接收用于指示分屏运行应用程序的分屏指令,根据该分屏指令,为应用程序设置分屏标记,根据分屏标记,分屏运行应用程序。由于通过分屏标记可以标记出需要分屏运行的应用程序,所以不需要修改框架层改动堆栈的数据结构,便可以达到分屏运行应用程序的目的。In the present application, a split screen instruction for instructing a split screen running application is received, and according to the split screen instruction, a split screen mark is set for the application, and the application is run by the split screen according to the split screen mark. Since the application that needs to be split screen can be marked by the split screen mark, the data structure of the stack layer change stack can be modified, and the purpose of running the application on the split screen can be achieved.
附图说明DRAWINGS
为了更清楚地说明本发明实施例中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作一简单地介绍,显而易见地,下面描述中的附图是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings used in the embodiments or the prior art description will be briefly described below. Obviously, the drawings in the following description are the present invention. For some embodiments, other drawings may be obtained from those of ordinary skill in the art in light of the inventive workability.
图1为本申请一实施例提供的分屏运行应用的方法的流程示意图;1 is a schematic flowchart of a method for running a split screen application according to an embodiment of the present application;
图2为本申请一实施例提供的侧边栏的示意图;2 is a schematic diagram of a sidebar according to an embodiment of the present application;
图3为本申请一实施例提供的分屏预览界面的示意图;3 is a schematic diagram of a split screen preview interface according to an embodiment of the present application;
图4为本申请一实施例提供的AMS的数据结构示意图;4 is a schematic diagram of a data structure of an AMS according to an embodiment of the present application;
图5为本申请一实施例提供的WMS的数据结构示意图;FIG. 5 is a schematic diagram of a data structure of a WMS according to an embodiment of the present application;
图6a为本申请一实施例提供的整体UML图;Figure 6a is an overall UML diagram provided by an embodiment of the present application;
图6b为本申请一实施例提供的基于UML图实现的分屏运行应用程序的流程示意图;6b is a schematic flowchart of a split screen running application implemented by using a UML diagram according to an embodiment of the present disclosure;
图7为本申请一实施例提供的分屏运行应用的装置的结构示意图。FIG. 7 is a schematic structural diagram of an apparatus for running a split screen according to an embodiment of the present application.
具体实施方式detailed description
为使本发明实施例的目的、技术方案和优点更加清楚,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the drawings in the embodiments of the present invention. It is a partial embodiment of the invention, and not all of the embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative efforts are within the scope of the present invention.
针对现有技术存在的问题,本申请提供一种分屏运行应用的方法,可以在不修改堆栈的数据结构的基础上,实现分屏运行应用程序的目的。图1为本申请一实施例提供的分屏运行应用的方法的流程示意图。该方法可由框架层来执行,但不限于此。如图1所示,该方法包括: In view of the problems existing in the prior art, the present application provides a method for running a split screen application, which can realize the purpose of running an application by using a split screen without modifying the data structure of the stack. FIG. 1 is a schematic flowchart diagram of a method for running a split screen application according to an embodiment of the present application. The method can be performed by the framework layer, but is not limited thereto. As shown in Figure 1, the method includes:
101、接收用于指示分屏运行应用程序的分屏指令。101. Receive a split screen instruction for instructing the split screen to run the application.
102、根据上述分屏指令,为应用程序设置分屏标记。102. Set a split screen mark for the application according to the above split screen instruction.
103、根据上述分屏标记,分屏运行应用程序。103. Run the application in split screen according to the above split screen mark.
在本实施例中,当需要分屏运行应用程序时,可以发出分屏指令,用来指示分屏运行应用程序。本实施例对发出分屏指令的方式不做限定。In this embodiment, when the application needs to be run by the split screen, a split screen command may be issued to instruct the split screen to run the application. This embodiment does not limit the manner in which the split screen command is issued.
例如,可以向用户提供一分屏启动入口,用于供用户发出用于启动应用程序的启动指令,通过该分屏启动入口发出的启动指令,实际上指示分屏运行该应用程序。基于此,上述分屏指令具体可以是用户通过分屏启动入口发出的用于启动应用程序的启动指令。For example, a split screen launch entry can be provided to the user for the user to issue a launch command for launching the application, and the launch command issued by the split screen launch entry actually instructs the split screen to run the application. Based on this, the above-mentioned split screen instruction may specifically be a start command issued by the user through the split screen start entry for starting the application.
上述分屏启动入口可以有各种实现方式,例如可以是设置于屏幕上的侧边栏应用。如图2所示屏幕的左侧部分为侧边栏,在该侧边栏中预先设置有支持分屏运行的各种应用的图标,例如便签、视频、相册、信息和浏览器等应用的图标。例如,通过点击图2中侧边栏的圆弧可以隐藏或显示侧边栏,或长时间不操作已显示的侧边栏会动态自己隐藏,只保留圆弧在主屏幕上,但不限于这种方式。例如,还可以通过操作各种物理键来显示或隐藏侧边栏。The above-mentioned split-screen boot entry can have various implementations, such as a sidebar application set on the screen. The left part of the screen shown in FIG. 2 is a sidebar in which icons of various applications supporting split screen operation, such as icons of applications such as notes, videos, albums, information, and browsers, are preset in advance. . For example, you can hide or show the sidebar by clicking the arc of the sidebar in Figure 2, or you can hide it yourself by not operating the displayed sidebar for a long time, leaving only the arc on the main screen, but not limited to this. Ways. For example, you can also show or hide the sidebar by manipulating various physical keys.
例如,用户可以通过拖动某个应用的图标至主屏幕(图2中的右侧部分)上,从而实现通过该侧边栏发出用于指示分屏运行该应用的启动指令。或者,用户也可以通过点击、触控、悬停等方式操作侧边栏中某个应用的图标,从而实现通过该侧边栏发出用于指示分屏运行该应用的启动指令。For example, the user can issue a start command for instructing the split screen to run the application by dragging an application's icon onto the home screen (the right portion in FIG. 2). Alternatively, the user can also operate an icon of an application in the sidebar by clicking, touching, hovering, etc., thereby implementing a startup instruction for instructing the split screen to run the application through the sidebar.
或者,上述分屏启动入口可以是分屏预览界面,分屏预览界面可以是一个或多个。如图3所示,主屏幕上的两个实线框为分屏预览界面。例如,用户可以通过长按Home按钮调出或隐藏分屏预览界面,或者用户可以通过长按开机键或音量调节键调出或隐藏分屏预览界面。值得说明的是,这里长按各种按键的操作可以通过长按时间与已有长按操作相区分。Alternatively, the split screen startup portal may be a split screen preview interface, and the split screen preview interface may be one or more. As shown in Figure 3, the two solid line boxes on the main screen are split screen preview interfaces. For example, the user can call up or hide the split screen preview interface by long pressing the Home button, or the user can press or hold the power button or volume adjustment button to call up or hide the split screen preview interface. It is worth noting that the long press of various buttons can be distinguished from the existing long press operation by long press time.
例如,用户可以通过拖动某个应用的图标至分屏预览界面上,从而实现通过该分屏预览界面发出用于指示分屏运行该应用的启动指令。或者,用户可以点击分屏预览界面上的添加符号,如“+”,来添加某个应用到分屏预览界面上,从而实现通过该分屏预览界面发出用于指示分屏运行该应用的启动指令。For example, the user can drag an icon of an application to the split screen preview interface, so that a startup instruction for instructing the split screen to run the application is sent through the split screen preview interface. Alternatively, the user can click on the add symbol on the split screen preview interface, such as “+”, to add an application to the split screen preview interface, thereby enabling the launch of the application to be indicated by the split screen preview interface for instructing the split screen to run the application. instruction.
以Android系统为例,无论是侧边栏还是分屏预览界面,都可以调用Android系统提供的应用程序接口(API),如context.startActivity发出分屏指令。context.startActivity用来启动一个页面(Activity)。 Take the Android system as an example, whether it is the sidebar or the split-screen preview interface, you can call the application program interface (API) provided by the Android system, such as context.startActivity to issue a split-screen command. The context.startActivity is used to start a page (Activity).
框架层接收到分屏指令后,可以根据分屏指令,为需要分屏运行的应用程序设置分屏标记,通过该分屏标记一方面可以标识该应用程序需要分屏,另一方面可以与其他分屏相区分。由于框架层主要负责与用户之间的交互,负责对用户界面进行处理,因此,框架层为应用程序设置分屏标记,实际上是为应用程序在框架层的数据设置分屏标记,这样可以了解到该应用程序需要分屏运行并且可以将该应用程序对应的分屏与其他分屏相区分。After receiving the split screen command, the framework layer can set a split screen mark for the application that needs to be split screen according to the split screen instruction. On the one hand, the split screen mark can identify that the application needs to be split screen, and on the other hand, can be combined with other Split screens are distinguished. Since the framework layer is mainly responsible for interacting with the user and is responsible for processing the user interface, the framework layer sets the split screen markup for the application, which is actually setting the split screen mark for the data of the application layer in the framework layer, so that it can be understood The application needs to be split screen and the split screen corresponding to the application can be distinguished from other split screens.
在一可选实施方式中,框架层通过任务链表(TaskRecord)来管理应用程序,基于此,框架层根据分屏指令,为应用程序设置分屏标记的过程包括:根据分屏指令,在应用程序的任务链表中设置分屏标记,该任务链表对应于应用程序需要分屏展示的页面。即通过该任务链表可以确定应用程序需要分屏展示的页面。例如,任务链表可以存储应用程序的页面记录(ActivityRecord)。ActivityRecord也只存在框架层,用于存储应用程序需要分屏展示的页面的基本信息。页面的基本信息一般包括:该页面的名称、该页面所属的应用程序的标识等。In an optional implementation manner, the framework layer manages the application through a task list (TaskRecord). Based on this, the framework layer sets the split screen markup for the application according to the split screen instruction, including: according to the split screen instruction, in the application program A split screen mark is set in the task list, and the task list corresponds to a page that the application needs to display on a split screen. That is, through the task list, it is possible to determine the page that the application needs to display in a split screen. For example, a task list can store an application's page record (ActivityRecord). ActivityRecord also has only the framework layer, which is used to store the basic information of the page that the application needs to display on a split screen. The basic information of the page generally includes: the name of the page, the identifier of the application to which the page belongs, and the like.
例如,以Android系统为例,在框架层的活动管理服务(ActivityManagerService,AMS)中,如图4所示,该AMS包括一个页面堆栈管理器(ActivityStackSuperVior),该ActivityStackSuperVior通过页面堆栈(ActivityStack)管理多个TaskRecord,每个TaskRecord包括多个ActivityRecord,即每个ActivityRecord都属于一个TaskRecord,每个ActivityRecord负责管理应用程序的一个页面(Activity),即应用程序的内个Activity都对应有一个ActivityRecord。For example, taking the Android system as an example, in the activity management service (AMS) of the framework layer, as shown in FIG. 4, the AMS includes a page stack manager (ActivityStackSuperVior), and the ActivityStackSuperVior is managed by the page stack (ActivityStack). TaskRecord, each TaskRecord includes multiple ActivityRecord, that is, each ActivityRecord belongs to a TaskRecord, each ActivityRecord is responsible for managing an application's page (Activity), that is, the application's internal Activity has an ActivityRecord.
另外,在框架层的窗口管理服务(WindowManagerService,WMS)中也有类似的结构。如图5所示,该WMS包括一个任务堆栈(TaskStack),该TaskStack包括多个任务(Task),每个Task对应多个应用窗口令牌(AppWindowToken)。WMS里的任务堆栈(TaskStack)对应图4所示AMS中的页面堆栈(ActivityStack),这两者及其子结构保持同步。也就是说,WMS和AMS中的数据结构是有对应关系的,例如AMS中的TaskRecord对应于WMS中的Task,AMS中的ActivityRecord对应于WMS中的AppWindowToken。另外,WMS中TaskStack的mTasks需要和AMS中ActivityStack的mTaskHistory顺序保持一致。In addition, there is a similar structure in the window management service (WindowManager Service, WMS) of the framework layer. As shown in FIG. 5, the WMS includes a task stack (TaskStack), and the TaskStack includes a plurality of tasks (Tasks), and each Task corresponds to a plurality of application window tokens (AppWindowToken). The task stack in the WMS corresponds to the page stack (ActivityStack) in the AMS shown in Figure 4, and the two and their substructures are kept in sync. That is to say, the data structures in the WMS and the AMS are correspondingly related. For example, the TaskRecord in the AMS corresponds to the Task in the WMS, and the ActivityRecord in the AMS corresponds to the AppWindowToken in the WMS. In addition, the mTasks of the TaskStack in the WMS need to be consistent with the mTaskHistory order of the ActivityStack in the AMS.
上述ActivityRecord主要用于描述单个Activity,是ActivityStack中的基本单元;ActivityRecord的IBinder对象可以表示为ActivityRecord::Token,可以看作远程对象的本地句柄,可用于LPC,又可用来作映射中的唯一标识(unique ID),经常是两用的。 The above ActivityRecord is mainly used to describe a single Activity, which is the basic unit in ActivityStack; the ActivityRecord IBinder object can be expressed as ActivityRecord::Token, which can be regarded as the local handle of the remote object, which can be used for LPC and can be used as a unique identifier in the mapping. (unique ID), often dual-use.
上述TaskRecord中的mActivities是ActivityRecord的列表,它们是按照历史顺序排序的。ActivityRecord是通过TaskRecord这一层间接地被管理着。The mActivities in the above TaskRecord are a list of ActivityRecords, which are sorted in historical order. ActivityRecord is managed indirectly through the TaskRecord layer.
上述ActivityStackSupervisor是ActivityStack的管理者。The above ActivityStackSupervisor is the manager of the ActivityStack.
基于Android系统框架层对应用程序需要展示的页面的管理,可以通过TaskRecord来标识一个应用程序,将分屏标记设置在TaskRecord中,达到标记和区分应用程序的分屏的目的。Based on the Android system framework layer management of the page that the application needs to display, the TaskRecord can be used to identify an application, and the split screen mark is set in the TaskRecord to achieve the purpose of marking and distinguishing the split screen of the application.
应用程序需要分屏展示的页面一般包括首页面(main Activity)和非首页面。首页面是指首个要展示的页面。根据要分屏展示的页面类型的不同,在应用程序的任务链表中设置分屏标记的过程也会有所不同。则一种设置分屏标记的具体实施方式包括:The pages that the application needs to display on a split screen generally include a first page (main activity) and a non-first page. The front page refers to the first page to be displayed. The process of setting up split screen markers in the application's task list will vary depending on the type of page you want to split. A specific implementation of setting a split screen mark includes:
当需要分屏展示的页面是首页面时,由于是该应用程序的首个页面,尚不存在任务链表,故需要为该首页面创建任务链表,根据分屏指令,获得分屏标记,将分屏标记设置在所创建的任务链表中;另外,还需要为该首页面创建页面链表,该页面链表位于任务链表中,并且需要将该首页面的基本信息存储到页面链表中;When the page that needs to be displayed on the split screen is the first page, since it is the first page of the application, there is no task linked list, so it is necessary to create a task linked list for the first page, and obtain a split screen mark according to the split screen instruction. The screen mark is set in the created task list; in addition, a page linked list is created for the first page, the page linked list is located in the task linked list, and basic information of the first page needs to be stored in the page linked list;
当需要分屏展示的页面是非首页面时,若该非首页面不与首页面共用任务链表,则为该非首页面创建一新任务链表,从应用程序对应的已存在的任务链表(这里已存在的任务链表可以是首页面对应的任务链表,也可以是之前不与首页面共用任务链表的非首页面对应的任务链表)中获取分屏标记,将分屏标记设置在新任务链表中;另外,还需要为该非首页面创建页面链表,该页面链表位于所创建的新任务链表中,并且需要将该非首页面的基本信息存储到页面链表中;若该非首页面与首页面共用任务链表,由于首页面对应的任务链表中已经存在分屏标记,所以只需为该非首页面创建页面链表,将该非首页面的基本信息存储到页面链表中即可。When the page that needs to be displayed by the screen is not the first page, if the non-first page does not share the task list with the first page, a new task list is created for the non-first page, and the existing task list corresponding to the application is used (here The existing task linked list may be a task linked list corresponding to the first page, or may be a task linked list that does not previously share the non-first page of the task linked list with the first page, and obtain a split screen mark, and set the split screen mark in the new task linked list. In addition, a page linked list is also created for the non-first page, the page linked list is located in the created new task linked list, and the basic information of the non-first page needs to be stored in the page linked list; if the non-first page and the first page In the shared task list, since the split screen mark already exists in the task list corresponding to the first page, only the page linked list is created for the non-first page, and the basic information of the non-first page is stored in the page linked list.
在一可选实施方式中,分屏指令中可以包括分屏标记。基于此,上述根据分屏指令,获得分屏标记具体可以是:从分屏指令中获取分屏标记。以Android系统为例,在通过调用Android系统提供的context.startActivity接口发出分屏指令时,具体可以通过调用context.startActivity接口发出意图(intent)消息,该消息中添加分屏标记。In an alternative embodiment, the split screen flag may be included in the split screen command. Based on the above, according to the split screen command, obtaining the split screen mark may specifically: obtaining the split screen mark from the split screen command. Taking the Android system as an example, when a split screen instruction is issued by calling the context.startActivity interface provided by the Android system, an intent message may be sent by calling the context.startActivity interface, and a split screen mark is added to the message.
或者,分屏指令中不携带分屏标记,而是由框架层自己根据分屏指令,为不同应用程序生成分屏标记。例如,框架层直接将分屏指令作为分屏标记。Or, the split screen command does not carry the split screen mark, but the frame layer itself generates a split screen mark for different applications according to the split screen instruction. For example, the framework layer directly uses the split-screen instructions as split screen markers.
在为应用程序设置分屏标记后,在应用程序的整个运行过程中,框架层就可以根据该分屏标记,获知该应用程序需要分屏运行,且可以将该应用程序与其他应用程序对应的分屏区分开,从而实现分屏运行应用程序的目的。 After setting the split screen markup for the application, during the entire running process of the application, the framework layer can know that the application needs to be divided into screens according to the split screen mark, and the application can be corresponding to other applications. The split screens are separated to achieve the purpose of running the application in split screen.
在一可选实施方式中,框架层根据分屏标记,分屏运行应用程序具体为:根据分屏标记,为应用程序设置分屏窗口的分屏参数,这里的分屏参数主要用于指示分屏窗口的大小及位置,具体的,分屏参数可以包括分屏窗口在整个屏幕上的左上角坐标、宽度以及高度等信息;将分屏窗口的分屏参数提供给应用程序,以供应用程序根据分屏参数将需要分屏展示的页面展示在分屏窗口中。In an optional implementation manner, the framework layer runs the application according to the split screen mark, and the split screen is configured to: set the split screen parameter of the split screen window for the application according to the split screen mark, where the split screen parameter is mainly used to indicate the score The size and position of the screen window. Specifically, the split screen parameter may include information such as the coordinates, width, and height of the upper left corner of the split screen window on the entire screen; and the split screen parameters of the split screen window are provided to the application to supply the program. According to the split screen parameter, the page that needs to be displayed by the split screen is displayed in the split screen window.
在一可选实施方式中,可以预先设置分屏标记的取值,不同取值对应不同的分屏个数,例如分屏标记取值为2,意味着需要分为两屏;分屏标记取值为3,意味着需要分为三屏;分屏标记取值为4,意味着需要分屏4屏。可选的,每一屏上可以运行一个应用程序,或者也可以同时运行多个应用程序。每一屏的使用模式也可以预先设定。In an optional implementation manner, the value of the split screen mark may be preset, and different values correspond to different split screen numbers. For example, the split screen mark has a value of 2, which means that it needs to be divided into two screens; A value of 3 means that it needs to be divided into three screens; a split screen marker has a value of 4, which means that 4 screens need to be split. Optionally, you can run one application per screen, or you can run multiple applications at the same time. The usage mode of each screen can also be preset.
基于上述,一种根据分屏标记,为应用程序设置分屏窗口的分屏参数的实施方式包括:根据分屏标记,将整个屏幕划分为至少两个子屏幕,具体,可以根据分屏标记的取值确定所划分的子屏幕的个数;确定该应用程序的分屏窗口所在的目标子屏幕;根据目标子屏幕的屏幕参数,设置分屏窗口的分屏参数。例如,预先设定子屏幕的使用顺序,根据该使用顺序来确定当前应用程序对应的分屏窗口所在的子屏幕。或者,也可以随机选择有位置的子屏幕作为当前应用程序对应的分屏窗口所在的子屏幕。值得说明的是,子屏幕的屏幕参数主要用于指示该子屏幕的大小及位置。Based on the foregoing, an implementation manner of setting a split screen parameter for a split screen window according to a split screen mark includes: dividing the entire screen into at least two sub screens according to the split screen mark, specifically, according to the split screen mark The value determines the number of divided sub-screens; determines the target sub-screen where the application's split-screen window is located; and sets the split-screen parameters of the split-screen window according to the screen parameters of the target sub-screen. For example, the order of use of the sub-screens is preset, and the sub-screen in which the split screen window corresponding to the current application is located is determined according to the order of use. Alternatively, the sub-screen with the location may be randomly selected as the sub-screen where the split screen window corresponding to the current application is located. It is worth noting that the screen parameters of the sub-screen are mainly used to indicate the size and position of the sub-screen.
可选的,若一个子屏幕上运行一个应用程序,则一个子屏幕可以直接作为一个分屏窗口,但不限于此。在获得应用程序的分屏窗口的分屏参数后,框架层具体可以向应用程序发送第一消息,以通知应用程序准备需要分屏展示的页面;向应用程序发送第二消息,第二消息包括分屏窗口的分屏参数,以供应用程序确定分屏窗口;对应用程序来说,接收框架层发送的第一消息,根据第一消息准备需要分屏展示的页面,并接收框架层发送的第二消息,从第二消息中获取分屏参数,根据分屏参数确定分屏窗口在屏幕上的位置,进一步当准备好需要分屏展示的页面后,向框架层发送消息,以通知框架层已经准备好页面;框架层在接收到应用程序发送的用于通知准备好页面的消息后,向应用程序发送第三消息,以指示应用程序将准备好的页面展示在分屏窗口中。Optionally, if an application is run on a sub-screen, a sub-screen can be directly used as a split-screen window, but is not limited thereto. After obtaining the split screen parameter of the split screen window of the application, the framework layer may specifically send a first message to the application to notify the application to prepare a page that needs to be displayed by the split screen; send a second message to the application, where the second message includes The split screen parameter of the split screen window determines the split screen window by the application program; for the application, the first message sent by the frame layer is received, and the page that needs to be displayed by the screen is prepared according to the first message, and is received by the frame layer. The second message obtains the split screen parameter from the second message, determines the position of the split screen window on the screen according to the split screen parameter, and further sends a message to the frame layer to notify the frame layer after preparing the page that needs to be displayed by the split screen. The page is prepared; after receiving the message sent by the application for notifying the prepared page, the framework layer sends a third message to the application to instruct the application to display the prepared page in the split screen window.
以Android系统为例,在Android系统中,应用程序的每个Activity都关联一个窗口(Window)对象,这个Window对象的继承类是com.android.internal.policy.impl.PhoneWindow,该Window对象的继承类提供了一个setAttributes(WindowManager.LayoutPrams)方法,该方法可以对Activity属性做一些设置,例如可以设置Activity属性中的左上角坐标(x,y)、宽度(width)、高度(height)等 参数。基于此,应用程序可以调用该方法设置Activity的左上角坐标、宽度、高度,从而让一个Activity只占据分屏窗口所在区域,而让其他Activity占据屏幕的其余区域,这样应用程序就可以将准备好的页面展示在分屏窗口中,进而实现应用分屏运行的目的。Take the Android system as an example. In the Android system, each Activity of the application is associated with a Window object. The inheritance class of this Window object is com.android.internal.policy.impl.PhoneWindow, and the inheritance of the Window object. The class provides a setAttributes(WindowManager.LayoutPrams) method, which can make some settings for the Activity property. For example, you can set the top left corner coordinates (x, y), width (width), height (height), etc. in the Activity property. parameter. Based on this, the application can call this method to set the coordinates, width and height of the upper left corner of the Activity, so that an Activity only occupies the area where the split screen window is located, and let other activities occupy the rest of the screen, so that the application can be ready. The page is displayed in the split screen window, which realizes the purpose of the application split screen operation.
在一可选实施方式中,应用程序除了需要分屏展示页面之外,还可能需要展示各种对话框。基于此,框架层还可以在应用程序对应的分屏窗口中展示应用程序的对话框。In an alternative embodiment, the application may need to display various dialogs in addition to displaying the page in a split screen. Based on this, the framework layer can also display the application's dialog box in the corresponding split screen window of the application.
具体的,当应用程序需要展示对话框时,确定该对话框关联于分屏窗口当前展示的页面;根据分屏窗口的分屏参数,确定对话框的大小及弹出位置;根据对话框的大小及弹出位置,在分屏窗口上弹出对话框。具体的,可以将对话框对应的窗口容器(Container)的大小限制为关联的分屏窗口的大小,对话框最大只能显示成窗口容器大小,可以比窗口容器小,如果对话框更小,那就正常显示,不充满窗口容器。Specifically, when the application needs to display the dialog box, it is determined that the dialog box is associated with the currently displayed page of the split screen window; according to the split screen parameter of the split screen window, the size of the dialog box and the popup position are determined; according to the size of the dialog box and The pop-up position pops up a dialog box on the split screen window. Specifically, the size of the corresponding window container (container) of the dialog box can be limited to the size of the associated split screen window, and the maximum size of the dialog box can only be displayed as the size of the window container, which can be smaller than the window container. If the dialog box is smaller, then The normal display does not fill the window container.
在一可选实施方式中,若申请分屏运行的应用程序是首个运行的应用,那么可以采用全屏方式,以提高屏幕利用率。基于此,在为应用程序设置分屏标记之前,可以判断应用程序是否是首个运行的应用,若判断结果为是,则禁止将分屏标记设置在任务链表中,从而禁止为该应用程序设置分屏标记;若判断结果为否,则将分屏标记设置到任务链表中,从而达到分屏运行应用程序的目的。值得说明的是,对于判断结果为否的情况,还需要向其他已经运行的应用程序发送包含所述其他已经运行的应用程序对应的分屏参数的消息,以使其他应用程序根据该分屏参数将需要展示的页面展示在其他应用程序对应的其他分屏窗口中。In an optional implementation manner, if the application that is applied for split screen operation is the first running application, a full screen mode may be adopted to improve screen utilization. Based on this, before setting the split screen markup for the application, it can be judged whether the application is the first running application, and if the judgment result is yes, it is prohibited to set the split screen mark in the task list, thereby prohibiting setting for the application. Split screen mark; if the judgment result is no, the split screen mark is set to the task list, so as to achieve the purpose of running the application by split screen. It should be noted that, in the case that the judgment result is negative, it is also required to send a message including the split screen parameters corresponding to the other already running applications to other already running applications, so that other applications according to the split screen parameters. Display the pages that need to be displayed in other split screens corresponding to other applications.
由上述可见,本实施例通过接收用于指示分屏运行应用程序的分屏指令,根据分屏指令,为应用程序设置分屏标记,根据分屏标记,分屏运行应用程序。由于通过分屏标记可以标记出需要分屏运行的应用程序,所以不需要修改框架层的数据结构,便可以达到分屏运行应用程序的目的。另外,通过对单个页面对应的分屏窗口的大小及位置进行控制,具有更大的自由度,使得分屏方案更加灵活。It can be seen from the above that the embodiment receives the split screen instruction for indicating the split screen running application, sets the split screen mark for the application according to the split screen instruction, and runs the application program according to the split screen mark. Since the application that needs to be split screen can be marked by the split screen mark, the data structure of the frame layer does not need to be modified, so that the application of the split screen running application can be achieved. In addition, by controlling the size and position of the split screen window corresponding to a single page, there is greater freedom, which makes the split screen scheme more flexible.
下面以Android系统为例,详细说明本申请技术方案的实施过程。如图6a所示,为本申请的整体统一建模语言(Unified Modeling Language,UML)图。本申请的UML图包括:应用程序部分、分屏入口部分和框架层。应用程序部分包括:组件调节器(ActivityThread)、窗口调节器(WindowScalor)和页面(Activity),WindowScalor是一个控制Activity缩放的工具;分屏入口部分包括:多窗口控制器(MultiWindowController)、多窗口管理器(MultiWindowManager)和多窗口管理服务(MultiWindowManagerService);框架层包括:堆栈管理器(ActivityStackSuperVior)、 页面堆栈(ActivityStack)、任务链表(TaskRecord)、页面记录(ActivityRecord)和浮动窗口层(FloatWindowLayor)。图6b所示为基于UML图实现的分屏运行应用程序的流程。对该流程的详细说明如下:The following takes the Android system as an example to describe in detail the implementation process of the technical solution of the present application. As shown in FIG. 6a, the overall Unified Modeling Language (UML) diagram of the present application. The UML diagram of the present application includes an application portion, a split screen entry portion, and a framework layer. The application part includes: component adjuster (ActivityThread), window adjuster (WindowScalor) and page (Activity), WindowScalor is a tool to control Activity zoom; split screen entry part includes: multi-window controller (MultiWindowController), multi-window management MultiWindowManager and MultiWindowManagerService; the framework layer includes: StackManager (ActivityStackSuperVior), Activity Stack, TaskRecord, ActivityRecord, and Floating Window Layer (FloatWindowLayor). Figure 6b shows the flow of a split-screen running application based on a UML diagram. A detailed description of the process is as follows:
用户通过终端设备上的分屏启动入口(例如侧边栏或分屏预览界面)调用Android系统提供的context.startActivity接口,向Android系统中的框架层(这里的框架层主要是指图6b中的ActivityStackSuperVior)发送intent消息,并在该intent消息中添加一分屏标记,记为flag,用于在向框架层发出启动应用程序的指令的同时,指示分屏运行该应用程序。The user invokes the context.startActivity interface provided by the Android system through the split-screen startup portal on the terminal device (for example, the sidebar or the split-screen preview interface) to the framework layer in the Android system (the framework layer here mainly refers to the image in FIG. 6b). ActivityStackSuperVior) sends an intent message, and adds a split screen mark to the intent message, which is marked as a flag, and is used to instruct the split screen to run the application while issuing an instruction to launch the application to the framework layer.
考虑到运行第一个应用程序时,一般会进入全屏状态,而不是分屏,这样有利于提高屏幕利用率。基于此,框架层收到context.startActivity接口传输的intent消息后,进入启动页面(StartActivityLocked)流程,并需要判断是否需要移除intent消息中的flag,于是启动判断是否需要移除intent消息中的flag的流程,该流程可记为startActivityUncheckedLocked。该操作主要有图6b中的ActivityStackSuperVior指示ActivityStack来完成。值得说明的是,上述流程中的”Locked”只是为了提示该方法流程是线程安全的,Locked本身没有具体意义。Considering that when you run the first application, you will generally enter full screen mode instead of split screen, which will help improve screen utilization. Based on this, after receiving the intent message transmitted by the context.startActivity interface, the framework layer enters the startup page (StartActivityLocked) process, and needs to determine whether the flag in the intent message needs to be removed, so that it is determined whether the flag in the intent message needs to be removed. The process can be recorded as startActivityUncheckedLocked. This operation mainly has the ActivityStackSuperVior in Figure 6b indicating the ActivityStack to complete. It is worth noting that the "Locked" in the above process is only to indicate that the method flow is thread-safe, and Locked itself has no specific meaning.
具体的,框架层(主要是指ActivityStack)根据该应用程序是否是首个请求运行的应用,来确定是否要移除flag(removeFloatFlagIfNeeded),如果是首个请求运行的应用,则需要移除,如果不是首个请求运行的应用,则不移除。如果需要进入全屏状态,则把被桌面挡住的页面都先清空(finishNoneFloatAcitivityUnderHome),以便于全屏运行应用程序。如果需要进入分屏状态,则确定需要根据flag,设置分屏窗口的分屏参数。于是,进入框架层默认的启动Activity的流程。Specifically, the framework layer (mainly referred to as ActivityStack) determines whether to remove the flag (removeFloatFlagIfNeeded) according to whether the application is the first application to run, and if it is the first application to run, it needs to be removed if It is not the first application to request to run, it will not be removed. If you need to enter the full screen state, the page blocked by the desktop will be cleared (finishNoneFloatAcitivityUnderHome) to run the application in full screen. If it is necessary to enter the split screen state, it is determined that the split screen parameter of the split screen window needs to be set according to the flag. So, enter the default process of starting the Activity in the framework layer.
对于应用的首页面(main Activity),首先新建一个TaskRecord,此时,TaskRecord的构造函数会从intent消息里面取数据,由于intent消息里面包含分屏标记,即flag,因此会获取flag将其存到TaskRecord里面,这样该TaskRecord就会被标记为需要分屏。TaskRecord处理好后,ActivityStack会指示ActivitySupervisor进入ActivitySupervisor的真正启动页面(realStartActivityLocked)流程。For the main activity of the application, first create a new TaskRecord. At this time, the constructor of the TaskRecord will fetch the data from the intent message. Since the intent message contains the split-screen flag, ie flag, it will get the flag and save it to Inside TaskRecord, the TaskRecord will be marked as needing to be split. After the TaskRecord is processed, the ActivityStack will instruct the ActivitySupervisor to enter the RealStartActivityLocked process of the ActivitySupervisor.
在realStartActivityLocked流程中,框架层会请求应用程序准备需要展示的页面,具体向应用程序发送第一消息,以请求应用程序准备需要展示的页面;进一步,向应用程序发送第二消息,通过第二消息将分屏窗口的分屏参数传递给应用程序,以供应用程序确定分屏窗口;当应用程序准备好页面后,向框架层发送通知消息,框架层收到通知消 息后,向应用程序发送第三消息,以指示应用程序将准备好的页面展示在分屏窗口中。对应用程序来说,在接收到第三消息后,可以设置main Activity的大小,以使其与分屏窗口相适宜。该过程主要可由图6b中的ActivitySupervisor、ActivityRecord、ActivityThread、WindowScalor和Activity几部分完成。In the realStartActivityLocked process, the framework layer requests the application to prepare the page to be displayed, specifically sending the first message to the application to request the application to prepare the page to be displayed; further, sending the second message to the application, passing the second message Passing the split screen parameter of the split screen window to the application, and determining the split screen window by the application program; when the application prepares the page, sending a notification message to the framework layer, and the framework layer receives the notification After the message, a third message is sent to the application to instruct the application to display the prepared page in the split screen window. For the application, after receiving the third message, you can set the size of the main Activity to make it suitable for the split-screen window. This process can be mainly completed by the ActivitySupervisor, ActivityRecord, ActivityThread, WindowScalor and Activity in Figure 6b.
具体的,应用程序可以调用FloatWindowLayor.layoutActivityRecord(),构造一个LayoutParams对象并对LayoutParams对象的左上角坐标(x,y)、宽度(width)、高度(height)等属性赋值。Specifically, the application can call FloatWindowLayor.layoutActivityRecord() to construct a LayoutParams object and assign values to the top left corner coordinates (x, y), width (width), height (height) of the LayoutParams object.
在此处,FloatWindowLayor.layoutActivityRecord()的主要功能是设置main Activity的位置,具体将其位置定位到分屏窗口处。然后,应用程调用main Activity的setAttributes(WindowManager.LayoutPrams)方法设置main Activity的属性。Here, the main function of FloatWindowLayor.layoutActivityRecord() is to set the location of the main Activity and specifically position it to the split screen window. Then, the application calls the setAttributes(WindowManager.LayoutPrams) method of the main Activity to set the properties of the main Activity.
对于非main Activity,如果该非main Activity与main Activity是共享同一个TaskRecord,由于flag已经存在TaskRecord里面了,因此,可以直接realStartActivityLocked流程,并且在realStartActivityLocked流程中,应用程序也会将非main Activit设置成与main Activity一样的大小。For non-main Activity, if the non-main Activity and the main Activity share the same TaskRecord, since the flag already exists in the TaskRecord, the realStartActivityLocked process can be directly executed, and in the realStartActivityLocked process, the application will also set the non-main Activit to The same size as the main Activity.
对于非main Activity,如果非main Activity与main Activity不共享同一个TaskRecord,需要查找是否已经存在该应用程序的其他Activity对应的TaskRecord,具体可以判断是否存在TaskRecord对应的包名(packageName)与该应用程序的包名相同,若存在,则则取该TaskRecord中的flag设置到当前非main Activity的TaskRecord中,保证非main Activity与main Activity对应相同的flag。之后,进入realStartActivityLocked流程,并且在realStartActivityLocked流程中,应用程序也会将非main Activit设置成与main Activity一样的大小。For a non-main Activity, if the non-main Activity does not share the same TaskRecord with the main Activity, you need to find out whether there is already a TaskRecord corresponding to the other Activity of the application. Specifically, you can determine whether the package name (packageName) corresponding to the TaskRecord exists with the application. The package name is the same. If it exists, the flag in the TaskRecord is set to the current non-main Activity TaskRecord, ensuring that the non-main Activity and the main Activity correspond to the same flag. After that, enter the realStartActivityLocked process, and in the realStartActivityLocked process, the application will also set the non-main Activit to the same size as the main Activity.
由上述可见,本申请通过为应用程序设置分屏标记,根据分屏标记,分屏运行应用程序。由于通过分屏标记可以标记出需要分屏运行的应用程序,所以不需要修改框架层的数据结构,便可以达到分屏运行应用程序的目的。As can be seen from the above, the present application runs the application by split screen according to the split screen mark by setting a split screen mark for the application. Since the application that needs to be split screen can be marked by the split screen mark, the data structure of the frame layer does not need to be modified, so that the application of the split screen running application can be achieved.
需要说明的是,对于前述的各方法实施例,为了简单描述,故将其都表述为一系列的动作组合,但是本领域技术人员应该知悉,本申请并不受所描述的动作顺序的限制,因为依据本申请,某些步骤可以采用其他顺序或者同时进行。其次,本领域技术人员也应该知悉,说明书中所描述的实施例均属于优选实施例,所涉及的动作和模块并不一定是本申请所必须的。It should be noted that, for the foregoing method embodiments, for the sake of simple description, they are all expressed as a series of action combinations, but those skilled in the art should understand that the present application is not limited by the described action sequence. Because certain steps may be performed in other sequences or concurrently in accordance with the present application. In the following, those skilled in the art should also understand that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.
在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述的部分, 可以参见其他实施例的相关描述。In the above embodiments, the descriptions of the various embodiments have different emphasis, and the parts that are not detailed in a certain embodiment, See the related description of other embodiments.
图7为本申请一实施例提供的分屏运行应用的装置的结构示意图。如图7所示,该装置包括:接收模块71、标记模块72和分屏模块73。FIG. 7 is a schematic structural diagram of an apparatus for running a split screen according to an embodiment of the present application. As shown in FIG. 7, the device includes a receiving module 71, a marking module 72, and a split screen module 73.
接收模块71,用于接收用于指示分屏运行应用程序的分屏指令;The receiving module 71 is configured to receive a split screen instruction for indicating a split screen running application;
标记模块72,用于根据分屏指令,为应用程序设置分屏标记;a marking module 72, configured to set a split screen mark for the application according to the split screen instruction;
分屏模块73,用于根据分屏标记,分屏运行应用程序。The split screen module 73 is configured to run the application in a split screen according to the split screen mark.
在一可选实施方式中,标记模块72具体用于:In an optional implementation, the marking module 72 is specifically configured to:
根据分屏指令,在应用程序的任务链表中设置分屏标记,任务链表对应于应用程序需要分屏展示的页面。According to the split screen instruction, a split screen mark is set in the application's task list, and the task list corresponds to a page that the application needs to display on a split screen.
在一可选实施方式中,标记模块72具体用于:In an optional implementation, the marking module 72 is specifically configured to:
当需要分屏展示的页面是首页面时,为首页面创建任务链表,根据分屏指令,获得分屏标记,将分屏标记设置在任务链表中;When the page that needs to be displayed by the split screen is the first page, a task linked list is created for the first page, and according to the split screen instruction, the split screen mark is obtained, and the split screen mark is set in the task linked list;
当需要分屏展示的页面是非首页面时,若非首页面不与首页面共用任务链表,则为非首页面创建一新任务链表,从应用程序对应的已存在的任务链表中获取分屏标记,将分屏标记设置在新任务链表中。When the page that needs to be displayed by the screen is not the first page, if the first page does not share the task list with the first page, a new task list is created for the non-first page, and the split screen mark is obtained from the existing task list corresponding to the application. Set the split screen marker in the new task list.
在一可选实施方式中,标记模块72具体用于:In an optional implementation, the marking module 72 is specifically configured to:
从分屏指令中获取分屏标记;或者Obtain a split screen mark from the split screen command; or
根据分屏指令,生成分屏标记。A split screen mark is generated according to the split screen command.
在一可选实施方式中,分屏模块73具体用于:In an optional implementation, the split screen module 73 is specifically configured to:
根据分屏标记,为应用程序设置分屏窗口的分屏参数;According to the split screen mark, set the split screen parameter of the split screen window for the application;
将分屏参数提供给应用程序,以供应用程序根据分屏参数将页面展示在分屏窗口中。The split screen parameters are provided to the application, and the application program displays the page in the split screen window according to the split screen parameters.
在一可选实施方式中,分屏模块73具体用于:In an optional implementation, the split screen module 73 is specifically configured to:
向应用程序发送第一消息,以通知应用程序准备页面;Send a first message to the application to notify the application to prepare the page;
向应用程序发送第二消息,第二消息包括分屏参数,以供应用程序确定分屏窗口;Sending a second message to the application, the second message includes a split screen parameter, and the application program determines the split screen window;
在接收到应用程序发送的用于通知准备好页面的消息后,向应用程序发送第三消息,以指示应用程序将页面展示在分屏窗口中。After receiving the message sent by the application to notify the prepared page, a third message is sent to the application to instruct the application to display the page in the split screen window.
在一可选实施方式中,分屏模块73具体用于:In an optional implementation, the split screen module 73 is specifically configured to:
根据分屏标记,将整个屏幕划分为至少两个子屏幕;Dividing the entire screen into at least two sub-screens according to the split screen mark;
确定分屏窗口所在的目标子屏幕;Determining the target sub-screen where the split screen window is located;
根据目标子屏幕的屏幕参数,设置分屏窗口的分屏参数。 Set the split screen parameters of the split screen window according to the screen parameters of the target sub screen.
在一可选实施方式中,分屏模块73还用于:In an alternative embodiment, the split screen module 73 is further configured to:
在分屏窗口中展示应用程序的对话框。The application's dialog box is displayed in the split screen window.
在一可选实施方式中,分屏模块73具体用于:In an optional implementation, the split screen module 73 is specifically configured to:
当应用程序需要展示对话框时,确定对话框关联于分屏窗口当前展示的页面;When the application needs to display a dialog box, the determination dialog box is associated with the currently displayed page of the split screen window;
根据分屏窗口的分屏参数,确定对话框的大小及弹出位置属性参数;Determine the size of the dialog box and the pop-up position attribute parameter according to the split screen parameter of the split screen window;
根据对话框的大小及弹出位置,在分屏窗口中弹出对话框。Depending on the size of the dialog box and the pop-up position, a dialog box pops up in the split screen window.
在一可选实施方式中,本实施例的装置还包括,判断模块,用于判断应用程序是否是首个运行的应用;若判断结果为是,则禁止标记模块将分屏标记设置到任务链表中;若判断结果为否,则触发标记模块将分屏标记设置到任务链表中。In an optional implementation, the apparatus of this embodiment further includes: a determining module, configured to determine whether the application is the first running application; if the determination result is yes, the prohibiting marking module sets the split screen flag to the task linked list If the result of the determination is no, the trigger tag module sets the split screen tag to the task list.
可选的,上述分屏指令为用户通过分屏启动入口发出的用于启动应用程序的启动指令。Optionally, the split screen command is a startup command sent by the user through the split screen startup entry to start the application.
本实施例提供的装置,接收用于指示分屏运行应用程序的分屏指令,根据分屏指令,为应用程序设置分屏标记,根据分屏标记,分屏运行应用程序。由于通过分屏标记可以标记出需要分屏运行的应用程序,所以不需要修改框架层的数据结构,便可以达到分屏运行应用程序的目的。The device provided in this embodiment receives a split screen instruction for instructing a split screen running application, and sets a split screen mark for the application according to the split screen instruction, and runs the application program according to the split screen mark. Since the application that needs to be split screen can be marked by the split screen mark, the data structure of the frame layer does not need to be modified, so that the application of the split screen running application can be achieved.
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统,装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。A person skilled in the art can clearly understand that for the convenience and brevity of the description, the specific working process of the system, the device and the unit described above can refer to the corresponding process in the foregoing method embodiment, and details are not described herein again.
在本发明所提供的几个实施例中,应该理解到,所揭露的系统,装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided by the present invention, it should be understood that the disclosed system, apparatus, and method may be implemented in other manners. For example, the device embodiments described above are merely illustrative. For example, the division of the unit is only a logical function division. In actual implementation, there may be another division manner, for example, multiple units or components may be combined or Can be integrated into another system, or some features can be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, and may be in an electrical, mechanical or other form.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
另外,在本发明各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用硬件加软件功能单元的形式实现。 In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above integrated unit can be implemented in the form of hardware or in the form of hardware plus software functional units.
上述以软件功能单元的形式实现的集成的单元,可以存储在一个计算机可读取存储介质中。上述软件功能单元存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)或处理器(processor)执行本发明各个实施例所述方法的部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。The above-described integrated unit implemented in the form of a software functional unit can be stored in a computer readable storage medium. The above software functional unit is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor to perform the methods of the various embodiments of the present invention. Part of the steps. The foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, and the like, which can store program codes. .
最后应说明的是:以上实施例仅用以说明本发明的技术方案,而非对其限制;尽管参照前述实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明各实施例技术方案的精神和范围。 It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and are not limited thereto; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that The technical solutions described in the foregoing embodiments are modified, or the equivalents of the technical features are replaced. The modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims (22)

  1. 一种分屏运行应用的方法,其特征在于,包括:A method for running a split screen application, comprising:
    接收用于指示分屏运行应用程序的分屏指令;Receiving a split screen instruction for instructing the split screen to run the application;
    根据所述分屏指令,为所述应用程序设置分屏标记;Setting a split screen mark for the application according to the split screen instruction;
    根据所述分屏标记,分屏运行所述应用程序。The application is run on a split screen according to the split screen mark.
  2. 根据权利要求1所述的方法,其特征在于,所述根据所述分屏指令,为所述应用程序设置分屏标记,包括:The method according to claim 1, wherein the setting a split screen mark for the application according to the split screen instruction comprises:
    根据所述分屏指令,在所述应用程序的任务链表中设置所述分屏标记,所述任务链表对应于所述应用程序需要分屏展示的页面。And setting, according to the split screen instruction, the split screen mark in a task list of the application, where the task link table corresponds to a page that the application needs to display in a split screen.
  3. 根据权利要求2所述的方法,其特征在于,所述根据所述分屏指令,在所述应用程序的任务链表中设置所述分屏标记,包括:The method according to claim 2, wherein the setting the split screen mark in the task list of the application according to the split screen instruction comprises:
    当需要分屏展示的页面是首页面时,为所述首页面创建任务链表,根据所述分屏指令,获得所述分屏标记,将所述分屏标记设置在所述任务链表中;When the page that needs to be displayed by the split screen is the first page, a task linked list is created for the first page, and the split screen mark is obtained according to the split screen instruction, and the split screen mark is set in the task linked list;
    当需要分屏展示的页面是非首页面时,若所述非首页面不与所述首页面共用任务链表,则为所述非首页面创建一新任务链表,从所述应用程序对应的已存在的任务链表中获取所述分屏标记,将所述分屏标记设置在所述新任务链表中。When the page that needs to be displayed by the screen is a non-first page, if the non-first page does not share the task list with the first page, a new task list is created for the non-first page, and the corresponding corresponding application from the application Obtaining the split screen mark in the task list, and setting the split screen mark in the new task list.
  4. 根据权利要求3所述的方法,其特征在于,所述根据所述分屏指令,获得所述分屏标记,包括:The method according to claim 3, wherein the obtaining the split screen mark according to the split screen instruction comprises:
    从所述分屏指令中获取所述分屏标记;或者Obtaining the split screen mark from the split screen command; or
    根据所述分屏指令,生成所述分屏标记。And generating the split screen mark according to the split screen instruction.
  5. 根据权利要求2所述的方法,其特征在于,所述根据所述分屏标记,分屏运行所述应用程序,包括:The method according to claim 2, wherein the running the application in a split screen according to the split screen mark comprises:
    根据所述分屏标记,为所述应用程序设置分屏窗口的分屏参数;Setting a split screen parameter of the split screen window for the application according to the split screen mark;
    将所述分屏参数提供给所述应用程序,以供所述应用程序根据所述分屏参数将所述页面展示在所述分屏窗口中。Providing the split screen parameter to the application for the application to display the page in the split screen window according to the split screen parameter.
  6. 根据权利要求5所述的方法,其特征在于,所述将所述分屏参数提供给所述应用程序,以供所述应用程序根据所述分屏参数将所述页面展示在所述分屏窗口中,包括:The method according to claim 5, wherein said providing said split screen parameter to said application for said application to display said page on said split screen according to said split screen parameter In the window, including:
    向所述应用程序发送第一消息,以通知所述应用程序准备所述页面;Sending a first message to the application to notify the application to prepare the page;
    向所述应用程序发送第二消息,所述第二消息包括所述分屏参数,以供所述应用程序确定所述分屏窗口; Sending a second message to the application, the second message including the split screen parameter, for the application to determine the split screen window;
    在接收到所述应用程序发送的用于通知准备好所述页面的消息后,向所述应用程序发送第三消息,以指示所述应用程序将所述页面展示在所述分屏窗口中。After receiving the message sent by the application to notify that the page is ready, a third message is sent to the application to instruct the application to display the page in the split screen window.
  7. 根据权利要求5所述的方法,其特征在于,所述根据所述分屏标记,为所述应用程序设置分屏窗口的分屏参数,包括:The method according to claim 5, wherein the setting a split screen parameter of the split screen window for the application according to the split screen mark comprises:
    根据所述分屏标记,将整个屏幕划分为至少两个子屏幕;Dividing the entire screen into at least two sub-screens according to the split screen mark;
    确定所述分屏窗口所在的目标子屏幕;Determining a target sub-screen where the split screen window is located;
    根据所述目标子屏幕的屏幕参数,设置所述分屏窗口的分屏参数。Setting a split screen parameter of the split screen window according to a screen parameter of the target sub screen.
  8. 根据权利要求5所述的方法,其特征在于,所述根据所述分屏标记,分屏运行所述应用程序,还包括:The method according to claim 5, wherein the running the application in a split screen according to the split screen mark further comprises:
    在所述分屏窗口中展示所述应用程序的对话框。A dialog box of the application is displayed in the split screen window.
  9. 根据权利要求8所述的方法,其特征在于,在所述分屏窗口中展示所述应用程序的对话框,包括:The method according to claim 8, wherein the dialog box of the application is displayed in the split screen window, comprising:
    当所述应用程序需要展示对话框时,确定所述对话框关联于所述分屏窗口当前展示的页面;When the application needs to display a dialog box, determining that the dialog box is associated with a page currently displayed by the split screen window;
    根据所述分屏窗口的分屏参数,确定所述对话框的大小及弹出位置属性参数;Determining a size of the dialog box and a pop-up position attribute parameter according to the split screen parameter of the split screen window;
    根据所述对话框的大小及弹出位置,在所述分屏窗口中弹出所述对话框。The dialog box is popped up in the split screen window according to the size of the dialog box and the popup position.
  10. 根据权利要求3所述的方法,其特征在于,所述将所述分屏标记设置在所述任务链表中之前,包括:The method according to claim 3, wherein said setting the split screen mark before the task list comprises:
    判断所述应用程序是否是首个运行的应用;Determining whether the application is the first running application;
    若判断结果为是,则禁止将所述分屏标记设置到所述任务链表中;If the determination result is yes, setting the split screen mark to the task linked list is prohibited;
    若判断结果为否,则将所述分屏标记设置到所述任务链表中。If the judgment result is no, the split screen mark is set to the task list.
  11. 根据权利要求1-10任一项所述的方法,其特征在于,所述分屏指令为用户通过分屏启动入口发出的用于启动所述应用程序的启动指令。The method according to any one of claims 1 to 10, wherein the split screen instruction is a start command issued by a user through a split screen start entry for starting the application.
  12. 一种分屏运行应用的装置,其特征在于,包括:A device for split screen operation application, comprising:
    接收模块,用于接收用于指示分屏运行应用程序的分屏指令;a receiving module, configured to receive a split screen instruction for instructing the split screen to run the application;
    标记模块,用于根据所述分屏指令,为所述应用程序设置分屏标记;a marking module, configured to set a split screen mark for the application according to the split screen instruction;
    分屏模块,用于根据所述分屏标记,分屏运行所述应用程序。a split screen module, configured to run the application in a split screen according to the split screen mark.
  13. 根据权利要求12所述的装置,其特征在于,所述标记模块具体用于:The device according to claim 12, wherein the marking module is specifically configured to:
    根据所述分屏指令,在所述应用程序的任务链表中设置所述分屏标记,所述任务链表对应于所述应用程序需要分屏展示的页面。 And setting, according to the split screen instruction, the split screen mark in a task list of the application, where the task link table corresponds to a page that the application needs to display in a split screen.
  14. 根据权利要求13所述的装置,其特征在于,所述标记模块具体用于:The device according to claim 13, wherein the marking module is specifically configured to:
    当需要分屏展示的页面是首页面时,为所述首页面创建任务链表,根据所述分屏指令,获得所述分屏标记,将所述分屏标记设置在所述任务链表中;When the page that needs to be displayed by the split screen is the first page, a task linked list is created for the first page, and the split screen mark is obtained according to the split screen instruction, and the split screen mark is set in the task linked list;
    当需要分屏展示的页面是非首页面时,若所述非首页面不与所述首页面共用任务链表,则为所述非首页面创建一新任务链表,从所述应用程序对应的已存在的任务链表中获取所述分屏标记,将所述分屏标记设置在所述新任务链表中。When the page that needs to be displayed by the screen is a non-first page, if the non-first page does not share the task list with the first page, a new task list is created for the non-first page, and the corresponding corresponding application from the application Obtaining the split screen mark in the task list, and setting the split screen mark in the new task list.
  15. 根据权利要求14所述的装置,其特征在于,所述标记模块具体用于:The device according to claim 14, wherein the marking module is specifically configured to:
    从所述分屏指令中获取所述分屏标记;或者Obtaining the split screen mark from the split screen command; or
    根据所述分屏指令,生成所述分屏标记。And generating the split screen mark according to the split screen instruction.
  16. 根据权利要求13所述的装置,其特征在于,所述分屏模块具体用于:The device according to claim 13, wherein the split screen module is specifically configured to:
    根据所述分屏标记,为所述应用程序设置分屏窗口的分屏参数;Setting a split screen parameter of the split screen window for the application according to the split screen mark;
    将所述分屏参数提供给所述应用程序,以供所述应用程序根据所述分屏参数将所述页面展示在所述分屏窗口中。Providing the split screen parameter to the application for the application to display the page in the split screen window according to the split screen parameter.
  17. 根据权利要求16所述的装置,其特征在于,所述分屏模块具体用于:The device according to claim 16, wherein the split screen module is specifically configured to:
    向所述应用程序发送第一消息,以通知所述应用程序准备所述页面;Sending a first message to the application to notify the application to prepare the page;
    向所述应用程序发送第二消息,所述第二消息包括所述分屏参数,以供所述应用程序确定所述分屏窗口;Sending a second message to the application, the second message including the split screen parameter, for the application to determine the split screen window;
    在接收到所述应用程序发送的用于通知准备好所述页面的消息后,向所述应用程序发送第三消息,以指示所述应用程序将所述页面展示在所述分屏窗口中。After receiving the message sent by the application to notify that the page is ready, a third message is sent to the application to instruct the application to display the page in the split screen window.
  18. 根据权利要求16所述的装置,其特征在于,所述分屏模块具体用于:The device according to claim 16, wherein the split screen module is specifically configured to:
    根据所述分屏标记,将整个屏幕划分为至少两个子屏幕;Dividing the entire screen into at least two sub-screens according to the split screen mark;
    确定所述分屏窗口所在的目标子屏幕;Determining a target sub-screen where the split screen window is located;
    根据所述目标子屏幕的屏幕参数,设置所述分屏窗口的分屏参数。Setting a split screen parameter of the split screen window according to a screen parameter of the target sub screen.
  19. 根据权利要求16所述的装置,其特征在于,所述分屏模块还用于:The device according to claim 16, wherein the split screen module is further configured to:
    在所述分屏窗口中展示所述应用程序的对话框。A dialog box of the application is displayed in the split screen window.
  20. 根据权利要求19所述的装置,其特征在于,所述分屏模块具体用于:The device according to claim 19, wherein the split screen module is specifically configured to:
    当所述应用程序需要展示对话框时,确定所述对话框关联于所述分屏窗口当前展示的页面;When the application needs to display a dialog box, determining that the dialog box is associated with a page currently displayed by the split screen window;
    根据所述分屏窗口的分屏参数,确定所述对话框的大小及弹出位置属性参数;Determining a size of the dialog box and a pop-up position attribute parameter according to the split screen parameter of the split screen window;
    根据所述对话框的大小及弹出位置,在所述分屏窗口中弹出所述对话框。 The dialog box is popped up in the split screen window according to the size of the dialog box and the popup position.
  21. 根据权利要求14所述的装置,其特征在于,还包括:The device according to claim 14, further comprising:
    判断模块,用于判断所述应用程序是否是首个运行的应用;若判断结果为是,则禁止所述标记模块将所述分屏标记设置到所述任务链表中;若判断结果为否,则触发所述标记模块将所述分屏标记设置到所述任务链表中。a determining module, configured to determine whether the application is the first running application; if the determination result is yes, prohibiting the marking module from setting the split screen mark into the task linked list; if the determining result is no, The tagging module is then triggered to set the split screen tag into the task list.
  22. 根据权利要求12-21任一项所述的装置,其特征在于,所述分屏指令为用户通过分屏启动入口发出的用于启动所述应用程序的启动指令。 The apparatus according to any one of claims 12 to 21, wherein the split screen instruction is a start command issued by a user through a split screen start entry for starting the application.
PCT/CN2016/076567 2015-03-26 2016-03-17 Application screen-splitting running method and device WO2016150325A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201510135127.9 2015-03-26
CN201510135127.9A CN106155768B (en) 2015-03-26 2015-03-26 Method and device for running application in split screen mode

Publications (1)

Publication Number Publication Date
WO2016150325A1 true WO2016150325A1 (en) 2016-09-29

Family

ID=56978991

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/076567 WO2016150325A1 (en) 2015-03-26 2016-03-17 Application screen-splitting running method and device

Country Status (2)

Country Link
CN (1) CN106155768B (en)
WO (1) WO2016150325A1 (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2018177149A1 (en) * 2017-03-31 2018-10-04 捷开通讯(深圳)有限公司 Terminal, split-screen display method for screen thereof, and storage device
CN110377260A (en) * 2019-08-29 2019-10-25 湖北亿咖通科技有限公司 A kind of Multi-screen display system and method
CN111736928A (en) * 2020-06-22 2020-10-02 Oppo(重庆)智能科技有限公司 Picture-in-picture mode starting method and device and computer readable storage medium
CN116701795A (en) * 2022-10-18 2023-09-05 荣耀终端有限公司 Page display method and electronic equipment

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107506200A (en) * 2017-09-12 2017-12-22 深圳市金立通信设备有限公司 A kind of screen content switching method, terminal and computer-readable recording medium
CN112261220A (en) * 2020-09-18 2021-01-22 湖北亿咖通科技有限公司 Split screen display method applied to terminal

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090249235A1 (en) * 2008-03-25 2009-10-01 Samsung Electronics Co. Ltd. Apparatus and method for splitting and displaying screen of touch screen
CN103605524A (en) * 2013-11-26 2014-02-26 广东欧珀移动通信有限公司 Method and device for running programs on mobile terminal in split-screen manner
CN103870112A (en) * 2014-02-17 2014-06-18 联想(北京)有限公司 Information processing method and electronic equipment
CN104049866A (en) * 2014-06-25 2014-09-17 深圳市中兴移动通信有限公司 Mobile terminal and method and device for achieving screen splitting of mobile terminal

Family Cites Families (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8678901B1 (en) * 2005-09-07 2014-03-25 Bally Gaming System gaming
US8437256B2 (en) * 2006-01-10 2013-05-07 Utbk, Llc Systems and methods to provide communication connections
US8473851B2 (en) * 2008-02-27 2013-06-25 Cisco Technology, Inc. Multi-party virtual desktop
US8600446B2 (en) * 2008-09-26 2013-12-03 Htc Corporation Mobile device interface with dual windows
CN103034390B (en) * 2011-09-30 2016-09-21 汉王科技股份有限公司 The method and device of mobile applications between multiple split screens of mobile terminal
CN102411479B (en) * 2011-12-27 2014-02-12 汉王科技股份有限公司 Split screen switching method and device of portable electronic equipment
CN103365525B (en) * 2012-03-28 2017-05-10 百度在线网络技术(北京)有限公司 Mobile terminal and multi-window displaying method for mobile terminal
CN103558959B (en) * 2013-10-31 2016-08-17 青岛海信移动通信技术股份有限公司 A kind of method and apparatus of the display window being applied to Android platform
CN103559055B (en) * 2013-10-31 2017-02-22 青岛海信移动通信技术股份有限公司 Activity starting method and device applied to Android platform
CN104346216A (en) * 2014-05-30 2015-02-11 广州三星通信技术研究有限公司 Multi-mask execution method and equipment for electronic equipment
CN104182196A (en) * 2014-08-26 2014-12-03 深圳市中兴移动通信有限公司 Multi-screen display method and mobile terminal
CN104238949B (en) * 2014-10-12 2017-10-03 福州瑞芯微电子股份有限公司 A kind of multi-screen display method and device
CN104461242B (en) * 2014-12-08 2017-12-01 深圳市嘉乐派科技有限公司 A kind of multi-window interface implementation method based on Android operation system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090249235A1 (en) * 2008-03-25 2009-10-01 Samsung Electronics Co. Ltd. Apparatus and method for splitting and displaying screen of touch screen
CN103605524A (en) * 2013-11-26 2014-02-26 广东欧珀移动通信有限公司 Method and device for running programs on mobile terminal in split-screen manner
CN103870112A (en) * 2014-02-17 2014-06-18 联想(北京)有限公司 Information processing method and electronic equipment
CN104049866A (en) * 2014-06-25 2014-09-17 深圳市中兴移动通信有限公司 Mobile terminal and method and device for achieving screen splitting of mobile terminal

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2018177149A1 (en) * 2017-03-31 2018-10-04 捷开通讯(深圳)有限公司 Terminal, split-screen display method for screen thereof, and storage device
US11256400B2 (en) 2017-03-31 2022-02-22 Jrd Communication (Shenzhen) Ltd Terminal, split-screen display method for screen thereof, and storage device
CN110377260A (en) * 2019-08-29 2019-10-25 湖北亿咖通科技有限公司 A kind of Multi-screen display system and method
CN110377260B (en) * 2019-08-29 2024-01-05 亿咖通(湖北)技术有限公司 Multi-screen display system and method
CN111736928A (en) * 2020-06-22 2020-10-02 Oppo(重庆)智能科技有限公司 Picture-in-picture mode starting method and device and computer readable storage medium
CN116701795A (en) * 2022-10-18 2023-09-05 荣耀终端有限公司 Page display method and electronic equipment

Also Published As

Publication number Publication date
CN106155768A (en) 2016-11-23
CN106155768B (en) 2020-03-31

Similar Documents

Publication Publication Date Title
WO2016150325A1 (en) Application screen-splitting running method and device
US11307745B2 (en) Operating method for multiple windows and electronic device supporting the same
US10613701B2 (en) Customizable bladed applications
US20230049473A1 (en) Method and device for managing tab window indicating application group including heterogeneous applications
US8732287B2 (en) System for managing a virtualization solution and management server and method for managing the same
CN109074276B (en) Tab in system task switcher
AU2014296339B2 (en) Multi-monitor full screen mode in a windowing environment
KR20160013162A (en) User interface elements for multiple displays
EP2306307A2 (en) Terminal apparatus, server apparatus, display control method, and program
US20170351537A1 (en) Virtual machine content presentation
CN111049935B (en) System for remotely controlling electronic equipment and electronic equipment thereof
US20150205498A1 (en) Automatic wallpaper image changer for a computing device
TWI534694B (en) Computer implemented method and computing device for managing an immersive environment
JP2015111459A (en) Method for controlling system bar in user device, and user device
WO2017167126A1 (en) Window display method, information exchange method and system
JP2008204239A (en) Electronic computer and implementation method of user interface by software
CN106233243A (en) Many frameworks manager
WO2017078132A1 (en) Mobile terminal and application program
US9582158B2 (en) Efficient usage of screen real estate on an electronic device
CN105786300B (en) A kind of information processing method and electronic equipment
JP2009104270A5 (en)
TW201324348A (en) Widget displaying system for handheld apparatus and method thereof

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 16767702

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 16767702

Country of ref document: EP

Kind code of ref document: A1