If you are building Android applications in, you already know that
deploying to Android emulators and to devices is a paint in the neck.
All the different configurations and just the memory intensiveness of
running that on your machine, while the windows substance of for Android
has been around for a while and there's tons of new enhancements to it, and if
you're brand new to it, it enables you to debug directly onto your Windows 11.
Machine, which is awesome.
It's all built in and run your Android applications.
And if you want to build and ship those applications to the Amazon App
store, that can run on any Amazon device or any Windows 11 device.
So today I'm gonna show you everything you need to know to get set up in 2023.
So let's get into it.
Hey everyone, I'm James.
And to date, we're gonna be talking about the Windows subsystem for Android, W S A.
I did a video on it a while ago and there's been tons of improvements
and someone left a very interesting comment recently, which is all about
how I need to update that video.
So here it is, 2023 updates for W S A.
There's been tons of new things like.
Package verification and memory usage updates, picture and picture mode
support, um, partially running mode, which is one of my new favorite modes
and just a ton of other optimizations.
So let's go ahead and check it out.
All right, if you are getting started for the very first time, one, you
have to have a Windows 11 machine.
And of course you need to have a machine that is in a specific
region that's WSA supports.
Um, so I'll link to documentation so you can go ahead and check that out.
The first thing you're gonna need to do is, Search for the Amazon App store.
And this is gonna, for all intents and purposes, enable the Windows
subsystem for Android to be installed so you can deploy to it.
So you're gonna want the Amazon app store, you don't need to log
in, you don't need to do anything.
But basically it's gonna install and it's gonna pop up this dialogue
box that says, let's get your PC ready for the Amazon App store.
And this is that little w s A icon.
So this is gonna install and get everything that you
need set up on your machine.
So let's give it a few seconds.
All right.
Now that it's all done, all we need to do is open the Amazon App Store
and basically this will start this little, uh, window here, which is
the window subsystem for Android.
Now, by default, uh, basically the window subsystem for Android will.
Only run on demand.
So when you need it, uh, for all intents and purposes, uh, then
it'll turn itself off and there's a bunch of different modes.
Uh, but whenever you launch an Android application, uh, such as
the Amazon App store or your own application, it's gonna need to boot
the Windows subsystem for Android.
So this can take a few seconds that it boots the first time, but then
the Amazon app store will load.
And this is.
An actual Android application, uh, that it's running.
You can tell cuz there's a little arrow down here and that's what
it's running behind the scenes.
Um, but I just don't even need that.
We can go ahead and turn that off and close it down, but what I'm gonna do
now is say the Android, the window subsystem for Android, you can type
that into just your file Explorer.
And what you'll get is the new Windows system, the Windows
subsystem for Android screen here.
All right, so this will give you everything you need.
So, uh, if you boot up, uh, files, for example, this will
be an Android Files Explorer.
You can see all the different Android, uh, Images and icons that you would expect.
Uh, down under about you can see information in terms
of agreements, what it is.
You can see apps that are installed on your machine, uh,
specifically that are Android apps.
So if you go in and open the app settings, we'll see that this is
like sort of an Android app screen because it is an Android application
for all intents and purposes.
So that's how you can get it.
You can force stop it and you can do everything that you want.
Now when you go and have this on, we can see that this is
gonna, you know, block it.
You can turn it off automatically.
But really as a developer, you want to go into advanced settings.
And the first thing that we want to do is turn on developer mode.
Awesome.
You're gonna see that this little popup is gonna come up for firewall,
so we're just gonna allow access.
And then of course we'll pop up a UAC prompt for you.
Perhaps, uh, if not, you should be good to go.
And then we can see here that we can connect via the port that we have here.
So let's go and open up our, uh, ADB prompt.
I'm gonna say ADB connect, 1 2 7 oh dot oh, do one.
And then port 5 8 5 26.
All right.
And then what we're gonna get is a popup.
So we want to allow that.
We're gonna debug, uh, on our Windows machine here ourselves.
So just very, very similar to, cuz it's, think of it as
a big Android device, right?
So we're gonna allow, and then I'm gonna go ahead and connect one more
time and it's already connected.
So if I say a d b devices, we can see that it is attached here, right?
So I, they say ADB kill server and then ADB start server.
And then a d b devices, we're gonna see that it's not attached anymore.
So I can go back up and connect again, and we can see that I'm connected
and I'm, I could pretty much do anything a d B related right here.
Now there are a few other things that you might want to
take into consideration here.
So for example, This is the as needed.
This is the default.
Um, so this will only open it up.
And abs, uh, are a lot slower.
I like the partially running.
Uh, this means it's gonna use minimal resources and abil boot up quicker,
which means I'm gonna debug a lot faster.
And then also continuous.
So if you're really, really reduced, doing a.
Ton of Android development you might want continuous to be on,
but partially running is a new mode and I really, really like it.
Um, so this is the one that I'm gonna use.
You can also change around your, uh, memory that you have.
You can even do custom.
I'm just gonna do six.
I got 64 gigs of RAM here.
Totally fine and good to go.
There's graphics mode, so you can see I'm powering this by my GTX nine 80.
Um, but you can pick a specific gpu, different power savings
mode, things like that.
There's also Windows focus mode, so you can have these different options
and there's even a preview program if you wanna try out new features.
So this may look a little bit different as you're going now.
There's even other experimental features.
There's so much stuff.
So advanced networking, user, um, shareholders, a whole
bunch of other stuff here.
So definitely check that out.
So, uh, I have connected here, uh, and I can say a d b devices, just like that.
All right, cool.
Now, let's say I want to go ahead and debug.
I could bring up Android Studio or I could bring up Visual Studio
in this case cuz I'm using.net to build my Android applications.
And when I come to my dropdown window, we can see that I have
Android emulators here, but I also have the Microsoft Corporation
subsystem for Android, tm, Android.
13.0 a p i 33.
It's a debug, so that's gonna be basically my machine that I'm debugging on, and I
can go ahead and hit debug, package up an A P K, and debug it into my local machine.
So let's give this a few seconds to compile up and then deploy.
All right, we're in debug mode.
So actually I hit this first break point, which is on resume.
I can hit continue here on.
This is gonna boot up my Android application and
sure enough, I'm debugging.
I have hit a break point there.
We can see that the on pause got hit when I resized it.
I'm gonna go ahead and continue here.
We get on resume, so we get those break points that are coming in
here and there's my beautiful, beautiful Android application.
Now if we go ahead and stop debugging.
And I come back over here, we can go back to apps and we can see now that
Android app one is here, the size here, I can go into the settings, for
example, um, this is gonna boo boot up the settings for my application.
I can uninstall it.
I could go in and turn on different, you know, things that I need.
So if I want to pause activity, if it's unused, for example, I
could go into those settings.
So I have this as just a normal setting screen here.
I could also go in and then, uh, open it and uninstall it and
do all that stuff, like I said.
So your apps will sort of line up here.
They also show up in the windows, uh, screen here, so it's kind of
off the screen here, but it's gonna be in your app list, basically,
so you can launch it later too.
So you don't have to be debugging it, but it'll just be here ready for you.
All right, so that's pretty much half of it.
Um, I would say this though, if you are running into any issues inside
of debugging your applications, one thing that's really nty that they added
is this manage developer settings.
So this is a little bit deeper into the Windows subsystem for
Android to use developer options.
Uh, one thing that we can see here is that we can adjust the color mode.
We can adjust U S B debugging, which is gonna be on wireless debugging,
and we can also select app to debug.
So this is actually important.
So for some reason, like the debugger is not attaching, you can actually
select that and that will go ahead and.
Automatically sort of maybe give a d b a closer connection automatically here.
So for some reason you're not hitting break points or something
like that, that might be, uh, worth looking at and selecting the debug
app as you're sort of to work on it.
So that will be sticky there, uh, in real time.
So be sure to hear you got all these different things, all these different
flags that you can go deeper into, just like a normal Android emulator or device.
Uh, the other thing I wanna point out really quick though, is that if for
some reason, let's say I come in and I, you know, um, you know, kill the server
again, and then I, uh, started up again.
We can see it disappears from Visual Studio.
There we go.
Start server.
I might not want to go in and say a d b Connect over and over and over
again, and that is specifically where you can come into Visual Studio if
you're using Visual Studio and you can come and search for the barista.
And you can do the window subsystem for Android barista.
And I can go ahead and download this and then restart Visual Studio.
So when you install an extension, uh, this will pop up this little VIX installer and
it'll go ahead and install the extension.
So let's give this a few seconds to install and then head back over to
Visual Studio because this extension will handle everything for you
automatically, which is really cool.
All right, so we have installed the barista, uh, extension, uh, inside
a visual studio, uh, over here.
So any addition.
And what we can see is that I still don't have my Android emulator here
popping up, which would be my W s a, so my full W s A now under tools.
We'll specifically see Windows Subsystem for Android.
That one little button there, what this will do is it'll automatically
start the Windows subsystem for Android, and additionally it will go
ahead and connect to it automatically.
So here it's gonna say, you know, would you like to enable it?
Um, so it'll say yes.
It'll go ahead and run that through and run a command line.
Automatically for us.
So it'll all do that, and then we can see that it actually connected automatically
and there it is, just like that.
So it's really easy to connect automatically without having to
go down into the command line.
All right, well, that is my 2023 overview of W S A, the
Windows subsystem for Android.
What do you think, have you been using W S A since I put up my
original video and blog and all that?
Goodness.
I love W S A give it a peak if you haven't yet for any type of Android development.
And of course, don't forget that you can easily take your Android apps,
put 'em on to the Amazon app store like I did, and start publishing
your apps directly on Windows 11.
Or of course, you can just build a Windows 11 app.
Two.
But if you just have an Android app, get it out there, which
is really, really awesome.
Lemme know what you think in the comments below and I'll
link to all the documentation in my previous video as well.
Hope you enjoyed this video.
If you did, give it a thumbs up.
I super appreciate that.
And don't forget to like and subscribe and do all that good stuff as well.
So until next time, James, thanks for watching.