1 <html devsite> 2 <head> 3 <title>Supporting Multi-Window</title> 4 <meta name="project_path" value="/_project.yaml" /> 5 <meta name="book_path" value="/_book.yaml" /> 6 </head> 7 <body> 8 <!-- 9 Copyright 2017 The Android Open Source Project 10 11 Licensed under the Apache License, Version 2.0 (the "License"); 12 you may not use this file except in compliance with the License. 13 You may obtain a copy of the License at 14 15 http://www.apache.org/licenses/LICENSE-2.0 16 17 Unless required by applicable law or agreed to in writing, software 18 distributed under the License is distributed on an "AS IS" BASIS, 19 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 20 See the License for the specific language governing permissions and 21 limitations under the License. 22 --> 23 24 25 26 <p> 27 In Android 7.0 and later, users can have multiple apps simultaneously displayed on their 28 device screen with the new platform feature, multi-window. In addition to the 29 default implementation of multi-window, Android also supports a few varieties 30 of multi-window:</p> 31 32 <ul> 33 <li><strong>Split-screen</strong> is the base implementation of multi-window and 34 provides two activity panes for users to place apps. 35 <li><strong>Freeform</strong> allows users to dynamically resize the activity 36 panes and have more than two apps visible on their screen. 37 <li><strong>Picture-in-picture (PIP)</strong> allows Android devices to continue 38 playing video content in a small window while the user interacts with other 39 applications.</li> 40 </ul> 41 42 <p> 43 To implement the multi-window feature, device manufacturers set a flag in the 44 config file on their devices to enable or disable multi-window support. 45 </p> 46 47 <h2 id="implementation">Implementation</h2> 48 <p> 49 Multi-window support is enabled by default in Android 7.0 and later. To disable it, set 50 the <code>config_supportsMultiWindow</code> flag to false in the <a 51 href="https://android.googlesource.com/platform/frameworks/base/+/master/core/res/res/values/config.xml">config.xml</a> 52 file. 53 </p> 54 <p> 55 For devices that declare <code>ActivityManager.isLowRam()</code>, multi-window 56 is disabled regardless of the value of <code>config_supportsMultiWindow</code> 57 flag. 58 </p> 59 <h3 id="split-screen">Split-screen</h3> 60 <p> 61 The default multi-window experience is split-screen mode, where the System UI is 62 divided directly down the middle of the device in portrait or landscape. Users 63 can resize the window by dragging the dividing line side-to-side or 64 top-to-bottom, depending on the device orientation. 65 </p> 66 <p> 67 Then device manufacturers can choose if they want to enable freeform or PIP. 68 </p> 69 <h3 id="freeform">Freeform</h3> 70 <p> 71 After enabling standard multi-window mode with the flag 72 <code>config_supportsMultiWindow</code>, device manufacturers can optionally 73 allow freeform windowing. This mode is most useful for manufacturers of larger 74 devices, like tablets. 75 </p> 76 <p> 77 To support freeform mode, enable the 78 PackageManager#FEATURE_FREEFORM_WINDOW_MANAGEMENT system feature in <a 79 href="https://android.googlesource.com/platform/frameworks/base/+/master/core/java/android/content/pm/PackageManager.java">/android/frameworks/base/core/java/android/content/pm/PackageManager.java</a> 80 and set <code>config_freeformWindowManagement</code> to true in <a 81 href="https://android.googlesource.com/platform/frameworks/base/+/master/core/res/res/values/config.xml">config.xml</a>. 82 </p> 83 84 <pre class="devsite-click-to-copy"> 85 <bool name="config_freeformWindowManagement">true</bool> 86 </pre> 87 88 <h3 id="picture-in-picture">Picture-in-picture</h3> 89 <p> 90 After enabling standard multi-window mode with the flag 91 <code>config_supportsMultiWindow</code>, device manufacturers can support <a 92 href="https://developer.android.com/training/tv/playback/picture-in-picture.html">picture-in-picture</a> 93 to allow users to continue watching video while browsing other activities. 94 While this features is primarily targeted at Android Television devices, other 95 device form factors may support this feature. 96 </p> 97 <p> 98 To support PIP, enable the PackageManager#FEATURE_PICTURE_IN_PICTURE system 99 feature in <a 100 href="https://android.googlesource.com/platform/frameworks/base/+/master/core/java/android/content/pm/PackageManager.java">/android/frameworks/base/core/java/android/content/pm/PackageManager.java</a>. 101 </p> 102 <h3 id="system-ui">System UI</h3> 103 <p> 104 Support all standard System UIs according to <a 105 href="https://developer.android.com/guide/topics/ui/multi-window.html#testing"> 106 https://developer.android.com/guide/topics/ui/multi-window.html#testing</a> 107 </p> 108 <h3 id="applications">Applications</h3> 109 <p> 110 To support multi-window mode for preloaded apps, consult the <a 111 href="https://developer.android.com/guide/topics/ui/multi-window.html">Android 112 developer documentation</a>. 113 </p> 114 <h2 id="validation">Validation</h2> 115 <p> 116 To validate their implementation of multi-window, device manufacturers should 117 run <a 118 href="https://android.googlesource.com/platform/cts/+/master/hostsidetests/services/activitymanager/src/android/server/cts">CTS 119 tests</a> and follow the <a 120 href="https://developer.android.com/guide/topics/ui/multi-window.html#testing">testing 121 instructions for multi-window</a>. 122 </p> 123 124 </body> 125 </html> 126