The content of the invention
It is a primary object of the present invention to provide a kind of multi-window interface implementation method based on Android operation system,It may be implemented in above Android device screen while show multiple application widgets, and user can not exit current applicationIn the case of open new application, give user one extraordinary operating experience.
To achieve the above object, a kind of multi-window interface realization side based on Android operation system proposed by the present inventionMethod, the system assure reason service unit, campaign management services unit, window management service unit, the implementation methodSpecifically include following steps:
A, user terminal starts new application widget, and corresponding information is sent to campaign management services unit;
B, campaign management services unit parses intended application information according to the information sended over, and verification starts authority,Success is such as verified, step C is performed, such as verification failure, starts failure;
C, intended application information is informed that window management service unit is ready for application widget by campaign management services unitSwitching;
D, the new application of campaign management services unit starting;
E, window management service unit according to the configuration information of new application widget is its dispensing position and non-full frame bigIt is small;
F, it is new to apply the window interface of oneself of being painted in the window of distribution, window management service unit after the completion of drawingNew application widget is shown, start completion;
G, in campaign management services unit set sleeve ought to basic scheme, realize application widget application behaviourMake demand.
Further, start new application widget in step A to comprise the following steps:
A1, activation system, calling assure reason service unit, and obtain current all installations applies package informatin list;
A2, extract all application icons using in package informatin and its corresponding startup relevant information;
A3, one is created from icon to the Map relation lists for starting relevant information;
A4, create a system windows and all application icons are added in window;
A5, the situation of change monitoring system applied in system is broadcasted;
A6, one all application button of addition to navigation bar Far Left;
If A7, user click on all application buttons, system windows of the display equipped with all application icons;If user clicks on certainIndividual icon, found by icon to the Map relation lists for starting relevant information and start relevant information corresponding to the icon;
A8, campaign management services unit is called, start application.
Further, monitoring system broadcast comprises the following steps described in step A5:
A51, system application bag relevant broadcasts are received, judge broadcast type;Installed if broadcast type is application, perform stepRapid A52;Unloaded if broadcast type is application, perform step A53, if broadcast type is application upgrade, perform step A54;
A52, the package informatin in broadcast call and assure reason service unit, extract all icons in the application bag newly installedAnd its corresponding startup information, if number of icons is more than zero, these icons and its corresponding startup information are added to Map and closedIn series of tables;If number of icons is less than zero, terminate to monitor;
A53, the package informatin in broadcast delete the Map elements of all bags correlation in Map tabulated relationship lists;
A54, the new package informatin in broadcast call all icons and its corresponding startup in the new application bag of PMS extractionsRelevant information;Map relation lists are traveled through, are contrasted with the icon information extracted;Delete the icon Map members being not present in new bagElement, add icon new in new bag and start relevant information Map elements;
A55, according to new Map relation list reconstructing system windows, terminate to monitor.
Further, window management service unit distributes position according to the configuration information of new application widget for it in step EPut and comprise the following steps with size:
E1, screen is fixed as transverse screen mode, ordinate value is fixed as to the height of status bar;
E2, judge attribute of the application widget for transverse screen portrait layout, application widget width and initial horizontal are calculated according to window attributeCoordinate value;
E3, a set of portrait layout configuration item is set, when system starts portrait layout application model, copies this set portrait layout configuration item, withRealize normally being shown on transverse screen using pressure for portrait layout.
Further, the computational methods described in step E2 include:
E21, application widget width is calculated, if application widget is portrait layout, it is that 1/3rd horizontal screens are wide to set window width;If application widget is transverse screen, it is that 2/3rds horizontal screens are wide to set window width;
E22, initial abscissa value is calculated, two counters are set, counted the system since system starts respectively and openThe transverse screen and the quantity of portrait layout application widget crossed, it is new one initial abscissa of window calculation according to count results, forWindow is dragged, according to the size and location of current focus window, to determine the final abscissa value of new application widget ".
Further, calculating the computational methods of initial abscissa described in step E22 for new window includes:
The quantity of system opened transverse screen and portrait layout application widget of the rolling counters forward since system starts is respectivelyCH and CP, laterally shield a width of SW, the initial abscissa of window is X, if application widget if portrait layout,:X=(CP Mod 3) *1/3SW;
If application widget if transverse screen,:When (CH Mod 2)=0, X=0;When (CH Mod 2)=1, X=1/3SW。
Further, the computational methods of final abscissa value include described in step E22:
E221, the width for obtaining current focus window and abscissa value;
Whether E222, the width of calculating current focus window are equal to laterally screen width, if so, then focus window is full frame width,The initial abscissa value of application widget is set as zero;If it is not, then perform step E223;
Whether E223, calculating application widget and current focus window width, which are equal to 2/3rds, laterally shields width, if so,Then illustrate that application widget and focus window intersect, without processing, terminate to calculate;If it is not, then calculating new window and focus window isIt is no intersecting, if non-intersect, without processing, terminate to calculate;If intersecting, step E224 is performed;
E224, calculate application widget width whether be equal to 2/3rds laterally screen it is wide, if if so, application widget justBeginning abscissa value is zero, then final abscissa value is that 1/3rd horizontal screens are wide, if the initial abscissa value of application widget is1/3rd laterally shield width, then final abscissa value is zero;If it is not, if the initial abscissa value of application widget is 2/3rdsLaterally shield width, then final abscissa value is zero, and otherwise, final abscissa value is that initial abscissa value laterally shields width with 1/3rdSum.
E225, whether calculating new window and focus window intersect again, if if so, the initial abscissa value of application widgetFor 2/3rds laterally screen it is wide, then final abscissa value is zero, otherwise final abscissa value be initial abscissa value with three/One laterally shields wide sum;If it is not, without processing, terminate to calculate.
Further, step E3 specifically includes following steps:
Whether E31, the direction configuration item for judging application window interface itself are portrait layout, if so, system generation is a set ofThe configuration item of portrait layout;If it is not, system generates the configuration item of a set of transverse screen;
E32, application program copy newly-generated system configuration item;
E33, application program, to travel through its resource file, find that most match according to newly-generated system configuration itemSet;
E34, that a set of resource file most matched is used for interface display.
Preferably, application operating described in step G includes opening, close, minimize and recover application widget and from navigationColumn icon switching focus application widget, and reduce, amplify, dragging application widget and by clicking on inside non-focus application widgetTo switch application widget;
The opening application widget specifically includes following steps:
G11, current all icons for opening application are shown on navigation bar, the number for opening application is limited;
G12, campaign management services unit receive the request for opening application widget, judge whether that App stacks (are used for managingThe stack of non-desktop application), if in the presence of finding App Task corresponding to the application in App stacks (in the operation of non-desktop applicationApplication), such as find corresponding to App Task, the App Task found are moved to the tops of App stacks, if the App TaskState be then set to Started (beginning) for Paused (stoppings), otherwise execution step G3;If being not present, App is createdStack, perform step G13;
G13, a new App Task is created, Task (operating application) state of setting is Started, will be newApp Task are added to the top of App stacks;
G14, App stacks are set to focus stack, the App Task are corresponded into window is set to focus window;
The new application widget of G15, display;
G16, Task To Front (task to foreground) broadcast and the subsidiary Task relevant informations are sent, ended task;
Recover application widget described in step G and specifically include following steps:
G21, campaign management services unit receive requests of the mobile Task to foreground, the subsidiary Task ID (operations of requestIn application identifier);
G22, found in App stacks according to Task ID corresponding to App Task, if finding, step G23 is performed, if not looking forArrive, end task;
G23, the App Task found are moved to App stack tops, if application widget corresponding to the App Task is hiddenHide and then call window display unit to show it, Started is set to if the state of the App Task is Paused;
G24, the App Task are corresponded into application widget it is set to focus window;
G25, transmission Task To Front are broadcasted and are attached the Task relevant informations, are ended task;
Application widget is minimized described in step G and specifically includes following steps:
G31, campaign management services unit receive requests of the mobile Task to backstage, the subsidiary Task ID of request;
G32, found in App stacks according to Task ID corresponding to App Task, if finding, step G33 is performed, if not looking forArrive, end task;
G33, the App Task found are moved to App stacks bottom, by it if the state of the App Task is StartedIt is arranged to Paused and calls window display unit to hide its window;
G34, the App Task for obtaining App stack tops, judge whether App Task states are Started, if so, shouldAppTask corresponds to application widget and is set to focus window;If it is not, Home stacks (the Task stacks for being used for managing desktop application) are set to burntPoint stack, Home Task (Task of desktop application operation) corresponding desktop window is set to focus window;
G35, transmission Task To Front are broadcasted and are attached the Task relevant informations, are ended task;
Application widget is closed described in step G and specifically includes following steps:
G41, campaign management services unit receive the request for deleting Task, the subsidiary Task ID of request;
G42, found in App stacks according to Task ID corresponding to App Task, if finding, step G43 is performed, if not looking forArrive, end task;
G43, WMS is called to hide its window if the App Task found state is Started, by the App TaskMove from App stack deletions;
G44, the App Task for obtaining App stack tops, judge whether App Task states are Started, if so, by the AppTask corresponds to application widget and is set to focus window;If it is not, Home stacks (the Task stacks for being used for managing desktop application) are set to focusStack, Home Task are corresponded into desktop window and are set to focus window;
G45, transmission Task To Front are broadcasted and are attached the Task relevant informations, are ended task.
Reduce, amplify described in step G, dragging application widget and switch application by clicking on inside non-focus application widgetWindow specifically includes following steps:
G51, a global touch input event sniffer is set, for monitoring touch input thing all on screenPart, such as press, move, let go, while get the coordinate of point corresponding to each event;
G52, the value up and down for recording focus window, judge whether touch point falls in focus window according to these valuesOn, do not dealt with then in non-application widget when touch point falls, and when touch point falls in focus window, whether judge itIt is in focus window in top N number of pixel (pixel) height region, when falling in the N number of pixel height area in focus window topWhen in domain, you can dragged or zoom, otherwise when falling in non-focus window, then travel through current institute from top to bottomSome non-focus windows, fallen with finding the point in which application widget, have found and the window is not desktop window, then adjustCorresponding task is moved to foreground with AMS, so have switched focus window.
The present invention is by transforming the application framework layer of android system so that it supports that multiple application widgets are sameWhen be shown on device screen, can thus make full use of the device screen space compared with large-size screen monitors, while solve poor user experienceThe problem of, due to using the above method, making the present invention that there is advantages below:
1st, multiple application widgets can be simultaneously displayed on screen, and are not interfere with each other;Window is avoided to a certain extentOverlap problem, make full use of limited screen space;
2nd, user can open new application widget in the case of without exiting current application window;
3rd, the dragging of window, scaling, minimum and recovery, closing etc. are easy to operate simple, it is only necessary to which single finger canTo be easily accomplished.
The feature and advantage of the present invention will be described in detail by embodiment combination accompanying drawing.
Embodiment
In order to make the purpose , technical scheme and advantage of the present invention be clearer, it is right below in conjunction with drawings and ExamplesThe present invention is further elaborated.It should be appreciated that the specific embodiments described herein are merely illustrative of the present invention, andIt is not used in the restriction present invention.
As shown in figure 1, the present invention includes:
Bag management service Package Manager Service (PMS) unit:The application program of android system be with.apk file form provide, and this file in systems be mounted after be to be managed in the form of wrapping (Package),System has a special service to be responsible for all in system answer bag management service (Package Manager Service)With the bag of program, including the installation path of APMB package, the various configurations in bag, resource file etc.;
Campaign management services Act ivi ty Manager Service (AMS) unit:Application program in android systemUser interface be the corresponding window page of an Act ivi ty object existing in the form of movable (Act ivi ty)Face, system have a special service to be responsible for system institute campaign management services (Act ivi ty Manager Service)Some Act ivi ty objects, including start, suspend, stopping, terminating etc. whole life cycle.Meanwhile AMS is also responsible for managingThe startup of application process, stopping, OOM parameter settings etc.;
Window management services Window Manager Service (WMS) unit:Window management service is responsible for window(Window) special service of the management of object, a corresponding Act ivi ty above of window, both differences areAct ivi ty are more to realize programmed logic, preserve configuration information, and Window is more then showing, hiding for windowThe information of state, size, position etc.;
Existing system from an application be switched to another application when, AMS actively suspends current application and conceals itWindow, here it is why switch application when current application can exit.And it is new application widget allocated size in WMSAnd in the step for position, existing android system way is that window width is to shield width, and window height can be according to applicationThe configuration of window may exclude or plus status bar height and navigation bar height, but on the whole, new application widget takesScreen all free spaces, the reason for this is also using full screen display.So according to two above reason, the present invention is firstRemove " AMS actively suspends current application and hides its window " correlation step, then " WMS is new application distribution window positionPut and size " when without using full frame size, and the window's position is different, can so complete the multiple windows of screen displayFunction, as shown in Fig. 2 for the present invention overview flow chart, realize on screen while show multiple application widgets, specifically wrapInclude following steps:
A, user terminal starts new application widget, and corresponding information is sent to campaign management services unit;
B, campaign management services unit parses intended application information according to the information sended over, and verification starts authority,Success is such as verified, step C is performed, such as verification failure, starts failure;
C, intended application information is informed that window management service unit is ready for application widget by campaign management services unitSwitching;
D, the new application of campaign management services unit starting;
E, window management service unit according to the configuration information of new application widget is its dispensing position and non-full frame bigIt is small;
F, it is new to apply the window interface of oneself of being painted in the window of distribution, window management service unit after the completion of drawingNew application widget is shown, start completion;
G, in campaign management services unit set sleeve ought to basic scheme, realize application widget application behaviourMake demand.
Introduce desktop application (Launcher) below, the desktop application of android system be it is a kind of it is special shouldWith, be system start after first opening application, the desktop that its major function is similar to Windows systems is the same, when oneIndividual application can place an icon on the table after being mounted, and can start the application from desktop by clicking on this icon.But desktop application is substantially or an Android is applied, and so-called desktop is substantially also an application widget, in tableAfter icon one application of startup is clicked on face, started application is namely switched to from desktop application in fact, soTo say, desktop is to be suspended in fact, so, need to briefly return to desktop when I needs and open other application, then click on anotherIndividual icon could open another application, here it is why be switched to another application from an application when need to exit and first move backThe main reason for going out current application.Since it is so, if can there is a window to show in the case where not exiting current applicationShow to come, and the icon of all applications be placed in window, new application can be started by clicking on one of icon, it is possible toSolves the problems, such as above-mentioned switching.Fortunately the window of android system has been divided to the window of two kinds of levels of system windows and application widgetMouthful, system windows are to may be displayed on the top layer of application widget without influenceing application widget, and status bar and navigation bar are exactly twoIndividual system-level window, the combobox of status bar is also system windows.The icon applied simultaneously is also all can be by calling PMSTo obtain, two such condition all possesses, and our cans realize a method for conveniently starting application.SpecificallyWay is exactly to add a button on the navigation bar left side, a system-level window is shown when clicking on, the inside is with gridForm is placed the icon of all applications, and corresponding application can be started by clicking on some icon, as shown in figure 3, being opened described in step ANew application widget is moved to comprise the following steps:
A1, activation system, calling assure reason service unit, and obtain current all installations applies package informatin list;
A2, extract all application icons using in package informatin and its corresponding startup relevant information;
A3, one is created from icon to the Map relation lists for starting relevant information;
A4, create a system windows and all application icons are added in window;
A5, the situation of change monitoring system applied in system is broadcasted;
A6, one all application button of addition to navigation bar Far Left;
If A7, user click on all application buttons, system windows of the display equipped with all application icons;If user clicks on certainIndividual icon, found by icon to the Map relation lists for starting relevant information and start relevant information corresponding to the icon;
A8, campaign management services unit is called, start application.
Step A2 " extracting all icons of all application bags and its corresponding startup relevant information ", needs herein in Fig. 3Explain, multiple startup icons may be included in Android each application, these icons can correspond to different windows respectivelyInterface, it is also possible to do not start icon, this is exactly the service type application for belonging to backstage, without the application at interface.
Flow shown in Fig. 3 is a main flow for starting application, and application listed by window is when only system starts,Existing application in system, and after system starts, situations such as also having the peace loading, unloading of application, upgrade, these mayThe additions and deletions of icon in window can be caused to change, and android system can be sent accordingly extensively when having and applying peace loading, unloading and upgradingBroadcast and relevant information comes out, therefore we can do corresponding processing with monitoring system broadcast, as shown in figure 4, described in step A5Monitoring system broadcast comprises the following steps:
A51, system application bag relevant broadcasts are received, judge broadcast type;Installed if broadcast type is application, perform stepRapid A52;Unloaded if broadcast type is application, perform step A53, if broadcast type is application upgrade, perform step A54;
A52, the package informatin in broadcast call and assure reason service unit, extract all icons in the application bag newly installedAnd its corresponding startup information, if number of icons is more than zero, these icons and its corresponding startup information are added to Map and closedIn series of tables;If number of icons is less than zero, terminate to monitor;
A53, the package informatin in broadcast delete the Map elements of all bags correlation in Map tabulated relationship lists;
A54, the new package informatin in broadcast call all icons and its corresponding startup in the new application bag of PMS extractionsRelevant information;Map relation lists are traveled through, are contrasted with the icon information extracted;Delete the icon Map members being not present in new bagElement, add icon new in new bag and start relevant information Map elements;
A55, according to new Map relation list reconstructing system windows, terminate to monitor.
As shown in figure 5, WMS described in step E is its dispensing position and non-full frame according to the configuration information of new application widgetSize completed by 3 panes strategy.Screen is fixed on transverse screen mode first, i.e. interface cannot be with screenRotate and rotate, it is assumed herein that laterally shielding a width of SW, remove a height of SH of transverse direction screen of navigation bar and status bar, then window is verticalIt is highly SH to being fixed, ordinate value is also fixed as the height of status bar, so, it is only necessary to calculate abscissa X and widthW, width can determine (portrait layout is that 1/3 screen is wide, and others are wide for 2/3 screen), the calculating of abscissa according to the horizontal/vertical screen attribute of windowWith regard to more complicated, two counters are set first, it is assumed that be CH and CP, the system counted respectively since system starts is openedTransverse screen and portrait layout application widget quantity, can be new one initial abscissa of window calculation according to this count value,Then because user can drag window, i.e. moving window position, so, it is also necessary to according to the size of current focus window and positionPut, to determine the final abscissa of new application widget, as shown in figure 5, specifically comprising the following steps:
E1, screen is fixed as transverse screen mode, ordinate value is fixed as to the height of status bar;
E2, judge attribute of the application widget for transverse screen portrait layout, application widget width and initial horizontal are calculated according to window attributeCoordinate value;
E3, a set of portrait layout configuration item is set, when system starts portrait layout application model, copies this set portrait layout configuration item, withRealize normally being shown on transverse screen using pressure for portrait layout.
Computational methods described in step E2 include:
E21, application widget width is calculated, if application widget is portrait layout, it is that 1/3rd horizontal screens are wide to set window width;If application widget is transverse screen, it is that 2/3rds horizontal screens are wide to set window width;
E22, initial abscissa value is calculated, two counters are set, counted the system since system starts respectively and openThe transverse screen and the quantity of portrait layout application widget crossed, it is new one initial abscissa of window calculation according to count results;ForWindow is dragged, according to the size and location of current focus window, to determine the final abscissa value of new application widget.
The computational methods of final abscissa value include described in step E22:
E221, the width for obtaining current focus window and abscissa value;
Whether E222, the width of calculating current focus window are equal to laterally screen width, if so, then focus window is full frame width,The initial abscissa value of application widget is set as zero;If it is not, then perform step E223;
Whether E223, calculating application widget and current focus window width, which are equal to 2/3rds, laterally shields width, if so,Then illustrate that application widget and focus window intersect, without processing, terminate to calculate;If it is not, then calculating new window and focus window isIt is no intersecting, if non-intersect, without processing, terminate to calculate;If intersecting, step E224 is performed;
E224, calculate application widget width whether be equal to 2/3rds laterally screen it is wide, if if so, application widget justBeginning abscissa value is zero, then final abscissa value is that 1/3rd horizontal screens are wide, if the initial abscissa value of application widget is1/3rd laterally shield width, then final abscissa value is zero;If it is not, if the initial abscissa value of application widget is 2/3rdsLaterally shield width, then final abscissa value is zero, and otherwise, final abscissa value is that initial abscissa value laterally shields width with 1/3rdSum.
E225, whether calculating new window and focus window intersect again, if if so, the initial abscissa value of application widgetFor 2/3rds laterally screen it is wide, then final abscissa value is zero, otherwise final abscissa value be initial abscissa value with three/One laterally shields wide sum;If it is not, without processing, terminate to calculate.
Upon actuation, even if current device is in transverse state, screen can also be forced for portrait layout application under android systemPortrait layout is shown.Shown because screen is fixed as transverse screen by the present invention, so in order to allow portrait layout application to be normally displayed in transverse screen,Beyond vertical (a width of 1/3 screen is wide, and the screen beyond a height of place's status bar and navigation bar is high) being assigned as except window size, it is necessary to changeThe horizontal/vertical screen display mechanism of change system.The interface display of application widget relates generally to two aspects, and one is resource file, such as schemesPiece, character string, interface layout, color etc.;Another is exactly the horizontal/vertical screen configuration of window;Resource file is according to window in itselfThe factor designs such as horizontal/vertical screen attribute, the picture element density shielded, that is transverse screen display interface has transverse screen resource, portrait layout display interfaceThere is portrait layout resource, along with factors such as picture element densities, a general application has more set resource files, to allow its window to adapt to notSame device screen configuration.The interface display process of existing system is:, can be according to the vertical and horizontal of current device after system starts firstScreen state generates a set of configuration item, it is assumed that is SysConfigs, including horizontal/vertical screen attribute, then application program is making windowAlso there is the direction configuration item of its own during interface, it is assumed that it is AppOr i, when an application widget is opened, specific streamJourney is as shown in Figure 6.
From Fig. 6 flow, if it is desired to which the application of a portrait layout is normally shown, as long as the system that the application is taken is matched somebody with somebodyPut be a set of portrait layout configuration item it is all right, so we can taking human as a set of portrait layout of manufacture configuration item, when portrait layout applicationDuring startup, what it was copied is the artificial portrait layout configuration item of this set, and without changing the SysConfig of current transverse screen, thusPortrait layout can be realized normally shows that specific flow is as shown in Figure 7 using pressure on transverse screen:
Whether E31, the direction configuration item for judging application window interface itself are portrait layout, if so, system generation is a set ofThe configuration item of portrait layout;If it is not, system generates the configuration item of a set of transverse screen;
E32, application program copy newly-generated system configuration item;
E33, application program, to travel through its resource file, find that most match according to newly-generated system configuration itemSet;
E34, that a set of resource file most matched is used for interface display.
By figure 7 above, it can be seen that, this flow does not change SysConfigs, and also can keeps the transverse screen state of screen,The resource using portrait layout of portrait layout is allowed to show simultaneously.
As illustrated in figs. 8-11, the present invention closes, minimizes and recovered application widget and switches focus from navigation bar iconThe implementation of application widget:
Current all icons for opening application are shown first on navigation bar, but due to mobile device system internal memory andThe limitation of cpu resource, the number for application that open here can not possibly be unlimited, so a limitation can be done according to specific system, it is assumed thatFor NMAX;The realization of navigation bar realizes that System UI are a system-level applications in System UI during this is applied, fromFor name it is known that it is responsible for realizing what system UI was shown, status bar and navigation bar are exactly system UI, and it shows and controlLogic all realizes in this application, therefore, display open the icon of application this work just need by System UI LaiComplete.
It is that an operating application is represented with Task in android system, each Task has independent TaskID, it is also stateful, and Task is managed in the form of stack, a total of two Task stacks of system, one is for managingThe Task stacks of desktop application, referred to as Home stacks, this is a special stack, wherein also there was only a Task, i.e., desktop application is transportedCapable Task, referred to as Home Task, another stack are then used for managing non-desktop application, referred to as App stacks, non-desktop applicationTask is also referred to as App Task, during the firm start completion of system, only exists a Home stack, and when user starts a new applicationShi Caihui creates App stacks, and new App Task are added into this stack, will be corresponding whenever there is new application to openTask is added to the top of stack, and is set to focus window.
These sleeves realized in AMS ought to basic scheme, based on this set strategy, the present invention realizesA set of new flow is to realize the operational requirements such as the close of multi-window interface, minimum.
As shown in figure 8, opening application widget specifically includes following steps:
G11, current all icons for opening application are shown on navigation bar, the number for opening application is limited;
G12, campaign management services unit receive the request for opening application widget, judge whether that App stacks (are used for managingThe stack of non-desktop application), if in the presence of finding App Task corresponding to the application in App stacks (in the operation of non-desktop applicationApplication), such as find corresponding to App Task, the App Task found are moved to the tops of App stacks, if the App TaskState be then set to Started (beginning) for Paused (stoppings), otherwise execution step G3;If being not present, App is createdStack, perform step G13;
G13, a new App Task is created, it is Started to set Task states, and new App Task are added toThe top of App stacks;
G14, App stacks are set to focus stack, the App Task are corresponded into window is set to focus window;
The new application widget of G15, display;
G16, transmission Task To Front are broadcasted and are attached the Task relevant informations, are ended task;
As shown in figure 9, recovering application widget specifically includes following steps:
It is attached to the request on foreground, the request that G21, campaign management services unit receive mobile Task (operating application)With Task ID (identifier of operating application);
G22, found in App stacks according to Task ID corresponding to App Task, if finding, step G23 is performed, if not looking forArrive, end task;
G23, the App Task found are moved to App stack tops, if application widget corresponding to the App Task is hiddenHide and then call window display unit to show it, Started is set to if the state of the App Task is Paused;
G24, the App Task are corresponded into application widget it is set to focus window;
G25, transmission Task To Front are broadcasted and are attached the Task relevant informations, are ended task;
As shown in Figure 10, minimize application widget and specifically include following steps:
G31, campaign management services unit receive requests of the mobile Task to backstage, the subsidiary Task ID of request;
G32, found in App stacks according to Task ID corresponding to App Task, if finding, step G33 is performed, if not looking forArrive, end task;
G33, the App Task found are moved to App stacks bottom, by it if the state of the App Task is StartedIt is arranged to Paused and calls window display unit to hide its window;
G34, the App Task for obtaining App stack tops, judge whether App Task states are Started, if so, shouldAppTask corresponds to application widget and is set to focus window;If it is not, Home stacks (the Task stacks for being used for managing desktop application) are set to burntPoint stack, Home Task (Task of desktop application operation) corresponding desktop window is set to focus window;
G35, transmission Task To Front are broadcasted and are attached the Task relevant informations, are ended task;
As shown in figure 11, close application widget and specifically include following steps:
G41, campaign management services unit receive the request for deleting Task, the subsidiary Task ID of request;
G42, found in App stacks according to Task ID corresponding to App Task, if finding, step G43 is performed, if not looking forArrive, end task;
G43, WMS is called to hide its window if the App Task found state is Started, by the App TaskMove from App stack deletions;
G44, the App Task for obtaining App stack tops, judge whether App Task states are Started, if so, by the AppTask corresponds to application widget and is set to focus window;If it is not, Home stacks (the Task stacks for being used for managing desktop application) are set to focusStack, Home Task are corresponded into desktop window and are set to focus window;
G45, transmission Task To Front are broadcasted and are attached the Task relevant informations, are ended task.
Navigation bar is above for the display for opening application icon, mainly by monitoring Task To Front broadcast come completeInto, broadcasting subsidiary Task relevant informations mainly includes Task ID, if is Home Task, starts the related letters of the TaskBreath, using bag name etc., these broadcast are handled in System UI, can be preserved in System UI with a Task List allTask relevant informations, its handling process are as shown in figure 12.
After navigation bar multiple application icons shown above, it is possible to according to the finger touch operation of user come to applicationWindow does respective handling.Icon on navigation bar is according to from left to right transversely arranged, and width and height are all fixed, it is assumed that it is IW and IH, the position that each icon is shown can be got by system calling, then assuming that getThe left position of one icon is L1, and which icon can calculate the point according to the abscissa of touch point falls on, calculating sideMethod is:
Assuming that touch point abscissa is X, fall on i-th of icon, then i=(X-L1)/IW+1
It is upward sliding to press according to finger touch and decontrol 2 points of coordinate to calculate user, or laterally slidingIt is dynamic, or some icon is only click on, method is as follows:
Assuming that pressing transverse and longitudinal coordinate a little and being:XD/YD, the coordinate decontroled a little are XU/YU, then:
If sqrt ((XU-XD) * (XU-XD)+(YU-YD) * (YU-YD))<20, sqrt be the meaning of root of making even, thisPlace shows to decontrol point and pressed a little at a distance of very near, it is believed that finger does not slide, it is determined that is clicking operation;
(if YU-YD)>IH&&abs(XU-XD)<10, it is shown to be upward sliding (abs is the meaning to take absolute value);
(if XU-XD)>IW&&abs(YU-YD)<10, it is shown to be and slides laterally that (abs is the meaning to take absolute value to the left and rightThink);
Computational algorithm more than, you can identify user's touch operation, make corresponding action, idiographic flow afterwardsAs shown in figure 13.
As shown in figure 14, the present invention reduces, amplified, dragging application widget and by clicking on inside non-focus application widgetTo switch the implementation of application widget:
The scaling of window, drag and switch application widget by clicking on inside non-focus application widget, these operationsBelong in the range of window viewing area the touch operation of (screen area i.e. below status bar, more than navigation bar), so makingWith a global touch input event sniffer, this monitor can listen to touch input event all on screen,Press, move, let go, while get the coordinate of point corresponding to each event.The logic of realization is exactly to exclude all touch firstTouch in the touch point of status bar, navigation bar, input method window and all application widgets, because these are all non-application widgets,Then the value up and down of focus window is recorded, may determine that whether touch point falls on focus window according to these values,Do not processed then in non-application widget when touch point falls, and when touch point falls in focus window, it is also necessary to judge itWhether it is in focus window in the N number of pixel height regions in top, when falling in the N number of pixel height regions in focus window topWhen interior, you can dragged or zoom, otherwise when falling in non-focus window, then traversal is current all from top to bottomNon-focus window, fallen with finding the point in which application widget, have found and the window is not desktop window, then callCorresponding task is moved to foreground by AMS, so have switched focus window.
In Figure 14, the step for " operated and responded according to the next step of finger ", concrete details is, if user's handFinger presses laggard line slip, then window is dragged;If user's single finger is double-clicked, (definition of double-click is connected in 600msIt is continuous to click on same point twice), then the scaling of progress window, overview flow chart are as shown in figure 15.
Identification for window finger manipulation, first illustratively in android system touch event report flow,Android system supports multi-point touch, and reported event corresponding to an independent finger mainly has three kinds, presses Down, movementMove, let go Up, and the information that event can attach touch point includes transverse and longitudinal coordinate, ID, and one is just first reported when a finger downIndividual Down events, then finger pin or sliding process in can report Move events always with certain frequency, when finger is let goShi Ze reports a Up event;When multiple finger downs, according to point identified opportunity, first finger touch point is first reportedDown events, the finger touch point being identified to new afterwards then reports Pointer Down events, then will reportedMove events, Pointer Down events and Move events can all be accompanied with coordinate, the ID of several points and each point, work as fingerWhen letting go, if not most what a finger is let go, then Pointer Up events are reported, if last finger, then report UpEvent, both are difference, and Pointer Up also include now also surplus in addition to the coordinate and ID of the subsidiary point let goUnder coordinate, the ID of several points and each point, and Up events only have the coordinate and ID of a point let go.
Because the present invention only supports the operation of a finger, therefore do not processed for Pointer Down events.In additionFor this operation of identification " double-click same point ", " same point " herein is one approximate, is one because finger touchesThe touch in face, so even if seeming the touch clicking operation of same point, the Up and Down point coordinates that system identification is arrived are impossibleIt is accurate equal, therefore be taken as same point when the distance between two points is less than certain value D, i.e.,:
sqrt((X1-X2)*(X1-X2)+(Y1-Y2)*(Y1-Y2))<D, sqrt are the meanings of root of making even,
As shown in figure 16, to identify single finger slide flow chart, as shown in figure 17, to identify the flow of double click operationFigure, mentions same point in flow chart and then represents at 2 points and meet above-mentioned condition, then double-clicks and clicks on twice, here will be oneClick-through count, it is assumed that be C, C initial values are 0;After the mode of operation for recognizing finger, it is necessary to which calculation window is scaled or draggedDynamic final position, the window scaling and dragging that the present invention is realized are not freely unconfined scaling and dragging, and longitudinal direction is notBecome, only do horizontal variation, because window is being longitudinally fixed, therefore when calculating only with width and the coordinate value on the window left sideAs reference, then assuming that window current width is W, left side coordinate is X, shields a width of SW, and its calculating logic is as follows:
Window drags first, when recognizing user's progress single finger slip, according to the XD/YD of record, and currentlyThe XM/YM of Move events, you can know mobile transverse and longitudinal coordinate distance, it is assumed that the upper left angular coordinate of window initial position isXS/YS, the coordinate after movement is XE/YE, then XE=XS+ (XM-XD), YE=YS+ (YM-YD), before user's finger is let go,XM and YM is continually changing, and the position of such window also follows finger constantly to move, that is to say, that in moving process, windowReally by freely dragging, but when finger is let go, then XE/YE, i.e. XE=XS+ (XU-XD), YE can be calculated according to XU/YU=YS+ (YU-YD, but XE/YE now is temporary transient, because they will not just fall each small point in 3 panesThe upper right corner of block redefines final position, it is necessary to do one according to XE, and calculating logic is as follows:
The fixed effective displacement of minimum is 1/6SW, that is, works as XE-XS>It is thought that once effective move during 1/6SWIt is dynamic, the calculating of next step shift position is just carried out, otherwise the window's position does not change.Following calculating is effective in displacementOn the basis of carry out:
As W=1/3SW,
If XE<XS, the target segment for showing, to moving to left, to move to left can only be the 1st, 2 two piece, if XE<1/6SW, then recognizeIt is the 1st piece for target segment, then XE=0 is set;Otherwise target segment is the 2nd piece, then sets XE=1/3SW;
If XE>XS, show to move right, the target segment moved to left can only be the 2nd, 3 two piece, if XE>1/2SW, then recognizeIt is the 3rd piece for target segment, then XE=2/3SW is set;Otherwise target segment is the 2nd piece, then sets XE=1/3SW;
In the case of other, XE=XS is set, i.e. the window's position is constant.
As W=2/3SW, the wide window of 2/3 screen can only move left and right once, and its X-coordinate can only be 0 or 1/3SW:
If XE<XS and XS=1/3SW, represent that the 2/3SW windows on the right are moved to the left, then XE=0 is set;
If XE>XS and XS=0, represent that left side 2/3SW window moves right, then XE=1/3SW is set;
In the case of other, XE=XS is set, i.e. the window's position is constant.
As W=SW, XE=XS is set, i.e. the window's position is constant.
Next to that the scaling of window, when recognizing user's progress double click operation, the calculating logic of window scaling is as follows:
As W=1/3SW, W=W+1/3SW is set, if X+2/3SW>SW, show to expand rear hatch beyond display screen,Need to reset X=X -1/3 screens wide;Otherwise X is constant;
As W=2/3SW, W=W+1/3SW is set, if X is not 0, it is 0 to set X;Otherwise X is constant;
As W=SW, setting W=1/3SW, X is constant.
After above-mentioned window width and change in location has been carried out, you can call WMS to carry out the window on actual interfaceRedraw, this step is that the corresponding system interface for calling WMS can be completed.
Although being described in conjunction with the accompanying embodiments of the present invention, those skilled in the art can be in appended rightVarious deformations or amendments are made within the scope of it is required that, as long as the protection domain described by no more than the claim of the present invention,All should be within protection scope of the present invention.