Surface Duo Blog
Build great Android experiences, from AI to foldable and large-screens.
Latest posts
2023 year in review
Hello Android developers, 2023 was the year that machine learning and artificial intelligence really became mainstream, and we covered both topics with a focus on Android implementations. We published series on using the ONNX machine learning runtime, building Android apps with Microsoft Graph, and tutorials for Jetpack Compose developers! Take a look back at all the best posts from 2023… OpenAI on Android The blog focused heavily on working with OpenAI on Android using Kotlin, starting with some basic API access and then building out the JetchatAI demo using a variety of techniques including emb...
Use ONNX Runtime in Flutter
Hello Flutter developers! After recently reading about how Pieces.app uses ONNX runtime inside a Flutter app, I was determined to try it myself. This article shows a summary of the journey I took and provides a few tips for you if you want to do the same. Since we have FFI in Dart for calling C code and ONNX Runtime offers a C library, this is the best way to integrate across most platforms. Before I walk down that path, I decide to have a look at pub.dev to see if anyone did this before me. My thinking here is that anything running ONNX Runtime is a good starting point, even if I must contribute to t...
OpenAI Assistant functions on Android
Hello prompt engineers, This week, we are taking one last look at the new Assistants API. Previous blog posts have covered the Retrieval tool with uploaded files and the Code interpreter tool. In today’s post, we’ll add the function that we’d previously built to the fictitious Contoso employee handbook document chat. Configure functions in the playground We’ll start by configuring the assistant in the OpenAI playground. This isn’t required – assistants can be created and figured completely in code – however it’s convenient to be able to test interactively before doing the work to incorporat...
OpenAI Assistant code interpreter on Android
Hello prompt engineers, Over the last few weeks, we’ve looked at different aspects of the new OpenAI Assistant API, both prototyping in the playground and using Kotlin in the JetchatAI sample. In this post we’re going to add the Code Interpreter feature which allows the Assistants API to write and run Python code in a sandboxed execution environment. By using the code interpreter, chat interactions can solve complex math problems, code problems, read and parse data files, and output formatted data files and charts. To keep with the theme of the last few examples, we are going to test the code in...
OpenAI Assistant on Android
Hello prompt engineers, This week we’re continuing to discuss the new Assistant API announced at OpenAI Dev Day. There is documentation available that explains how the API works and shows python/javascript/curl examples, but in this post we’ll implement in Kotlin for Android and Jetpack Compose. You can review the code in this JetchatAI pull request. OpenAI Assistants A few weeks ago, we demonstrated building a simple Assistant in the OpenAI Playground – uploading files, setting a system prompt, and performing RAG-assisted queries – mimicking this Azure demo. To refresh your memory, Figure 1 show...
Test the latest AI features in Kotlin
Hello prompt engineers, Last week we looked at one of the new OpenAI features – Assistants – in the web playground, but good news: the OpenAI Kotlin library is already being updated with the new APIs and you can start to try them out right now in your Android codebase with snapshot package builds. With a few minor configuration changes you can start testing the latest AI features and get ready for a supported package release. Use OpenAI Kotlin library snapshots While new features are being added to the Kotlin library, you can track progress from this GitHub issue and the related PRs including sup...
OpenAI Assistants
Hello prompt engineers, OpenAI held their first Dev Day on November 6th, which included a number of new product announcements, including GPT-4 Turbo with 128K context, function calling updates, JSON mode, improvements to GPT-3.5 Turbo, the Assistant API, DALL*E 3, text-to-speech, and more. This post will focus just on the Assistant API because it greatly simplifies a lot of the challenges we’ve been addressing in the JetchatAI Android sample app. Assistants The Assistants overview explains the key features of the new API and how to implement an example in Python. In today's blog post we'll compar...
Chunking for citations in a document chat
Hello prompt engineers, Last week’s blog introduced a simple “chat over documents” Android implementation, using some example content from this Azure demo. However, if you take a look at the Azure sample, the output is not only summarized from the input PDFs, but it’s also able to cite which document the answer is drawn from (showing in Figure 1). In this blog, we’ll investigate how to add citations to the responses in JetchatAI. Figure 1: Azure OpenAI demo result shows citations for the information presented in the response In order to provide similar information in the JetchatAI documen...
Document chat with OpenAI on Android
Hello prompt engineers, In last week’s discussion on improving embedding efficiency, we mentioned the concept of “chunking”. Chunking is the process of breaking up a longer document (ie. too big to fit under a model’s token limit) into smaller pieces of text, which will be used to generate embeddings for vector similarity comparisons with user queries (just like the droidcon conference session data). Inspired by this Azure Search OpenAI demo, and also the fact that ChatGPT itself released a PDF-ingestion feature this week, we’ve added a “document chat” feature to the JetchatAI Android sample ap...
More efficient embeddings
Hello prompt engineers, I’ve been reading about how to improve the process of reasoning over long documents by optimizing the chunking process (how to break up the text into pieces) and then summarizing before creating embeddings to achieve better responses. In this blog post we’ll try to apply that philosophy to the Jetchat demo’s conference chat, hopefully achieving better chat responses and maybe saving a few cents as well. Basic RAG embedding When we first wrote about building a Retrieval Augmented Generation (RAG) chat feature, we created a ‘chunk’ of information for each conference session....
Responsible AI and content safety
Hello prompt engineers, This week we’re taking a break from code samples to highlight the general availability of Azure AI Content Safety. In this blog series we’ve touched briefly on the using prompt engineering to restrict the types of responses an LLM will provide, such as setting the system prompt to set boundaries on what questions will be answered: Figure 1: System prompt set to "You will answer questions about the speakers and sessions at the droidcon SF conference." However, ensuring a high-quality user experience goes beyond simple guardrails like this. You want your application’...
“Search the web” for up-to-date OpenAI chat responses
Hello prompt engineers, Over the course of this blog series, we have investigated different ways of augmenting the information available to an LLM when answering user queries, such as: However, there is still a challenge getting the model to answer with up-to-date “general information” (for example, if the question relates to events that have occurred after the model’s training). You can see a “real life” example of this when you use Bing Chat versus ChatGPT to search for a new TV show called “Poker Face” which first appeared in 2023: Figure 1: ChatGPT 3.5 training end...
Android tokenizer for OpenAI
Hello prompt engineers, The past few weeks we’ve been extending JetchatAI’s sliding window which manages the size of the chat API calls to stay under the model’s token limit. The code we’ve written so far has used a VERY rough estimate for determining the number of tokens being used in our LLM requests: This very simple approximation is used to calculate prompt sizes to support the sliding window and history summarization functions. Because it’s not an accurate result, it’s either inefficient or risks still exceeding the prompt token limit. Turns out that there is an Android-compatible ...
Speech-to-speech conversing with OpenAI on Android
Hello prompt engineers, Just this week, OpenAI announced that their chat app and website can now ‘hear and speak’. In a huge coincidence (originally inspired by this Azure OpenAI speech to speech doc), we’ve added similar functionality to our Jetpack Compose LLM chat sample based on Jetchat. The screenshot below shows the two new buttons that enable this feature: Figure 1: The microphone and speaker-mute icons added to Jetchat The speech that is transcribed will be added to the chat as though it was typed and sent directly to the LLM. The LLM’s response is then automati...
Infinite chat with history embeddings
Hello prompt engineers, The last few posts have been about the different ways to create an ‘infinite chat’, where the conversation between the user and an LLM model is not limited by the token size limit and as much historical context as possible can be used to answer future queries. We previously covered: These are techniques to help better manage the message history, but they don’t really provide for “infinite” memory. This week, we will investigate storing the entire chat history with embeddings, which should get us closer to the idea of “infinite chat”. One of the first fe...
“Infinite” chat with history summarization
Hello prompt engineers, A few weeks ago we talked about token limits on LLM chat APIs and how this prevents an infinite amount of history being remembered as context. A sliding window can limit the overall context size, and making the sliding window more efficient can help maximize the amount of context sent with each new chat query. However, to include MORE relevant context from a chat history, different approaches are required, such as history summarization or using embeddings of past context. In this post, we’ll consider how summarizing the conversation history that’s beyond the slidi...
De-duplicating context in the chat sliding window
Hello prompt engineers, Last week’s post discussed the concept of a sliding window to keep recent context while preventing LLM chat prompts from exceeding the model’s token limit. The approach involved adding context to the prompt until we've reached the maximum number of tokens the model can accept, then ignoring any remaining older messages and context. This approach doesn’t take into account that some context is duplicated when the results are augmented with embeddings or local functions, because the request contains the augmented source data AND the model’s response contains the relevant in...
Infinite chat using a sliding window
Hello prompt engineers, There are a number of different strategies to support an ‘infinite chat’ using an LLM, required because large language models do not store ‘state’ across API requests and there is a limit to how large a single request can be. In this OpenAI community question on token limit differences in API vs Chat, user damc4 outlines three well-known methods to implement infinite chat: The thread also suggests tools like Langchain can help to implement these approaches, but for learning purposes, we’ll examine them from first principles within the context of the...
OpenAI tokens and limits
Hello prompt engineers, The Jetchat demo that we’ve been covering in this blog series uses the OpenAI Chat API, and in each blog post where we add new features, it supports conversations with a reasonable number of replies. However, just like any LLM request API, there are limits to the number of tokens that can be processed, and the APIs are stateless meaning that all context needed for a given request must be included in the prompt. This means that each chat request and response gets added to the conversation history, and the whole history is sent to the API after each new input so that the co...
Prompt engineering tips
Hello prompt engineers, We’ve been sharing a lot of OpenAI content the last few months, and because each blog post typically focuses on a specific feature or API, there’s often smaller learnings or discoveries that don’t get mentioned or highlighted. In this blog we’re sharing a few little tweaks that we discovered when creating LLM prompts for the samples we’ve shared. Set the system prompt The droidcon SF sessions demo has a few different instructions in its system prompt, each for a specific purpose (explained below): Keep the chat focused The first part of the sy...
Dynamic Sqlite queries with OpenAI chat functions
Hello prompt engineers, Previous blogs explained how to add droidcon session favorites to a database and also cache the embedding vectors in a database – but what if we stored everything in a database and then let the model query it directly? The OpenAI Cookbook examples repo includes a section on how to call functions with model generated arguments, which includes a python demo of a function that understands a database schema and generates SQL that is executed to answer questions from the chat. There’s also a natural language to SQL demo that demonstrates the model’s understanding of SQL. ...
Embedding vector caching (redux)
Hello prompt engineers, Earlier this year I tried to create a hardcoded cache of embedding vectors, only to be thwarted by the limitations of Kotlin (the combined size of the arrays of numbers exceeded Kotlin’s maximum function size). Now that we’ve added Sqlite to the solution to support memory and querying, we can use that infrastructure to also cache the embedding vectors. Note that the version of Sqlite we’ll use on Android does not have any special “vector database” features – instead, the embedding vectors will just be serialized/deserialized and stored in a column. Embedding vector simil...
Chat memory with OpenAI functions
Hello prompt engineers, We first introduced OpenAI chat functions with a weather service and then a time-based conference sessions query. Both of those examples work well for ‘point in time’ queries or questions about a static set of data (e.g., the conference schedule). But each time the JetchatAI app is opened, it has no recollection of previous chats. In this post, we’re going to walk through adding some more function calls to support “favoriting” (and “unfavoriting”) conference sessions so they can be queried later. Figure 1: saving and retrieving a favorited session This will ...
Combining OpenAI function calls with embeddings
Hello prompt engineers, Last week’s post introduced the OpenAI chat function calling to implement a live weather response. This week, we’ll look at how to use function calling to enhance responses when using embeddings to retrieve data isn’t appropriate. The starting point will be the droidcon SF sample we’ve covered previously: Figure 1: droidcon chat and the questions it can answer using the system prompt or embedding similarity As you can see, the droidcon chat implementation can answer questions like “when is droidcon SF?” (using grounding in the system prompt) and “are there any AI s...
OpenAI chat functions on Android
Hello prompt engineers, OpenAI recently announced a new feature – function calling – that makes it easier to extend the chat API with external data and functionality. This post will walk through the code to implement a “chat function” in the JetchatAI sample app (discussed in earlier posts). Following the function calling documentation and the example provided by the OpenAI kotlin client-library, a real-time “weather” data source will be added to the chat. Figures 1 and 2 below show how the chat response before and after implementing the function: Figure 1: without a function to provide r...
Multimodal Augmented Inputs in LLMs using Azure Cognitive Services
Hello AI enthusiasts, This week, we’ll be talking about how you can use Azure Cognitive Services to enhance the types of inputs your Android AI scenarios can support. What makes an LLM multimodal? Popular LLMs like ChatGPT are trained on vast amounts of text from the internet. They accept text as input and provide text as output. Extending that logic a bit further, multimodal models like GPT4 are trained on various datasets containing different types of data, like text and images. As a result, the model can accept multiple data types as input. In a paper titled Language Is Not Al...
Embedding vector caching
Hello prompt engineers, A few weeks ago I added a custom datastore (the droidcon SF schedule) to the Jetchat OpenAI chat sample. One of the ‘hacks’ I used was generating the embeddings used for similarity comparisons on every startup and caching in memory: This results in ~70 web requests each time, plus the (albeit low) monetary cost of the OpenAI embeddings endpoint. It is a fast and easy way to build a demo, but in a production application you would want to avoid both the startup delay and the cost! In this post I’ll discuss my first attempt building a vector cache on-device, and the...
Announcing FoldAwareColumn in Accompanist Adaptive
Hello Jetpack Compose developers, This week, we’re super excited to announce the release of ! This new component is part of Accompanist, Google’s “sandbox” for experimental Jetpack Compose APIs. The Accompanist Adaptive library already contains the component, which we tested out late last year, so will be the second component to join the library. Figure 1. lays out children like a typical (left) unless a separating fold is present, in which case it places children around the fold to ensure that visuals and controls are accessible (right). Component inspiration We first started talking ...
JetchatAI gets smarter with embeddings
Hello prompt engineers, A few weeks ago we finished a series of posts building an AI chatbot using the Jetchat sample with OpenAI. The sample uses the chat and image endpoints, but has the same limitation as many LLMs, which is that its knowledge is limited to the training data (for example, anything after September 2021 is not included). A common requirement for extending these models is to respond with newer data, or internal corporate data, that isn’t part of the model. Re-training isn’t an option, so other patterns have emerged to incorporate additional datasets into chat conversations. I pr...
Improved navigation support in TwoPaneLayout
Hello Jetpack Compose developers, This week, we’re excited to announce an update to our TwoPaneLayout library! You can now use with destinations that accept navigation arguments. This new feature was originally suggested by two developers in our feedback forum, so special thanks to @tscholze and @Papes96 for staying involved in our developer community and helping improve the SDK for everyone. Add TwoPaneLayout to your project To import the new version of TwoPaneLayout, follow these steps: Navigate with arguments With this new update, you can continue using in the sam...
Microsoft Build 2023 recap
Hello mobile developers, Microsoft Build 2023 took place last week, with a big focus on AI technologies. You can find the complete catalog of sessions on the Build website, but we’ve selected a few sessions below that cover topics of interest for mobile developers. The age of AI These sessions cover some of the high-level concepts and big announcements. Keynote – Satya Nadella reviews the recent history of Microsoft’s recent AI releases, like GitHub Copilot, Bing, Power Platform, Microsoft 365, Dynamics 365, and more. He also highlights five of the 50+ product announcements planned for Build...
Blossoming love for Compose animation
Hello Jetpack Compose developers, Today we’ll be finishing up our blog series on animations in Jetpack Compose! This content was inspired by Nicole Terc’s Composable Sheep talk from droidcon NYC. Over the past two weeks, we covered some basics graphics, animation canvases, and basic animations. This week, we’ll polish up our garden with some more complex animation combos and background shaders. Creating more complex animations We’ll be continuing to use our method and composable to build animations in this post, so if you haven’t already, check out the previous blog posts to see how ...
Blooming love for Compose animation
Hello Jetpack Compose developers, Today we’ll be continuing our blog series on animations in Jetpack Compose! This content was inspired by Nicole Terc’s Composable Sheep talk from droidcon NYC. More basic animations We’ll be continuing to use our method and composable to build animations in this post, so if you haven’t already, check out last week’s blog post to see how we built those functions! Last week, we took a look at implementing a basic size animation for our sunflower garden. Today, we’ll learn how to do animations with two other properties: angle and color. Rotation a...
Budding love for compose animation
Hello Jetpack Compose developers, Last week, we did some Compose animation work to build a typing indicator in a chat app. For our next blog series, I’ll be diving into more animation topics with a project inspired by Nicole Terc’s Composable Sheep talk from droidcon NYC. Her composable sheep talk series inspired me to work on my own colorful and playful animated garden project while learning Compose Multiplatform! Inspiration For those of you who haven’t had a chance yet, I’d highly recommend watching the original Compose Sheep talk. There’s also a Composable Sheep sequel from droidcon London,...
JetchatGPT improvements: error handling and animations
Hello prompt engineers and Jetpack Compose developers, Last week, we introduced the JetchatGPT sample to show you how to integrate the OpenAI chat API into an Android app. Instead of building requests manually like in previous blog posts, we showed you how to use the openai-kotlin client library to make it easier to interact with the chat endpoint. This week, we’ll show you how to improve the JetchatGPT user experience by adding error handling when using the client library and building some cool animations! JetchatGPT overview As a reminder, the JetchatGPT sample is a forked version of...
Jetchat with OpenAI on Android
Hello prompt engineers, The last three blogs have been about exploring the OpenAI API completion, edit, and image endpoints from Android, using HttpClient and crafting JSON requests and responses. This post is about implementing the chat API in an Android app, using the open-source client library openai-kotlin on GitHub. The library makes it easier to interact with the chat endpoint because the JSON schema for the request and response is more complicated than the other endpoints which have just one or two parameters and a single response field. “Chatting” is a common way for people to experience...
Does OpenAI on Android dream of electronic sheep
Hello prompt engineers, We’re back with another blog post on using OpenAI in Android applications! So far in this blog series, we’ve covered: Last week, we talked about the different API endpoint options and showed you some examples of how to use the API. Today, we’ll be focusing more on the API and how you can set up some interesting interactions in your Android apps, such as a camera filter with editing capabilities. Images API overview The Images API uses DALL-E models to interact with or generate images based on user prompts. You can use the API in three ways:...
OpenAI API endpoints
Hello prompt engineers, Last week we implemented OpenAI APIs in a basic text editor sample to add features like spell checking. We used the ‘default’ completions endpoint which accepts a prompt string and returns the result, but there are other APIs that are suited to different purposes. For last week’s example, there is a better way to build the spelling and grammar checking using a different endpoint. OpenAI API endpoints The OpenAI documentation and API reference cover the different API endpoints that are available. Popular endpoints include: The focus of this post is us...
ChatGPT on Android with OpenAI
Hello prompt engineers, OpenAI has been in the news a lot recently, with the release of ChatGPT 4 and the integration of Large Language Model (LLM)-driven features into a variety of products and services including Bing, GitHub, and Microsoft 365 applications. Inspired by Syncfusion’s blog post on adding ChatGPT to their .NET blazor text editor, in this post I’m going to add a similar feature to our existing Android Source Editor sample. You can view Syncfusion’s C# implementation on GitHub and our simplified Kotlin version in this pull request. Get started with OpenAI To get started with O...
OpenAI Android developer assistance
Hello budding prompt engineers, Many developers are already getting assistance from GitHub Copilot completing code and more recently the conversational additions to GitHub pull requests, documentation, and the CLI. In this post we’ll look at some of the ways that Android developers can take advantage of OpenAI- and ChatGPT-powered tools. GitHub Copilot in Android Studio GitHub Copilot can be added to Android Studio as a plugin – from the Settings/Preferences screen go to Plugins, search for “copilot” and choose Install: Figure 1: GitHub Copilot in the Plugin Marketplace Once installed (...
Sync to OneNote in Android app using MS Graph
Hello Android developers, Today we’ll be finishing up our blog series on using the Microsoft Authentication Library (MSAL) and the Microsoft Graph. Using these tools, your own Android apps will be able to connect to M365 services. Previously, we covered the basics of MSAL, an introduction to MS Graph for Android, and how to call the MS Graph API in an Android app, so be sure to check out those posts first! This week, we’d like to share a new open-source sample that shows how you can use MSAL and the MS Graph API in more complex scenarios within an Android app. In fact, this new sample is ...
Use Microsoft Graph in an Android app
Hello Android developers, This week, we’ll be continuing our blog series on using the Microsoft Authentication Library (MSAL) and the Microsoft Graph to connect to M365 services in your own Android apps. Previously, we covered the basics of MSAL and an introduction to MS Graph for Android, so be sure to check out those posts first! In this post, we’ll connect all these ideas together by showing you how to call the MS Graph API in Android apps. More specifically, we’ll cover: Review of acquiring tokens with MSAL Before we jump into code snippets for call...
Introduction to Microsoft Graph for Android
Hello Android developers, Today we’ll be continuing our blog series on using the Microsoft Authentication Library (MSAL) and the Microsoft Graph to connect to M365 services in your own Android apps. Last week, we covered the basics of MSAL, so be sure to check that out first! This week, we’ll focus on the Microsoft Graph, specifically: Next week, after you have a better understanding of the Microsoft Graph and how to add permissions to your app registration, we’ll show you how to call the MS Graph API from an Android app! Microsoft Graph Overview The Microsoft...
Authentication in Android apps with MSAL
Hello Android developers, Connecting users to their data is an important factor in the mobile space as it helps to create a personalized experience across multiple devices. As is common across the technology space, users need to provide credentials in order to access their data, often in the form of a username and password, two factor authentication, or authentication token. This is especially true when connecting users to data from their Microsoft accounts, where a valid authentication token is required for each call to APIs like the Microsoft Graph and Azure Cognitive Services. Figure 1. By using ...
Built-in model pre-processing with ONNX
Hello Android developers, Previously we looked at how to pre-process image inputs for an ONNX model using Kotlin. It’s useful to understand this process because the principles apply to any model that you wish to use. On the other hand, having to write boilerplate code for input processing can be tedious – it also means there’s more code that could be buggy and require testing. The ONNXRuntime-Extensions project simplifies this by including custom operators for common pre- and post-processing of model inputs. This means you can build, test, and deploy models that include the necessary input pre-p...
Bringing ONNX models to Android
Hello Android developers, One of the advantages of the ONNX runtime is the ability to run locally on a variety of devices, including mobile devices. This means that your users get fast response times, but also comes with the need to respect mobile device limitations such as app size and the ability to support performance enhancements. For a general overview of how to build a mobile app with ONNX machine learning, follow this high level development flow: Mobile vs full package reference When you add the ONNX runtime to your app project, you can choose to reference pre-built packages...
ONNX runtime inputs and outputs
Hello Android developers, Last week we got an ONNX runtime demo running on Android, which classified the subject of images being streamed from the device’s camera. Setup required downloading a pre-trained model and adding it to the sample app on GitHub. This week we’re going to look into the details of preparing inputs for the model, following the sample app’s code. Model inputs Pre-trained models in formats that can be shared across platforms are incredibly powerful, but it makes sense that each model must have inputs supplied in a known and repeatable way to get the most accurate results. Model...
On-device machine learning with ONNX
Hello Android developers, This week we’re going to get started with on-device machine learning using the ONNX Runtime and check out an Android sample that identifies the objects using the camera video stream. What is ONNX? ONNX stands for Open Neural Network eXchange and is an open-source format for AI models. ONNX supports interoperability between frameworks and optimization and acceleration options on each supported platform. The ONNX Runtime is available across a large variety of platforms, and provides developers with the tools to run machine learning models locally. Pre-trained model...
Relay Anchor Leg: Overall impressions
Hello Compose developers, Over the last two weeks, I’ve given a brief introduction to Relay, as well as talked about some of the tips and tricks I picked up while using the tool. This week, I’ll share my thoughts on the current state of Relay from the developer point of view. As a reminder, Relay is in alpha, so please go try it out and send the Relay team your feedback! Favorite features Even though Relay is very new, I think the team did a great job of building many helpful features into the first versions of the product. Some of my favorites include: Validation in Figma plugin ...
Relay Leg 2: Tips and tricks
Hello Compose developers, Last week, I gave a brief introduction to Relay, the new Figma to Compose tool developed by Google. This week, I’ll dive deeper into some tips and tricks I learned when testing out Relay, As a reminder, Relay is in alpha, so please go try it out and send the Relay team your feedback! Putting Relay to the test After following introductory tutorials, my next step in learning Relay was to test it out in a variety of scenarios. Since I’m not a designer, I decided to try out the tool on some existing Figma designs from the Surface Duo Dual Screen Experience Example, th...
Pass the design baton with Relay
Hello Compose developers, Over the holidays, I finally got the chance to test out Relay, the new tool released by Google late last year. The goal of Relay is to simplify the “handoff problem” between designers and developers by translating Figma designs directly into Compose code. Figure 1. Viewing the StatusCard and Chip UI packages with the Relay for Figma plugin. This week, I’d like to share my experience with learning the tool and share some introductory resources. Since Relay is still in alpha, I’m sure we’ll see lots of updates this year, so I highly encourage you to try it out and ...
Happy New Year 2023
Hello app builders, We’re excited to kick off the new year with a summary of all the great design and user experience guidance from the foldable and large-screen ecosystem. Can’t wait to see what new apps evolve in 2023! Large screen design patterns Read about the similarities and unique elements of the large screen design patterns from the Surface Duo Design Kit and the Android Material Design site. User experiences like list-detail navigation can scale across all form factors: Visit the Android large-screen landing page for code resources and the sample gallery. The materi...
2022 year in review
Hello Android developers, Since 2022 was a year busy with conferences, here's a recap of the many places you could learn more about foldable and large screen development across the world (and online) last year. Google I/O The first big event of 2022 was Google I/O in May. You can check out the foldable highlights or watch this recap: Another announcement at Google I/O was Flutter 3 which included foldable support. Details are available in our docs and samples. Microsoft Build May also saw the team sharing details on how to do automated testing with foldable apps at Microsoft Build....
Happy Holidays 2022
Hello Android developers, Inspired by the growth of AI and its role in products like GitHub’s Copilot this year, we asked ChatGPT to “propose some applications for Surface Duo owners to use over the holidays”… One possible application for Surface Duo owners to use over the holidays could be to use the dual screens to create a digital holiday card. You could use one screen to design the card, using a combination of text, images, and graphics, and the other screen to preview and fine-tune your design. Another application could be to use the Surface Duo as a mobile cooking companion in the...
Drag and drop with AndroidX
Hello Android developers, Foldable and large-screen devices are great for multi-tasking – you can position two apps side-by-side to compare data or just do two things at once! The other benefit of side-by-side apps is the ability to drag and drop content between them, whether the apps are across screens on a dual-screen device, or next to each other in multi-window mode on a tablet device. The Surface Duo drag and drop sample has been updated to use the AndroidX drag and drop package to show how to add this feature to your apps. This package provides helper methods to simplify drag and drop implem...
Compose TwoPaneLayout updates
Hello Compose developers, This week, we’d like to announce two major updates to our TwoPaneLayout component that come with version . We hope these updates will help make the library even more flexible and useful for you all. We also have some other Compose SDK updates to announce! New value in PaneMode enum It may seem counterintuitive, but we actually decided to add a value to the TwoPaneMode enum. As a reminder, the pane mode in TwoPaneLayout helps you choose when you want to show one or two panes. We realized that, in some cases, people may want to change the pane mode dynamically,...
droidcon New York and London
Hello Android developers! It has been great to see the community face-to-face at droidcon events around the world in 2022. The Surface Duo team really enjoyed meeting folks, presenting, and discussing foldable app development face-to-face. If you didn’t make it to an event (or if you did but want to re-live it) more sessions are now available to view for free online.droidcon London 2022 droidcon London videos available Talks from droidcon London are available now to watch online, including John Wiese finding success on dual-screen, foldable, and large screens with a hint of Flutter: ...
Android Dev Summit recap
Hello Android developers, Google is running a number of Android Dev Summit events around the world in 2022, with all sessions available to view online. Here are some of the highlights for foldable and large-screen developers: Android Dev Summit – Modern Android Development The first event, focused on Modern Android Development, was hosted in Silicon Valley on October 24th, 2022. All sessions can be viewed from this YouTube playlist: Android Dev Summit – Form Factors The second event, focused on Form Factors, was hosted in London on November 9th, 2022. All sessions can be viewed ...
Large-screen design patterns
Hello app designers, At the first Android Dev Summit of 2022 Google announced updated large screen design guidance, gallery, and tips for foldables. These updates included a list of canonical layouts which are complementary to the dual-screen design patterns featured in the Surface Duo developer documentation. Material Design has also been updated, so there is a lot of support for designers looking to create new experiences that go beyond a small phone screen. This post helps designers and developers looking to build for both foldable and large-screen devices to combine both sources of guidanc...
.NET MAUI for Android and cross-platform apps
Hello .NET developers, .NET Conf is happening this week and one of the big announcements is the release of .NET 7 which includes an updated release of .NET MAUI for .NET 7. The latest .NET MAUI release includes dual-screen Android support based on Jetpack Window Manager, so you can build cross-platform apps for mobile and desktop that also adapt to foldable Android devices. .NET MAUI (Multi-platform App UI) .NET MAUI lets you build apps for Android, iOS, macOS, Windows, and Tizen on all types of devices from mobile phones to tablets and desktop form factors. Apps are built with C# and XAML using ...
Activity Embedding preview for large screens and foldables
Hello Android developers, The Jetpack Window Manager (JWM) library helps you build adaptive UIs that work well on any device form factor (i.e. single screen, dual screen, foldable, and large screen devices). Jetpack Window Manager provides you with the information that you need to adapt your app’s UI, so it works well on any device. For example, you can know where a folding feature is located, the posture that the device is using according to the folding feature and its orientation, etc. Activity Embedding Activity Embedding is part of Jetpack Window Manager version 1.1 alpha and contains APIs that h...
Android 12L for developers on Surface Duo
Hello Android developers! We're excited to see that Android 12L is being rolled out to Surface Duo devices, and equally keen to see what the Android developer community builds to support it. Android 12L for foldable app developers The good news for developers is that dual-screen APIs have not changed and foldable app enhancements written for earlier versions of Android will continue to work. Here are just a few of the ways that developers build foldable and large-screen aware apps for Android 12L: Dual-screen libraries Take advantage of our developer and designer resources at learn.micros...
Persisting and sharing ink
Hello Android developers! We have some updates to the InkSDK that we would like to share with you, as well as some general guidance on persisting ink and open ink standards. Overview While Android provides different canvases for rendering ink, there is little guidance on how to store that ink or what format it should be in when communicating with other apps. Let’s dive into some topics surrounding this concept. Persisting Ink Rendering ink on a canvas is important, but how that data is pulled off the canvas and saved is equally as important. In the previous InkSDK ve...
Foldable Navigation Rail
Hello Android developers! This week we’re excited to share with you a new library to make it easy to support Navigation Rail on foldable devices like Surface Duo. Navigation Rail package One of the tricks when building mobile apps for Surface Duo devices is to avoid your UI being obscured by the hinge. Controls that aren’t aware of foldable devices may place elements “under” the fold area, making them hard to read and touch: To avoid this typically requires custom code using the from the Jetpack Window Manager, observing changes to the , and adjusting the layout accordingly. ...
Designing for foldable and large screens
Hello app designers! Today we are going to talk about designing for foldable and large screens. We’ve been practicing responsive web design for a long time - let's use those concepts to optimze your mobile app for different platforms and devices. Mobile apps can use adaptive designs to deliver a consistent app experience. In today’s blog, we will be talking about the design recommendations when adapting your app to foldable and large screens. Design for unique posturesPosture overview The difference between foldable and large screens with regular mobile devices is the diversity of postures. Postu...
Show off your apps with Phone Link
Hello Android developers! This week we’re going to share some tips and tricks to help you show off your development work in meetings, livestreams, recordings, blog posts, or anywhere else you want a video or still of your app! Demo-ing with Phone Link Your phone’s screen can be mirrored on Surface Duo and other supported devices by using Phone Link. The mirroring is done via WiFi and works best with a strong wireless network connection. The following steps are required to set up Phone Link: It doesn’t require any adb or other technical setup which means it can al...
Jetpack Compose Accompanist TwoPane
Hello Compose developers! This week, we’d like to talk about the TwoPane layout from Google’s Accompanist Adaptive library! Not to be confused with our own Microsoft Compose SDK TwoPaneLayout component, TwoPane from Accompanist is a fold-aware UI component that works great for cases when you always want to show two pieces of content. Accompanist libraries If you’re unfamiliar with Accompanist, it’s a group of support/utility libraries built for Jetpack Compose. These libraries are considered to be more experimental, which is why they’re not yet part of AndroidX, but according to Google, th...
Improving app accessibility with Jetpack Compose
Hello Jetpack Compose developers! This week, we’d like to share how we started improving the accessibility of our Compose samples. Accessibility in Android can relate to many different aspects of your apps, ranging from content descriptions and color contrast to layout hierarchy and touch target size. Regardless of where you start, know that improving accessibility will ensure better experiences for all users! Figure 1. The DragAndDrop sample view groupings in TalkBack before and after accessibility updates. Getting started Before making any changes to the samples, we first s...
Surface Duo Design Kit 2.2 update
Hello app designers! Our Surface Duo Design Kit is now updated to version 2.2. If you haven’t heard of this kit before, Surface Duo Design Kit is the go-to place where you can find all our UX design suggestions and UI components for both Surface Duo and Surface Duo 2. It includes many of the interface components which you can handily grab and use. About a year ago, we released the Surface Duo Design Kit v2.0, and since then we have been continuously fixing issues, adding new components, and providing more samples to help you use this kit to design your apps. In this v2.2 update, we mainl...
Dual-screen example adds Jetpack Compose to the experience
Hello Compose developers! This week, we’re excited to announce two big updates to our dual-screen experience example: a Compose refactor of the catalog page and a brand new order history page. The dual-screen experience example provides an end-to-end experience centered around a travelling guitar salesperson, with options to find fake guitar stores, read a catalog, browse products, place fake guitar orders, and now, view order history. Figure 1. Screenshot of the new catalog page The main goal of this sample is to highlight the different ways developers can take advantage of the du...
Experimenting with postures in Flutter
The things I'm doing in this article are highly experimental. By the end of it hopefully you will agree with these two statements: To achieve the desired behavior, I end up using several hacky techniques which I would think twice before shipping to production. This article is not a tutorial. It is a story of the fun I had with flutter and Surface Duo. Proceed with caution, you have been warned 😊. What I built First let’s have a look at what I am trying to achieve. This video walks you through the idea; I also explain the idea in text and image in this section: Imagine a two-player t...
droidcon Berlin and Surface Duo video collection
Hello Android developers! This week we were inspired by a forum question about interesting Surface Duo media content and provide a variety of different video and audio resources where you can learn more about Surface Duo, foldable devices, and dual-screen Android app development! If you want to chat in person, we’ll also be at these upcoming droidcon events: Please come visit us and share your foldable and large screen development experiences! droidcon Berlin During July 6-8 we had the pleasure to participate in droidcon Berlin. We spent three fantastic days meeting the Android...
Test Kit Annotations update
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...
Making a gamepad for my Flutter game
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...
Drag and drop library for Jetpack Compose
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...
droidcon San Francisco recap
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...
Source Editor & Diary samples for Jetpack Compose
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...
Notifications on the Glance Bar
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...
Video+Chat and Calculator samples for Jetpack Compose
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,...
Jetpack Compose TwoPaneLayout update
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 ...
Responsive layouts in Flutter with TwoPane
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...
Bazel build
Hello Android developers, Today we are going to go through an interesting topic, we will learn what it is and how to use Bazel, a build and test tool similar to Make, Maven, and Gradle. Many great companies and OSS projects are already using Bazel to build their software. Would you like to try it out for your Android app? In this blog post you will learn how to do it. What is Bazel? The bazel.build site says: Bazel is an open-source build and test tool. It uses a human-readable, high-level build language. It supports projects in multiple languages and build outputs for multiple platforms. Ba...
Dual-screen case study: Total Commander – file manager
Hello Android developers! We’re excited to announce that one of the most famous dual-pane apps of all time has been enhanced for Surface Duo dual-screen devices. Total Commander file manager’s iconic dual-pane design has been one of its most recognizable features, starting from its Windows roots and continuing on Android. This dual-pane design is a perfect match for Surface Duo devices, where each file explorer pane can be shown on one of the two screens. Starting with the 3.30 version release made on February 8, 2022, Total Commander now supports dual-screen features. You can get the app...
Surface at Microsoft Build 2022
Hello developers! Another blog, another Android event! While Google I/O seems like it happened in the distant past, Microsoft Build 2022 is here to help developers expand their skillset by exploring new and emerging technologies. Microsoft Build features the best of what technology has to offer, and you can gain insights from developers and creators located around the world. We’re thrilled to see discussions centered on so many Android and cross-platform topics across Microsoft. Here are some highlights from this week! Skilling up with Android UI Test Android testing across different devic...
Flutter foldable support is now stable
Hello! Flutter 3 was announced last week, and we have good news to share with you. The foldable support that we contributed to Flutter is now released in the latest stable branch. Let us dive into what this means for you. We will first go over the new API that you can use and then review what else Flutter now does for you out of the box. What are Display Features? Display features are parts of the display that create a visual distortion and can create a logical separation in the screen space. Our focus is on the hinge of the Surface Duo, but that is not the only type of display feature that Flutter ...
Google I/O 2022 recap
Hello Android developers, Another Google I/O has flown by, and we were excited to see sessions on foldable user experience design as well as developer-focused talks for updating existing apps to be more responsive and using Jetpack Compose. Here are our favorite sessions and announcements from the past few days: Flutter 3 announced Flutter 3 was released during Google I/O 2022, and the final piece of foldable support is now added to the framework: dialogs that can avoid the hinge or fold. Flutter now has extensive foldable support, and the TwoPane widget from pub.dev provides a layout option that...
Accessibility in a dual-screen application
Hello Android developers! Accessibility is an important step in the design and development flow of any Android application. Ensuring that everyone can use it in any situation will make the experience better, and the app will benefit from having an extended and diverse audience. When you design your app with accessibility in mind, you ensure that people with disabilities understand your application better, benefit from increased user satisfaction and will receive feedback from a diverse user base. An important feature of large screens and foldable devices is the extra space, which helps improve ...
Develop with Windows Subsystem for Android
Hello Android developers! We recently had a query via social media about how Windows Subsystem for Android (WSA) might be relevant for Microsoft Surface Duo developers. Today’s post explains how to install the Windows Subsystem for Android and some of the ways it can be useful for developers. WSA won’t replace other methods of testing, but it can be a useful addition to physical devices and the Surface Duo emulator. You can read more about Windows Subsystem for Android in the documentation. Note that WSA is currently only available in the United States. Set up Windows Subsystem for Android ...
Join us at droidcon in 2022
Hello Android developers! We’re excited to announce that conference events are offering in-person attendance this year, which means we’ll be able to meet face-to-face in addition to interacting via social media and Twitch! droidcon San Francisco The first event on our droidcon calendar is San Francisco on June 2nd and 3rd. Join us at droidcon to learn more about building dual-screen and foldable apps for Android. I will be presenting a talk on Jetpack Compose: Foldable, Meet Compose Have you started to think about building or enhancing your application on foldable, dual-screen, and large-...
isSeparating: the field that unites all foldables
Hello Android developers, Today we are going to talk about a very useful field that is part of Jetpack Window Manager library. This field is called isSeparating, and will help you to understand when there is content separated by a FoldingFeature on a foldable device. The value of isSeparating will be if there is no content that is separated by a hinge or a fold. The value of isSeparating will be if there is content that is separated by a hinge or a fold. Is this field and the value it holds valid for all kinds of foldable devices, no matter how many physical displays or types of ...
Snackbar for dual-screens
Hello Android developers! We are excited to announce the release of our latest Android component: SnackbarContainer. The new SnackbarContainer allows you to place a Snackbar on a specific display area on foldable devices, while keeping the original Snackbar behaviour in conventional single screen devices. The SnackbarContainer will help you to show a Snackbar at the bottom of the first screen, second screen, or across the entire display area. This additional flexibility allows you place the Snackbar where the user is currently focused to create a better user experience, especially on devices w...
Foldable ExoPlayer video… plus trivia
Hello Android developers! Video is an important element of many different types of mobile apps, including those designed for viewing TV and movie shows, livestreaming, social sharing, voice calling, meetings, training, and anything in-between. Large screen and foldable devices are ideal for this type of content because there’s more space to see the video and also to interact with the content and with others. Last year we shared two samples – Folding video and Folding video + chat – which demonstrate how to incorporate the ExoPlayer component into foldable layouts for Microsoft Surface Duo and ot...
Write foldable tests quickly with Test Kit
Hello Android developers! This week, we’re super excited to announce that we’ve released the first version of our foldable Test Kit. The Test Kit currently includes two testing utility libraries, one for layouts built with views and another for layouts built with Jetpack Compose, and we’re looking forward to adding more testing capabilities in the future! Library overview The goal of these testing libraries is to make it easier to write UI tests for foldables. We’ve included several different helper methods for creating mock folding features, simulating spanning gestures, and other useful uti...
Microsoft Surface Duo Android Emulator update
Hello Android developers, We’re excited to announce the release of an updated Surface Duo Emulator that is based on Android 11 and runs as an Android Virtual Device (AVD), supporting different screen sizes for both Surface Duo and Surface Duo 2 devices. Download now You can download the Surface Duo Emulator package from the Microsoft Download Center. We now support both Android 10 and Android 11 on Windows, Mac, and Linux platforms. You can choose the right one from the following list based on your development environment: Figure 1. Download file list in Microsoft Download Center As...
Microsoft Edge dual-screen web APIs
Hello dual-screen web developers! Microsoft Edge version 97 included the dual-screen web APIs that have been in preview since last year. Now Microsoft Surface Duo users with the latest Edge will get an enhanced web experience automatically when sites have implemented the CSS or JavaScript dual-screen APIs. Visit the dual-screen web documentation for more information on the APIs, as well as how to test on devices, emulators, and using desktop browser developer tools! Today’s post discusses the APIs you can use to adapt your content to dual-screen devices using either CSS or JavaScript. Dual-...
Jetpack Compose UI testing
Hello Jetpack Compose developers! We’re excited to announce that UI tests have been added to all our Compose samples! We learned a lot throughout the process of adding these tests, so we hope this week’s blog post makes it easier for you to start testing your own Compose layouts, especially when testing for compatibility with large screen and foldable devices. Compose testing basics Like with any other testing framework, the first step in writing UI tests with Compose is to import testing libraries and create an instrumented test class. For basic Compose tests, you need the following d...
Foldable Flutter follow-up
How else to start this article other than saying Hello Flutter developers! This is an update on the foldable support we are contributing to Flutter, along with samples and other goodies for you to try out. Before we dive in, here is a video presenting most of what you are about to read. This is from the Flutter Vikings conference which lasted for two days, but don't worry, our updates only take 30 minutes of your time. The last part of the video shows me enhancing an existing application. The current state of PRs In our last update, we invited you to have a look at the PRs we opened on the Flutter Framew...
Foldable Navigation component update
Hello Android developers! We’re excited to announce the release of our latest SDK component, Foldable Navigation Component, which is an extension of Jetpack Navigation Component and is now available for foldable devices. How to add Foldable Navigation Component to your project How it works Jetpack Navigation Component is a set of tools, libraries, and guidance to help developers create quality apps, simplifies the navigation between fragments or activities, and provides a way to visualize the navigation flow for the entire app. Instead of having only a single fragment on the display a...
Dual-screen app design walkthrough
Hello designers, This week we are excited to share with you our journey that inspires, educates, and showcases real world usage of various design patterns and provides designers a sense of exploring foldables with working examples of how to make use of the dual-screen/folding form factors in different ways when an application is spanning both displays. The experience of this sample application is centered around the needs of a travelling salesperson who visits various stores across the city that buy the salesperson’s products. The sample app helps the salesperson select and navigate to m...
Dual-screen gaming on Microsoft Surface Duo
Today's post was contributed by Gameloft, publishers of Asphalt 9: Legends, Modern Combat 5, and Dungeon Hunter 5. Hello Android developers! It was great that we had a chance to work with Surface Duo and adapt three of our most popular games: Asphalt 9: Legends, Modern Combat 5 and Dungeon Hunter 5, for this awesome device. Surface Duo and Surface Duo 2 have two screens, which allows users to view images or watch videos on one screen while doing their tasks on the other screen. It enhances the user experience with all of that extra wide space, especially while playing games. Double screens – double fu...
Foldable SDK update with Jetpack Window Manager
Hello Android developers, Jetpack WindowManager version 1.0.0 was released yesterday. We are thrilled about this announcement and wanted to share with you this exciting news and our latest library updates that are based on Jetpack Window Manager. Thus, these dual-screen libraries for Android developers are more foldable aware than ever! The changes in the latest release are: Version information for each library (to use in your gradle files): This blog post explains how to migrate from the previous versions and describes the other new featur...
Jetpack Compose WindowState preview
Hello Jetpack Compose developers! This week, we’d like to announce the release of WindowState, a new utility library that’s part of our Compose SDK. Our goal was to provide easy access to all the window information provided by the Jetpack Window Manager library and to simplify the logic required to enhance your apps for large screens and foldables. Library overview The main features of the library are the WindowState data class, which contains three categories of information, and the helper function. Figure 1. Constructor for the WindowState data class and function signature for rememberW...
Jetpack Window Manager release candidate
Hello Android developers! Google recently updated a number of dual-screen and foldable packages –Window Manager, SlidingPaneLayout, Navigation, and Preference – to release candidate. These components can be used to create unique user experiences on the Microsoft Surface Duo and other foldable devices. Jetpack Window Manager The WindowInfoTracker class provides an API for your app to respond each time the layout changes and is affected by a hinge or fold. There are a number of examples in the Window Manager samples repo which use the library as shown here: Sliding Pane Layout ...
Happy Two Year
Hello developers! Welcome to 2022 – a great year to be developing for two screens! To kick off the new year we’re going to do a quick recap of all the two screen enhanced components – across developer platforms – that can help you get started quickly with dual-screen and foldable support, while also providing great single-screen experiences on phones or larger-screen devices. Two screen native controls Among our rich library of dual-screen controls, the FoldableLayout component provides an easy way for Kotlin and Java developers to build an adaptive user interface without having to write a lot of...
2021 dual-screen year in review
Hello Android developers! 2021 was a big year for dual-screen devices with the release of Microsoft Surface Duo 2. It has also been a busy year for developers with Jetpack Window Manager – Google’s common API for foldable device info – graduating from alpha to beta and then release candidate, the SlidingPaneLayout control was enhanced for foldables, and we also expanded our platform support to Jetpack Compose and Flutter. With the year quickly coming to a close, this week we’re going to revisit some of the most popular content from the Surface Duo developer blog. Popular blog posts Through...
Happy holidays
Hello Android developers! As the weather cools down (or heats up, depending on your hemisphere), it’s time to take a break and ease into the new year. If you’re using down time to learn a new skill or get some personal projects underway, we have plenty of content to keep you entertained! Here’s some suggestions for Microsoft Surface Duo developers to watch online (and be sure to read to the end for a few game suggestions to play). Twitch livestreams Each week the Surface Duo developer experience team discuss our blog topics in detail on Twitch at twitch.tv/SurfaceDuoDev. Developers can joi...
Dual-screen reference app
Hello Android developers! We’re excited to announce the release of our latest sample application, Dual Screen Experience Example, both as open-source code on GitHub and also available for download from Google Play. What is the sample about? The sample application provides developers and designers with the possibility to explore the dual screen form factor value for productivity on the go. As a user you are going to play the role of a travelling salesperson that is searching to supply super cool guitars to a couple of guitar stores in Redmond. Each store is marked on the map using an ...
Microsoft Surface Duo at droidcon
Hello Android developers! The Surface Duo Developer Experience team presented at our first in-person events this year, at droidcon in Berlin and London. droidcon Berlin We presented our brand-new Surface Duo 2 in Berlin. People loved the device and the possibilities that it offers. We delivered a talk and a workshop. The talk was focused on showing attendees what foldable devices are, the distinct types (single screen foldables and dual-screen foldables) and the postures these devices can have. The second part of the talk, covered the different components that developers currently ...
Android foldable support on Uno Platform
Hello XAML developers! The Uno Platform has supported Microsoft Surface Duo since early 2020 – the Uno Platform team even shared get started tips on this blog. This support was based on the DuoSDK NuGet, which exposes the Microsoft DisplayMask API in C#. The Uno Platform implements the TwoPaneView control on all supported platforms, and by adding the Uno.UI.DualScreen NuGet it will ‘light up’ on Surface Duo, detecting the hinge and laying out the two panes accordingly. At UnoConf 2021 this week, we announced that we’ve been working with the Uno Platform team to support the new Jetpack Window Man...
Foldable CSS and JavaScript update for web developers
Hello web developers! The dual-screen CSS and JavaScript enhancements for Microsoft Edge were initially shared in June 2020 when they were first available behind a feature flag for testing. Since then there has been a lot of work and feedback on the proposals, and the implementation currently available in the latest version of Microsoft Edge (version 96) has been updated to reflect the final API design. The changes are described below, and the documentation is up to date for the latest CSS and latest JavaScript syntax. These features are still behind a feature flag which you can enable for test...
Get started with Jetpack Compose
Hello (future) Jetpack Compose developers! This week, we want to talk about how to get started on building applications with Jetpack Compose. A few of us on the Surface Duo Developer Experience team recently began learning Compose, so we’d like to share some advice and resources with you. To read more about the work we’ve been doing with Compose, check out our NavigationRail, TwoPaneLayout, Compose for foldables, and Compose on Microsoft Surface Duo blog posts. Overview For those of you who are unfamiliar with Compose, it’s a declarative UI toolkit that acts as a replacement for the XML la...
Design Kit 2.1
Hello designers! We recently unveiled Design Kit v2.1 – a set of updates to the design system kit that enables you to create dual-screen and foldable experiences for Microsoft Surface Duo and Surface Duo 2 in Figma. Figure 1: Design Kit v2.1 on Figma Figma device frame Figure 2: Figma device frames Today you can start creating wireframes and mockups for Surface Duo and Surface Duo 2 by grabbing the Figma frame and placing your components inside them. Visually you may notice that Surface Duo 2 has a taller frame height and slimmer hinge compared to Surface Duo since it ro...
Jetpack Compose Navigation Rail
Hello Jetpack Compose developers! This week, we released a new sample that demonstrates how to use the NavigationRail component with large screen and foldable devices. These guidelines were also introduced recently in the Microsoft Surface Duo Design Kit 2.1. Create a NavigationRail with Compose We first blogged about NavigationRail in August, when we described how to use it in a dual-screen sample with XML layouts. As a reminder, the NavigationRail component is used for navigation on large screens and can hold 3-7 app destinations, plus a logo or floating action button. To add a NavigationRail to your Co...
Android Dev Summit recap
Hello Android developers! This week’s blog includes lots of news from Google's Android Dev Summit – especially for dual-screen, foldable, and large screen app developers. The Surface Duo Developer Experience team is here to help developers plan and adapt their Android apps for new form factors like Microsoft Surface Duo 2. Here are some highlights from the summit and where to get more information to put the ideas into practice! Dual-screen and foldable apps The Android team ran a session focused on building or adapting apps for large screen and foldable devices, building on their large sc...
See your app on Microsoft Surface Duo 2!
Hello Android developers! Now that Surface Duo 2 is readily available, there’s even more reason to start enhancing your Android apps for foldable devices. Visit our developer documentation to get started! Figure 1: Surface Duo 2 is now available! Surface Duo 2 emulator If you don’t yet have a device, you can easily build and test apps for Surface Duo 2 using our latest Android 11 emulator. Download and install the Surface Duo 2 emulator to test your apps in single and dual-screen modes, including adjustments based on hinge angle: Figure 2: Surface Duo 2 emulator device post...
Happy Hacktober
Hello open source developers! For the past few years October has become synonymous with open source, so this year we’ve decided to opt-in our samples repositories to Hacktoberfest to encourage the community to join us in building dual-screen enhanced Android projects. Figure 1: Build or contribute to apps for Microsoft Surface Duo 2 What is Hacktoberfest? Hacktoberfest is a celebration of open source projects and contributions, run by Digital Ocean. It encourages developers to participate in open source projects with the offer of a free t-shirt for qualifying contributions. We’ve adde...
Erase pen handling code with the Ink SDK
Hello Android developers! We’ve just updated one of our existing samples – TwoNote – to include the Ink SDK preview introduced in March and updated in July. TwoNote now also uses the Jetpack Window Manager library to provide foldable support. If you want to check out the updated sample for yourself, this is the perfect time to download the new Microsoft Surface Duo 2 emulator and start building or enhancing apps for Surface Duo 2! Pen and ink SDK The SDK is based on the pen input classes available in Android, as demonstrated in our sample, and it provides two main classes to help you implement pen support...
Adapting to Android multi-window and foldable devices
Hello Android developers! Although multi-window support was first introduced in Android 7 (API 24), many developers are only recently starting to adapt their code to this feature as dual-screen, foldable, and large-screen devices are becoming more common. If you’re considering adapting your apps for the latest larger-screen devices, today’s post contains some strategies and tips to help you build responsive Android layouts, including for Microsoft Surface Duo. Jetpack Window Manager The most useful package for working with dual-screen and foldable devices is Jetpack Window Manager, which prov...
Develop for Surface Duo 2
Hello Android developers! At yesterday’s Microsoft event we introduced the new Microsoft Surface Duo 2. Today I’d like to invite developers to start building or enhancing apps for dual-screen devices like the Surface Duo, Surface Duo 2, and other foldables. Surface Duo 2 The new Surface Duo 2 includes 5G support, three rear-facing cameras (including ultra-wide and telephoto), larger and brighter screens, a faster CPU, and a lot more! Learn more about Surface Duo 2 and pre-order on microsoft.com. Figure 1: Surface Duo 2 Jetpack Window Manager The best way to adapt your appl...
Android emulator multi-touch support
Hello Android developers! We’re excited to announce that version 30.9.0 of the Android emulator now supports multiple touch points to let you test gestures and interactions that require more than one finger! Multi-touch support requires the emulator be running on a touch screen device, which includes most modern Windows PCs, including the Microsoft Surface line. Pinch, zoom, rotation etc. Lots of common UI practices are hard to test on emulators without multi-touch support, including pinch and spread gestures common on map controls, and zooming photos, web pages, and other content. Figure...
Unity and Jetpack Window Manager
Hello game developers! We’ve covered Jetpack Window Manager in the docs, and previously blogged about how to integrate the DisplayMask API into a Unity sample. In this post I’ll describe how to extend a Unity project to integrate native Android code and configuration to include the Jetpack Window Manager package and provide dual-screen and foldable device information to your Unity app or game. By providing folding feature information you can adapt your Unity code to move user interface elements away from the hinge, adapt gameplay for foldable devices, or even incorporate device features like the...
Travel Planner dual-screen sample app
Hello Android developers! Over the summer, Hersh and I worked on a sample app that demonstrates a variety of dual-screen app possibilities. We used APIs like Jetpack Window Manager to create features that work across different foldable devices, including Microsoft Surface Duo. In this post, I’ve highlighted some of our favorite features that highlight cool dual-screen user experiences. Travel Planner app The sample is a Travel Planner app designed to help plan vacations and other travel. In this app, users can create and track trips’ dates, locations, and other information. The source code is...
Android Emulator native host pen support
Hello Android developers! We’re excited to announce that version 30.8.3 of the Android Emulator now includes active pen support to let you test pen-specific features like pressure sensitivity, orientation, eraser tip, and input button! Pen support requires the emulator be running on a device with a specific pen digitizer technology, which is present on modern portable devices including the Windows Surface line. Devices from the Microsoft Surface family, like the Surface Laptop, Book, Pro, or Surface Duo work great with an active pen like the Microsoft Surface (Slim) Pen, but other devices...
Dual-screen Navigation Rail
Hello Android developers! Google recently published a new landing page for building responsive layouts for larger screens (including dual-screen and foldable devices). The new NavigationRail widget includes features and guidance as an efficient way to navigate app features on larger screens. About NavigationRail NavigationRail is a material design component for top-level navigation on larger screens. It provides a variety of display options with icons, text, and even a floating action button if needed. For a responsive experience across phones, dual-screen/foldable, and tablet devices, it can be coup...
Jetpack Window Manager alpha10 update
Hello Android developers! Google recently released the latest version of the Jetpack Window Manager package, and as with previous releases, we’ve updated our docs and samples to match. This post walks through using the new API to get layout updates when your apps are running on dual-screen and foldable devices, like Microsoft Surface Duo. UPDATE: on August 18th, 2021 Google released beta01 of the Jetpack Window Manager package. The Java sample for this post has been updated and modified from what's shown below to ensure the is removed when appropriate. Update to alpha10 The latest release of Wi...
Dual-screen developer tools recap
Hello dual-screen developers, Each week we cover a different aspect of dual-screen development, but with so much happening it’s difficult to cover ALL of the platforms that support the Microsoft Surface Duo. This post is a quick run-down of all the different tools and platforms that developers can use to create dual-screen experiences on Android. Surface Duo Android emulator The free Surface Duo emulator image download makes it easy to get started with dual-screen development. It works with all the different developer platforms and provides a complete dual-screen experience, including the ability...
TwoDo dual-screen data entry sample
Hello Android developers! A common “first app” for new developers is a simple to-do list app – it typically incorporates data entry, database storage, multiple views, and simple navigation, so it’s great for learning. The app I’m sharing today, called TwoDo, is exactly that, except it is also built for dual-screen devices like Microsoft Surface Duo. It will ultimately be used in a Microsoft Learn module to show developers how they can use Jetpack Window Manager to create dual-screen app experiences. App Overview TwoDo is a basic to-do list app that leverages the dual-screen layout of foldabl...
eBook sample with Jetpack Window Manager
Hello Android developers! Reading books on Microsoft Surface Duo can be a great take on the classic reading experience. In this blog, we will walk through an eBook reader sample I created as an internship project. This eBook sample demonstrates how the Two Page layout for foldable devices can naturally spread content across multiple screens. Base functionality This project is designed to load plain text files and present them in book form. The text is parsed into chapters according to some basic rules, and chapters are cached as arrays of strings (one string per paragraph). To build pages, the co...
New TwoPaneLayout Compose library preview
Hello Android developers! Google just announced the first release candidate for Compose on 07/01. We are getting one big step closer to stable this month! In previous blogs, Jetpack Compose on foldable and dual-screen development and Jetpack Compose on Microsoft Surface Duo, we mentioned that there are two main steps you can implement to develop or enhance your application to leverage these new form factors using this new UI toolkit: TwoPaneLayout preview Today we are introducing a new library, TwoPaneLayout, which can help you simplify this implementation. You can easily integrate the librar...
Hover-ink over dual-screens
Hello Android developers, This week we’re releasing the alpha4 version of our pen SDK preview. The pen SDK is intended to help developers add drawing capabilities to their Android apps, accepting input using touch or pen (including pen features like the eraser tip). The latest open-source SDK code and sample app are available on GitHub in the surface-duo-sdk repo in inksdk. This post discusses the changes in this release. New pen-hover indicator Microsoft Surface Duo can detect when the pen tip is near to the screen. The InkView now detects when the pen is close and shows visual feedback t...
ExoPlayer video on dual-screen and foldable devices
Hello Android developers! The Microsoft Surface Duo is a great device for consuming multimedia content, and ExoPlayer is a simple, powerful widget for rendering video. Raymond and I are interns on the Surface Duo Developer Experience team, and we're excited to share two dual-screen enhanced samples that showcase video experiences on foldable devices. Our samples were inspired by this Google I/O video Foldables - WindowManager with MotionLayout and the ConstraintLayout FoldableExperiments sample. The goal for each sample is to demonstrate a video player user experience that works great on single...
Developing for Android on Windows
Hello Android developers! Today Microsoft announced the next version of Windows and a new Windows Store, and we’re excited to see how people take advantage of its new features. One thing that hasn’t changed is that Windows is still the best platform to design, build, test, and deploy Android apps. All tools welcome No matter what development environment you use, it runs on Windows. Android Studio, Visual Studio, VS Code, and Unity are all available, so whether you program in Kotlin, Java, C#, JavaScript, TypeScript, or Flutter, you get a great developer experience. You can even develop and...
Window Manager preview for Xamarin
Hello Xamarin developers! We’ve discussed Window Manager in previous blog posts – it’s an AndroidX library that brings dual-screen and foldable support to Android, across a variety of devices including Microsoft Surface Duo. Window Manager is now available to test with Xamarin.Android apps via a prerelease NuGet Xamarin.AndroidX.Window. UPDATE: on August 18th, 2021 Google released beta01 of the Jetpack Window Manager package, which is bound in the Xamarin.AndroidX.Window NuGets. As part of the latest release, Google added a package for better backwards compatibility. This package is better suite...
Surface Duo Design Kit update
Hello designers, Today we are excited to share you with an update to the Design Kit for the Microsoft Surface Duo that’s available on Figma for download. The latest update to our Design Kit version 0.4 includes: In this blog post we want to highlight details of the guidelines, principles, and inking gestures for pen interactions on the dual-screen form factor. We hope that these details help you create the best inking experience for your users. Inking Principles When it comes to Android devices like the Surface Duo – offering mobile productivity, inkin...
A new angle on Flutter
Hello Flutter developers! Today we are taking a closer look at the hinge on Microsoft Surface Duo and other foldable devices. The hinge holds the two parts of the device together, but it also has a sensor inside which tells us about the angle between the two screens. Figure 1: Surface Duo Hinge in action Hinge angle vs device posture The hinge angle is already used to calculate the device posture, which is exposed using MediaQuery. The MediaQuery update is included in the Flutter foldable support we blogged about previously, and which is currently in review. For example, the “half-open...
Ask the Experts at Microsoft Build
Hello developers! Thank you to everyone who joined us at Microsoft Build this week. There was a lot of amazing announcements across the company, but for the Surface Duo Developer Experience team the highlight was sharing the latest info on building and enhancing your apps for dual-screens, and “meeting” everyone who attended the live Ask The Experts session. We really appreciate the passion of the developer community and look forward to talking with you more at future events. Until then, here’s a summary of the top questions and answers from the session (which is also available to watch online...
Surface Duo at Microsoft Build
Hello developers! Microsoft Build starts today with a keynote by Satya Nadella. The session catalog includes several Microsoft Surface sessions for developers looking to enhance their mobile applications for Surface Duo. Join the Surface Duo Developer Experience team in a mix of live and on-demand sessions that will help you build amazing experiences for dual-screen and foldable Android devices. We’ve highlighted a few of the sessions you may be interested in below. Application design and development for Android dual-screen and foldable devices In this session, Andy Himberger and I give an overview o...
Foldables at Google I/O
Hello Android developers! You've probably seen some of the awesome announcements made this week at Google I/O, a virtual event that brought the Google developer community together. This post covers some of our favorites, from sessions like What’s new in foldables, tablets, and large screens, and Prepare your app for large screens. Enhancing apps for dual-screens and Microsoft Surface Duo falls naturally into a broader strategy to support larger screens, and we’re excited to see foldable device enhancements going mainstream. Window Manager Jetpack Window Manager is a common API for all foldables ...
Foldable SlidingPaneLayout
Hello Android developers! Last week Google announced an update to the SlidingPaneLayout component preview, which is being enhanced for dual-screen and foldable devices. UPDATE: on September 1st, 2021 Google released beta01. The API has not changed from the instructions in this post, the updated implementation line is: As an intro note, the previous version of this component (1.2.0-alpha01) was the first version to include foldable support. In this new version (1.2.0-alpha02), as we can see in its release notes, SlidingPaneLayout has been updated to support devices that have a non-zero ...
Creating beautiful dual-screen Xamarin.Forms apps
Hello .NET developers! The blog has previously featured tips for bringing Xamarin apps to Surface Duo and Microsoft Learn training to help enhance Xamarin apps. In this post we’ll discuss changes to animated layouts in a Xamarin.Forms app to adapt them for Microsoft Surface Duo. Adapt a design for Xamarin The sample project is an implementation of this Dribbble contribution by Henry Price. The Xamarin.Forms code developed by Kym Philpotts on his Twitch stream is available on GitHub, and the result is demonstrated in the following two animations: Figure 1: Single-screen portrait layout and ...
Join us live on Twitch (and YouTube)
Hello dual-screen and foldable device developers, Those of you following us on Twitter will have noticed in recent weeks that we’ve been inviting you to join a livestream each Friday (11am Pacific; 2pm Eastern; 8pm in Europe). We just recently celebrated 12 episodes over the past three months! If you haven’t joined us yet, in this post I’ll share some more details about Twitch and how it can help you enhance your apps for Microsoft Surface Duo. Figure 1: SurfaceDuoDev livestreaming on Twitch What is Twitch? Twitch is a live streaming platform that was originally created for gamers...
Ensuring code quality with CI/CD
Hello Android developers, One of the best ways for us to help you enhance your apps is with samples, and it’s important that our samples are high quality and work as intended. Building dual-screen libraries and samples As you may already know, specifically for Android development (through its SDK and using Kotlin/Java), we currently provide: In the above repos, there is a lot of code that was provided from different contributors, each who have their own style. It’s important to validate the code to ensure that the code does what it says it does, and be careful to v...
Build and deploy dual-screen progressive web apps
Hello web developers, We've posted previously about using dual-screen media queries and JavaScript to adapt web apps for Microsoft Surface Duo. Today’s post is about how you can use those dual-screen capabilities in your progressive web app (PWA) and deploy to both the Google Play Store AND the Microsoft Store using PWABuilder! We’ll share a little about the benefits of PWAs and then walk through how to create one from this photo-editing example that’s available on the web. Figure 1: Screenshot of the SimpleEdit website being used on Surface Duo What is a progressive web app? A progressi...
Microsoft Surface Duo Design Kit documentation
Hello designers! This week we are happy to share a number of updates to the Microsoft Surface Duo Design Kit that was announced in January. Design Kit updates There have been several additions and updates since the last version on the Figma Design Kit: One major update is the addition of interactive components that allow designers to create prototype interactions between variants in a component set. Interactive components are an extension of variants i.e, anywhere in the Design Kit when you come across a component set with dashed blue lines, during prototyping mode those c...
Adapting your Angular web app for dual-screen devices
Hello web developers! Foldable and dual-screen devices are becoming increasingly more common over time, but you may wonder if investing development time to support these devices might be worth it, especially when creating fully responsive web apps is already a challenge. Using the new CSS and JavaScript primitives is a fun way to discover and learn about the new possibilities offered by devices like the Microsoft Surface Duo, yet you might be looking for a more efficient way to adapt existing apps without having to make drastic changes and dive too much into custom CSS. That's what we're going to explo...
Jetpack Compose foldable and dual-screen development
Hi Android developers, We talked about using Jetpack Compose, the new Android UI toolkit for Microsoft Surface Duo development in a previous blog post. Now, Jetpack Compose is in beta. Combined with the use of Jetpack Window Manager, Jetpack Compose is more flexible for developing apps for dual-screen devices and even easier to extend to other foldable devices. You can check out the new dual-screen Codelab for using Jetpack Window Manager to learn more. Today, we would like to showcase some examples of dual-screen development using Jetpack Compose in different use cases. When building or migrat...
New Android pen and ink control preview
Hello Android developers, In a previous post, we shared code to handle pen events including pressure, orientation, and button presses on the pen. Today’s post introduces a preview of a new pen and inking control that you can easily add to your Android apps to get pen (and touch) support without a lot of custom code. Figure 1: pen and ink sample app The screenshot above shows the InkView control on a Microsoft Surface Duo. It will work on any Android with API version 29 or newer. The control uses the BlendMode API, which was introduced in API 29. Android does not offer a built-...
Introducing Jetpack Window Manager for foldable and dual-screen devices Codelab
Hello Android developers, As we have mentioned in previous blog posts, enhancing apps to take advantage of the capabilities that new form factor devices such as Microsoft Surface Duo and other foldable devices provide, can easily be done by following a step-by-step approach. With that in mind, during the last months we have been working together with Google on developing a new Codelab to help you understand what foldable and dual-screen devices are, how to use Jetpack Window Manager to enhance your apps for use on foldables and dual-screen devices by making just a few small changes. Accessi...
Announcing Flutter support for foldable devices
Flutter is one of the fastest growing frameworks today and certainly a powerful toolkit for building amazing apps, which is why we’re adding foldable support. Earlier today Microsoft announced a preview of foldable support for Flutter, at Google’s Flutter Engage. We love Flutter and foldable devices and want developers to have the best possible experience when working with both. We’re contributing to Flutter to give it foldable capabilities and this article goes into details of what is new. Please note that Foldable support has not yet merged into the Flutter repo. We first want to listen to yo...
Xamarin.Forms 5.0 on Microsoft Surface Duo
Hello Xamarin developers, Today Craig and I joined The Launch Space, a live stream from Microsoft Learn, to talk about developing dual-screen apps for Surface Duo using Xamarin. This topic has been covered in the blog before, but there are some new features to talk about with the release of Xamarin.Forms 5.0. You can watch the stream here, and see the highlights listed below. More information about the The Launch Space show is available on GitHub. Dual-screen app design We talked about a few different aspects of enhancing your app design for dual-screens. The five user experience p...
Microsoft Surface Duo emulator February refresh
Hello Android developers, Today we are releasing the latest update to the Surface Duo emulator. Since last December, we started to introduce some app samples into the emulator so you can play with them directly and get a better idea about how to build an application or enhance your application on the Surface Duo device. Here are the samples you can find in the application list once you install the latest version of the Surface Duo emulator, as below. Surface Duo Samples It is a collection of code samples built in Kotlin, showcasing the development on Surface Duo in different scena...
Making Microsoft Outlook shine on Microsoft Surface Duo
Hello Android developers, In this post, you’ll learn how the Outlook team adapted our Android app to create a user-friendly experience on the dual-screen Surface Duo. Outlook for Surface Duo has the same familiar experience that you find on both phone and tablet and this is no coincidence as Outlook has been designed with flexibility in mind. But while Outlook was easily able to handle the configuration change when switching from displaying on a single screen or spanning across two screens thanks to support from the Android framework from API 1, Surface Duo presented a unique challenge in how to addre...
Developer tip: launch on adjacent screen
Hello Android developers, Last year we blogged about bringing your existing apps to the Microsoft Surface Duo, which included a variety of suggestions from simple tweaks to a set of user-experience design patterns that you could use to enhance your applications’ UI. Today I’m going to re-visit one of those dual-screen enhancement tips that’s easy to incorporate into your existing apps; launching new intents on the second screen. This behavior builds on an intent launch flag that works on any device that supports Android multi-windowing. It’s mentioned in the Android multi-window developer docume...