Surface Duo Blog

Build great Android experiences, from AI to foldable and large-screens.

Latest posts

Aug 11, 2022
Post comments count 0
Post likes count 0

Test Kit Annotations update

Andrei Cirja

Hello Android developers! We are excited to announce an update for the foldable Test Kit library. Test Kit provides utility methods and classes that help you write instrumented tests for large screen and foldable devices. This update adds annotations which are useful for creating tests for one posture at a time. Now, instead of adding extra code to span an app or simulate a folding feature, you can just add an annotation to set up your tests. Annotations can be used to configure tests for: The annotation syntax is perfect for simple tests where the device remains in t...

Aug 4, 2022
Post comments count 0
Post likes count 0

Making a gamepad for my Flutter game

Andrei Diaconu

Did you know that building games in Flutter is just as easy as building apps? There is even a game engine built on top of it called Flame. Today we are first going to explore building a simple game with Flame and then enhance the game for dual-screen and foldable devices. This space themed game will use an on-screen gamepad controller as input. Surface Duo in dual-landscape mode feels like a bespoke device for gaming and we want to place the gamepad controller on the bottom screen. This is also a talk The contents of this article are the same as the talk that we presented recently at the Flutter Glo...

Jul 28, 2022
Post comments count 0
Post likes count 3

Drag and drop library for Jetpack Compose

Joy Liu

Hello Compose developers! This week, we are excited to announce the release of DragAndDrop, a new utility library that will help you easily add interactive drag and drop capabilities to your app in Compose, following Google’s Drag and drop guidelines. It is the newest addition to Microsoft’s Compose SDK. On dual-screen and foldable devices, one of the advantages of running multiple apps across screens is to share information between apps easily. To achieve this, drag and drop is definitely a feature that developers should think about bringing into their application. Overview The Drag...

Jul 21, 2022
Post comments count 0
Post likes count 2

droidcon San Francisco recap

Joy Liu

Hello Android developers, Earlier this year the Surface Duo team attended our first in-person conference for the year at droidcon in San Francisco! It was great to meet Android developers from all over the world, demonstrate the features of Surface Duo, and chat about building apps for foldable and large screen devices. We’ll also be at these upcoming droidcon events with a booth and speaking session: Please come visit us and share your foldable and large screen development experiences! If you’re looking for other foldable and large-screen content, representatives of Mi...

Jul 14, 2022
Post comments count 0
Post likes count 0

Source Editor & Diary samples for Jetpack Compose

Unmesh Padhye

Hello Jetpack Compose developers! We have two exciting new Jetpack Compose samples for Surface Duo to share with you. The first one, called Source Editor, was previously published, but we migrated it to take advantage of Jetpack Compose. The second one is a Diary application that demonstrates using Android Views components with Jetpack Compose. Source Editor We published the original Source Editor app in 2020, and now with the rising popularity of Jetpack Compose, we thought it would be a fantastic idea to migrate this sample from Views to Compose. There are some fundamental differ...

Jul 7, 2022
Post comments count 0
Post likes count 0

Notifications on the Glance Bar

Alin-Mihai Argeanu

Hello Android developers! This week we are talking about the Surface Duo 2 Glance Bar feature. If you are wondering what the Glance Bar feature is and how anyone can benefit from it, let’s dive into it together to learn more. What is the Glance Bar Feature? The Glance Bar feature displays notifications of BUCKET_PEOPLE category over the hinge part of the device when it is closed. This feature helps us quickly view notifications, the time, or see whenever someone calls u, without unfolding or unlocking the device. How can I enable the Glance Bar? This feature is enabled by defau...

Jun 30, 2022
Post comments count 0
Post likes count 0

Video+Chat and Calculator samples for Jetpack Compose

Levi Ortega

Hello Jetpack Compose developers! Today we will be discussing the introduction of two new Jetpack Compose samples for Surface Duo. The first one is a video-streaming-chat-like app, and the second is a calculator app. We will also be going over some of the dos and don'ts when creating these types of apps, as well as dive into the helpfulness of using side effects in Jetpack Compose. Video+Chat About a year ago we released our own Video+Chat sample written using Views, and about 3 months ago we released another app with similar tech called the FoldingVideoPlusTrivia. This specific example,...

Jun 23, 2022
Post comments count 1
Post likes count 1

Jetpack Compose TwoPaneLayout update

Joy,
Kristen

Hello Jetpack Compose developers! This week, we’re excited to announce some big updates to TwoPaneLayout, our Jetpack Compose component for foldables and large screens. We’ve just added a new TwoPaneLayout constructor with highly customizable navigation support, and the TwoPaneScope interface has been upgraded to provide more information while also protecting access to its fields and methods. These changes were substantial enough that we decided to bump to TwoPaneLayout version 1.0.1-xx, so now TwoPaneLayout 1.0.0 is the last version that still uses the old API. To see examples of how to ...

Jun 16, 2022
Post comments count 0
Post likes count 0

Responsive layouts in Flutter with TwoPane

Andrei Diaconu

Welcome to another Flutter update. This time we will dive into TwoPane, tell you how to get it from pub.dev and focus on the types of layouts you can build with it. Before we get to examples, we will first see what parameters it exposes. This widget has cousins in other frameworks, making its context interesting to explore. Let us first start with the context. TwoPane cousins Our team focuses on making it easy for developers to enhance their apps for dual-screen, regardless of what tech they use. We want to meet developers where they are. This means that a high-level component like TwoPane has many cous...