- Dev Blogs
- Surface Duo Blog
Surface Duo Blog
Build great Android experiences, from AI to foldable and large-screens.
Latest posts
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...