Testing apps in Foldables

Testing App continuity

App developers can now test how their apps respond in a foldable environment. This enables them to verify that it was done correctly by using an emulation environment that is provided for app continuity and multi-resume.

Prepare Foldable Devices

The emulator app, which can run on Android devices and Android Studio AVD, is provided to test for changing screen size and density. It's recommended to use any Android tablets such as Nexus10 that can contain screen size which is not smaller than main display screen size(1536 x 2152). That's because the devices that have smaller screen size than main display can not emulate the same condition, which can make different layout in your devices.

However, if you don't have recommended devices, you can test your app in the emulator, and you can check whether your app works well when screen size changes. Additionally, you can test your app without a real device, There is an Android Virtual Device in Android Studio, but it's very difficult to use equipments such as SIM, wifi, camera and so on if you uses AVD.

Run Foldable Emulator
  1. 1. Download

  2. 2. Install

    $ adb install FoldableEmulator.apk

    Once installed, open the app “Foldable Emulator” from the app list.

  3. 3. Grant Permission

    PC: ~$ adb shell
    AVD: /$ pm grant com.samsung.android.foldable.emulator android.permission.WRITE_SECURE_SETTINGS
    AVD: /$ pm grant com.samsung.android.foldable.emulator android.permission.SYSTEM_ALERT_WINDOW
    • The "SYSTEM_ALERT_WINDOW" permission can be granted in an activity also, which are displayed when the app is launched, without being granted using the above command.

  4. 4. Run emulator app in your android device

    Unfold Fold Exit
    Figure 2 Seamless continuation when unfolded
    Figure 2 Seamless continuation when unfolded
    Figure 2 Seamless continuation when unfolded
    Figure 2 Seamless continuation when unfolded
    Figure 2 Seamless continuation when unfolded
    Figure 2 Seamless continuation when unfolded
Testing in Android Studio AVD(Alternative)
  1. 1. Go to Android Studio > AVD Manager.

  2. 2. Create a Virtual Device.

    #
  3. 3. Choose a device definition

    • Tablet > Nexus 10
      #
  4. 4. Select a system image

    • Android Open Source Project Images (Download if needed)
      #
    • or Google Images (If needed)
      #
  5. 5. Verify Configuration

    • Use the default
      #
  6. 6. Run AVD

    #
  7. 7. Run Foldable Emulator in AVD

    • It's a same way with to use this emulator with android devices . If you don't know the way to use it, you should go to Run Foldable Emulator section.

Testing Multi-Window

Prepare Multi-Window Devices
Android devices
(Above N Below P OS)
Samsung devices
(Above N Below O OS)
Samsung devices
(Above P OS)
Split view v v v
Freeform window v v
Multi-Resume v

This table explains multi-window features of devices. It's recommended to prepare P OS samsung devices. That's because you can test multi-window mode with multi-resume. One more thing is that your samsung device cannot support freeform window if it has low memory specification. If there is no menu item of 'Open in pop-up view' in recents, it's possible for your device not to support freeform window.

How to use Split view
  1. 1. Launch an app and touch the recent button, then click 'Open in split screen view'.

  2. 2. If you don't have any recent app, your device would look like 2-1. Otherwise, your device would look like 2-2.

  3. 3. If you choose another app in Home launcher or recent panels, spit view will be activated.

    1. a. You can resize split view apps with dragging the border line between apps
    2. b. You can close apps dragging to top of display or bottom of display.
Split View 1 Split View 2-1 Split View 2-2 Split View 3
How to use Freeform window
  1. 1. Launch an app and touch the recent button, then click 'Open in pop-up view'.

  2. 2. This is freeform window mode. You can make the app minimized size, and change app's window mode to full screen with top bar buttons.

  3. 3. If you touch and wait on top bar, there is blue line around freeform window. In this state, you can move your freeform window app.

  4. 4. If you touch and wait on the border of window, you can resize your freeform app with guide line of blue box.

Freeform window 1 Freeform window 2 Freeform window 3 Freeform window 4
How to use Multi-Resume

You can test multi-resume based on the meta-data with any Samsung device on Android 9.0.

  1. 1. Declare the meta-data in AndroidManifest.

    Code Block 3 Manifest flag

    <application>
      <meta-data
        android:name="android.allow_multiple_resumed_activities"
        android:value="true"/>
      <activity ... />
    </application>
  2. 2. Run your app in multi-window mode.

  3. 3. Move the focus from the first app to the other by tapping the other app.

  4. 4. Check whether the app is still in a resumed state.

  5. 5. Check whether your app has any unexpected behavior when your app unexpectedly loses the singleton resources (for example, Camera).

Test Case

The table includes a set of test cases that you can use in your own test plan.

The test cases cover app continuity and multi-windows scenarios that Android apps should be prepared for if they are expected to run on foldable devices.

Test Case App set Success case
Main Display : Launch app All App opens without crashing, hanging, or throwing ANR (app not responding). App content is upright.
Cover Display : Launch app All App opens without crashing, hanging, or throwing ANR (app not responding). App content is upright. And, It should be opened with no blank space because of the aspect ratio.
Main Display : Keyboard All Click on a text input box, type text with the keyboard. Typed text should show in the input box with no lag.
Cover Display : Keyboard All Click on a text input box, type text with the keyboard. Typed text should show in the input box with no lag.
Main Display : Taking a photo Communication App opens the camera and the preview images are scaled and oriented correctly. The resulting picture taken is scaled and oriented correctly. Try this in both portrait and landscape mode.
Cover Display : Taking a photo Communication App opens the camera and the preview images are scaled and oriented correctly. The resulting picture taken is scaled and oriented correctly. Try this in both portrait and landscape mode.
Main Display : Recording a video Communication App opens the camera and the preview images are scaled and oriented correctly. Starting the recording, the preview is scaled and oriented correctly. Playback is smooth and performs as expected (no lag in audio/video, video is at speed in which it was recorded at). Try this in both portrait and landscape mode.
Cover Display : Recording a video Communication App opens the camera and the preview images are scaled and oriented correctly. Starting the recording, the preview is scaled and oriented correctly. Playback is smooth and performs as expected (no lag in audio/video, video is at speed in which it was recorded at).
Transitions between Main and Cover Display : App running All The display should be switched without app crashing, hanging, or throwing ANR (app not responding). And, app shouldn’t finish or be destroyed.
Transitions between Main and Cover Display : Screen layout All After the display is switched, App should be filled in entire full screen. It should have no blank space and the screen shouldn’t be cut off.
Transitions between Main and Cover Display : UI component All All components (button, text, menu, thumbnails…) should be right location and maintain same shape as expected.
Transitions between Main and Cover Display : Location Weather / Maps / Navigation After the display is switched, location value shouldn’t be changed.
Transitions between Main and Cover Display : Keyboard Communication / Social & Media After switching display during typing, The active cursor should stay in place and keyboard content shouldn’t be changed.
Transitions between Main and Cover Display : Touch to draw Drawing / Handwriting Try this in Drawing / Handwriting app. Touch to draw and switch display. Then, Drawing and edited state should be maintained.
Transitions between Main and Cover Display : Background function Background apps After switching display, app continues background function (e.g. background audio, stopwatch)
Transitions between Main and Cover Display (App having various pages only) All Try this in various pages of the app. The active cursor should stay in place and page content should not change (except to adjust to larger screen layout).
Change focus in multi window All When losing focus in multi window mode, it should keep updating screen status (video, game, chatting).