Get the Surface Duo SDK

Important

This article describes functionality and guidance that is in public preview and may be substantially modified before it's generally available. Microsoft makes no warranties, express or implied, with respect to the information provided here.

The Surface Duo SDK Preview includes APIs that let you make your app aware of the display mask and the hinge on the Surface Duo device so you can take advantage of unique features of the device.

It also includes a Surface Duo preview image (to use with the Android Emulator) that you can use to develop and test your apps.

Set up the environment

You should have your Android development environment set up and up to date before you install the Surface Duo SDK.

Surface Duo SDK Preview prerequisites

  • Install the latest version of Android Studio and Command line tools from developer.android.com, including Google's Android emulator which you install using the SDK manager in the Android Studio Tools menu.
  • Use the SDK manager to ensure all the required dev tools (Android SDK Build-Tools, Android SDK Platform-Tools, Android SDK Tools and Android Emulator) are up to date.
  • (Optional) Hardware virtualization is enabled. For speedy emulation, follow the guidelines outlined in emulator acceleration in the Android Studio docs.

To use with Microsoft Visual Studio/Xamarin

To use for development on Ubuntu/Debian

  • Complete the installation prerequisites.

  • The KVM software package is required. Complete the steps at Configure VM acceleration on Linux to install KVM.

    • After installing KVM, ensure the current (logged in) user is added to the KVM group.

      $ groups
      <current user> sudo plugdev kvm libvirt
      
    • If the current user is not in the KVM group, run the following command to add them.

      sudo usermod -a -G kvm <current user>
      
    • Reboot the machine.

  • To install the emulator and SDK, run the following command. (If necessary, update the package name to match what you downloaded).

    sudo dpkg -i SurfaceDuoSDKPreview_EmulatorOSImage_and_APIs_ubuntu_debian_2020.117.2.deb
    

Download the SDK

Download the Surface Duo SDK Preview from the Microsoft Download Center.

DOWNLOAD THE SURFACE DUO SDK PREVIEW

System Requirements

In addition to Android Studio Requirements and Emulator Requirements, the Surface Duo SDK has the following system requirements:

Supported Operating Systems

  • Windows® 8/10 (32- or 64-bit)
  • Mac® OS X® 10.10 (Yosemite) or higher
  • GNOME or KDE desktop (Tested on Ubuntu® 14.04 LTS, Trusty Tahr)

Hardware requirements

  • 4 GB of RAM minimum, 8 GB of RAM recommended
  • 4 GB of available hard disk space minimum, more recommended

Development environment

  • The Surface Duo preview image requires an Android Emulator to be installed with Android Studio or Visual Studio (Xamarin).

Integrate with the SDK

To use the Surface Duo SDK in your app:

  1. Locate the SDK folder in your installation directory (Typically this is C:\Users\<username>\SurfaceDuoEmulator\sdk

  2. Copy the JAR file from the SDK package to your App \libs folder.

  3. In the dependencies section of your build.gradle file, add this line to include the SDK.

    The location of jar file depends on where it is stored relative to the source code.

dependencies {
   compileOnly files('libs/com.microsoft.device.display.displaymask.jar')
   ...
}

Next steps

Use the Surface Duo emulator to test your app