Testing with Foldable Emulator

Testing

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.

App continuity

The emulator app, which can run on AVD (Android Virtual Device) in Android Studio and Android tablets, is provided to test for changing screen size.

Testing in AVD
  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. Verity Configuration

    • Use the default
      #
  6. 6. Run 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. Emulate

    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
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 : Install app All App installs on device with no issues.
Cover Display : Install app All App installs on device with no issues.
Main Display : Launch app All App opens without crashing, hanging, or throwing ANR (app not responding). App content is upright.
App opens without crashing, hanging, or throwing ANR (app not responding). App content is upright. 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 : Tilt Motion Games Tilt the device while playing a motion-sensing game. The app should respond accordingly.
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).