Android sample apps for Surface Duo

There are a number of GitHub repos that contain code samples to help you enhance your apps for dual-screen and foldable devices. There is also a Google Codelab training module to learn how to use Window Manager.

SDK samples

There are Kotlin samples available that demonstrate all the different design patterns and unique features of the Surface Duo, such as extended canvas, list detail, two page, dual view, companion pane, how to access the hinge angle, and more.

A couple of these are highlighted below:


Drag and Drop

This sample features drag and drop capabilities that can span over a single page or multiple screens, depending on the layout of the application.


Pen Events

This sample demonstrates how pen events and corresponding data can be used within an application.


Intent Second Screen

The Intent demo utilizes Intent functionality with Android to spawn secondary pages.

There are also Java versions available.

Jetpack Window Manager samples

See the complete list of Jetpack Window Manager samples. Here are three highlights:

eBook Reader

eBook Reader

Simple ebook reader implemented with Jetpack Window manager and ViewPager2.

Folding Video

Folding Video

Video player using ExoPlayer and Jetpack Window Manager to adapt the view depending on device the folding feature type and orientation.



To-do list application that uses Jetpack Window Manager and SlidingPaneLayout, along with Room for data storage.

SurfaceDuoLayout samples

These complete app samples demonstrate how to apply the dual-screen design patterns to real-world user interactions. These samples are designed to work on single-screen devices as well as the Surface Duo.



Note-taking application with note categories, drag-and-drop, and pen inking support.


Photo Editor

This application implements a simple photo editor that lets users select, edit, and save images.


Source Editor

The application is an HTML editor that enables real-time rendering of formatted source code.