As an Android developer, porting your app to the Amazon Appstore for Windows 11 can help expand your customer base. However, it's important to keep in mind that Windows 11 allows users to freely resize app windows, and it's crucial to ensure that your app is responsive and stable when the viewport window is resized.
In this guide, we will cover key considerations for handling window resizing in your Android app on Windows Subsystem for Android™ (WSA).
To ensure a seamless experience for users, Windows 11 enforces a minimum screen requirement of 720p resolution (1280x720) for screens larger than 9”. When the aspect ratio of a window size does not align with the device screen size, the result may be letterboxing or pillarboxing, which results in bars being placed on the sides of the window in order to center it.
There are several launch size options to consider when launching your app on Windows 11:
Use static launch bounds. Use <layout> inside the manifest entry of your activity to specify a "fixed" starting size. For example:
Use dynamic launch bounds. An activity can create and use ActivityOptions.setLaunchBounds(Rect) when creating a new activity. By specifying an empty rectangle, your app can be maximized.
Note: Make sure to specify these options only for the root activity and consider using a springboard activity to clear the activity stack in the task with a new start.
Supporting different screen sizes with responsive layouts ensures that you have control of the presentation layout no matter which form factor the screen is presented.
For a more information on dynamic Window sizes and establishing clear breakpoints for your app’s user interface in Kotlin and Java, read Android’s guide on supporting different screen sizes. Also, consider how multi-window mode can enable your app to function next to other apps, and consider the differences between activity context and application context.
You can provide a better user experience by ensuring that the app’s layout adapts to the new window size. This can be achieved by using the onSizeChanged() method in your activity class. This method is called when the size of the app window changes, and you can use it to adjust the layout of the app accordingly.
In Windows 11, users can resize an app's window by dragging the lower right corner. There are two options for handling window resizing when using the View class:
Windows 11 allows users to change the screen orientation of their device, so it's important to make sure that your app can handle changes in screen orientation without crashing. You can do this by adding android:configChanges="orientation|screenSize" to your activity in the AndroidManifest.xml file. This will allow your app to handle changes in screen orientation without restarting the activity.
If your app is using Jetpack Compose, the resizing behavior depends on the size of the app window and the layout that is used. You can use the Compose's layout composables such as Box, Row, and Column to layout the components of your app. See the Compose layout basics docs for more.
Once you have prepped and tested your app, remember to reach out via our Contact Us page to request your app for WSA submission access. Once the request is approved, log in to the Amazon Appstore Developer Console and then select the app from the My Apps list. On the app detail page, open the Supported Devices menu, navigate to the Windows Devices tab, select Windows devices for targeting, and complete your submission.