Site icon Embarcadero RAD Studio, Delphi, & C++Builder Blogs

Android on Windows 11: A Developer’s Perspective

windows subsystem for android 3

The Windows Subsystem for Android (WSA) integrates native Android apps into the Windows 11 desktop. This post will teach you how to set up and configure the Windows Subsystem for Android for use in software development. It will be much easier for developers to replicate this with the use of Windows tools for developers.

Read on to see what is required to run WSA as well as what is required to target it from your Android development. Windows Subsystem for Android is available for public preview on Windows 11. I was joined by a special surprise guest: Scott Hanselman

Watch the full replay on YouTube

https://youtu.be/ub6WVP26_Cg
<object class=”wp-block-file__embed” data=”https://blogs.embarcadero.com/wp-content/uploads/2022/03/Android-on-Windows-11-A-Developers-Perspective-Windows-Subsystem-For-Android-with-Jim-and-Scott-9396411.pdf” type=”application/pdf” style=”width:100%;height:600px” aria-label=”Embed of <strong>Slides: Slides: Android on Windows 11 – A Developer’s Perspective (Windows Subsystem For Android)Download

Android on Windows?

Hardware Requirements

System Requirements Documentation
WSA support.microsoft.com/windows/f8d0abb5-44ad-47d8-b9fb-ad6b1459ff6c
Windows 11 support.microsoft.com/windows/86c11283-ea52-4782-9efd-7674389a7ba3

WSA Installation

WSA VM Lifecycle

  • There are three possible states for the VM running apps with Windows Subsystem for Android:
    • Running
    • Lightweight Doze: After no app activity for 3 minutes. Deactivated by user activity or an app notification.
    • Not Running: After activity for 7 minutes.
  • Transitions between these states are triggered by user activity, Android app or an app notification.
  • Android apps are paused and then stopped when their window is minimized.
  • Docs docs.microsoft.com/en-us/windows/android/wsa/

Performance

Passmark Performance Test

Hardware Report

Notes: From Geekbench 5
Resolution is based on Android app window size
320 PPI when running at 200% scale
160 PPI when running at 100% scale

Settings & Developer Mode

  • Launch Windows Subsystem for Android
  • Scroll down & enable Developer mode
  • Copy the IP address
  • Use ADB to connect -> adb connect 172.24.203.234
  • Optional:
    • Connect from other local computers via your IP address and port specified
    • Manage Android Settings via link
  • Note:
    • Subsystem can run “As needed” or “Continuous”
    • Files let you browse but not transfer files

Digging into Details

Who is Houdini?

Sideloading

Targeting from Delphi & RAD Studio IDE

  • A single FMX project can target Windows or Android already.
  • WSA is in Preview and not yet fully support by Delphi, but that won’t stop us….
  • Connect with ADB and then it shows up in the IDE.
  • FireMonkey apps either don’t run or report error “Your Android device does not support selected platform architecture.”
  • Sideloading!
    • Compile for Android 64
    • adb install -r –no-streaming FireMonkeyApp.apk
    • Also make resizable

Making Your Android App Resizable

  • Edit AndroidManifest.Template.xml

<application android:resizeableActivity=“true”>

  • Note that if you have multiple Android apps in the same folder they share the same AndroidManifest.Template.xml
  • Allows FMX Android app to resize as expected.

Automating the Manual

Mobile Snippets Tests

  • Location must be enabled in Windows to work in WSA
  • Notification appear on desktop and can wake WSA

Get the steps on how to turn on Developer Mode on Chromebook to reduce development time and improve your levels of efficiency.

More information

Next Steps

Exit mobile version