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. Download
FoldableEmulator_1.01.apk1.62MC
  1. Install

    $ adb install FoldableEmulator.apk
    

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

  2. 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.
  3. 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. Go to Android Studio > AVD Manager.

  2. Create a Virtual Device.

    #

  3. Choose a device definition

    • Tablet > Nexus 10

      #

  4. Select a system image

    • Android Open Source Project Images (Download if needed)

      #

    • or Google Images (If needed)

      #

  5. Verify Configuration

    • Use the default

      #

  6. Run AVD

    #

  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.