Slide 1

Slide 1 text

No content

Slide 2

Slide 2 text

No content

Slide 3

Slide 3 text

developer.amazon.com

Slide 4

Slide 4 text

No content

Slide 5

Slide 5 text

Amazon Appstore SDK

Slide 6

Slide 6 text

Appstore SDK

Slide 7

Slide 7 text

class AmazonAppstoreIAPDataSource private constructor( application: Application, private val defaultScope: CoroutineScope, knownInappSKUs: Array?, knownSubscriptionSKUs: Array?, autoConsumeSKUs: Array? ) : PurchasingListener {

Slide 8

Slide 8 text

class AmazonAppstoreIAPDataSource private constructor( application: Application, private val defaultScope: CoroutineScope, knownInappSKUs: Array?, knownSubscriptionSKUs: Array?, autoConsumeSKUs: Array? ) : PurchasingListener {

Slide 9

Slide 9 text

public interface PurchasingListener { void onUserDataResponse(UserDataResponse userDataResponse); void onProductDataResponse(ProductDataResponse productDataResponse); void onPurchaseResponse(PurchaseResponse purchaseResponse); void onPurchaseUpdatesResponse(PurchaseUpdatesResponse purchaseUpdatesResponse);

Slide 10

Slide 10 text

Testing with the App Tester

Slide 11

Slide 11 text

No content

Slide 12

Slide 12 text

No content

Slide 13

Slide 13 text

A3L & ADM

Slide 14

Slide 14 text

class MyA3LMessagingService : A3LMessagingService() { override fun onMessageReceived(context: Context, aMessage: RemoteMessage) { // Handle message } override fun onNewToken(context: Context, token: String) { Log.d(TAG, "In onNewDeviceId") Log.d(TAG, "Device token: $token") } }

Slide 15

Slide 15 text

class MyA3LMessagingService : A3LMessagingService() { override fun onMessageReceived(context: Context, aMessage: RemoteMessage) { // Handle message } override fun onNewToken(context: Context, token: String) { Log.d(TAG, "In onNewDeviceId") Log.d(TAG, "Device token: $token") } }

Slide 16

Slide 16 text

class MyA3LMessagingService : A3LMessagingService() { override fun onMessageReceived(context: Context, aMessage: RemoteMessage) { // Handle message } override fun onNewToken(context: Context, token: String) { Log.d(TAG, "In onNewDeviceId") Log.d(TAG, "Device token: $token") } }

Slide 17

Slide 17 text

Slide 18

Slide 18 text

class MainActivity : AppCompatActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) val onInitCallback: OnInitCallback = object : OnInitCallback() { override fun onReady(initCallbackResponse: InitCallbackResponse) { if (initCallbackResponse.isSuccessful) { } else { } } } A3LMessaging.init(applicationContext, onInitCallback)

Slide 19

Slide 19 text

class MainActivity : AppCompatActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) val onInitCallback: OnInitCallback = object : OnInitCallback() { override fun onReady(initCallbackResponse: InitCallbackResponse) { if (initCallbackResponse.isSuccessFul) { } else { } } } A3LMessaging.init(applicationContext, onInitCallback)

Slide 20

Slide 20 text

class MainActivity : AppCompatActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) val onInitCallback: OnInitCallback = object : OnInitCallback() { override fun onReady(initCallbackResponse: InitCallbackResponse) { if (initCallbackResponse.isSuccessFul) { } else { } } } A3LMessaging.init(applicationContext, onInitCallback)

Slide 21

Slide 21 text

No content

Slide 22

Slide 22 text

Fire TV

Slide 23

Slide 23 text

No content

Slide 24

Slide 24 text

No content

Slide 25

Slide 25 text

No content

Slide 26

Slide 26 text

Windows11

Slide 27

Slide 27 text

Prerequisites Currently available to customers with Windows 11 and Amazon accounts registered in US, Japan, UK, France, Italy, Spain, Germany, Canada and Australia PC Specific Windows 11 requirements (e.g. 8GB RAM, SSD Storage) microsoft.com/en-gb/windows/windows-11-specifications

Slide 28

Slide 28 text

Setting up your Development Environment

Slide 29

Slide 29 text

1. Install the Amazon Appstore

Slide 30

Slide 30 text

2. Configure Windows Subsystem for Android Settings app

Slide 31

Slide 31 text

Connect to Windows Subsystem for Android

Slide 32

Slide 32 text

Optimizations for different form factors

Slide 33

Slide 33 text

Identifying Amazon Appstore Utilize PackageManager Identifies the Amazon Appstore

Slide 34

Slide 34 text

Windowing Considerations Support snapping and multi-monitor support Minimum screen requirement of 720px

Slide 35

Slide 35 text

dependencies { implementation "androidx.compose.material3:material3-window-size-class:1.0.0-alpha13” }

Slide 36

Slide 36 text

val windowSize = calculateWindowSizeClass(this).widthSizeClass when (windowSize) { WindowWidthSizeClass.Compact -> { // Your Awesome App in a Compact Window } WindowWidthSizeClass.Medium -> { // Reasonable space to have all your app and others together on screen } WindowWidthSizeClass.Expanded -> { // Woaah! Your app UI will be super cool using all the screen! } else -> { } }

Slide 37

Slide 37 text

class MainActivity : ComponentActivity() { @OptIn(ExperimentalMaterial3WindowSizeClassApi::class) override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) ... setContent { val widthSizeClass = calculateWindowSizeClass(this).widthSizeClass AADevsApp(widthSizeClass) } } }

Slide 38

Slide 38 text

val isExpandedScreen = widthSizeClass == WindowWidthSizeClass.Expanded

Slide 39

Slide 39 text

No content

Slide 40

Slide 40 text

Windowing Resizing Handle window resize changes dynamically: DON’T Persistent storage to save and restore the UI state of your activity across configuration changes.

Slide 41

Slide 41 text

Input Devices WSA reports mouse down/move/up events as touch events by default Account for keyboard & mouse specific events Include optimizations for actions such as right click & hover effects

Slide 42

Slide 42 text

Input Devices Handle arrow keys, enter key, control-based shortcuts & tab-navigation

Slide 43

Slide 43 text

fun Modifier.interceptKey(key: Key, onKeyEvent: () -> Unit): Modifier { return this.onPreviewKeyEvent { if (it.key == key && it.type == KeyUp) { onKeyEvent() true } else it.key == key } }

Slide 44

Slide 44 text

modifier = Modifier .interceptKey(Key.Enter) { ohMyYouPressEnter() } .interceptKey(Key.Escape) { areYouSureYouWantToEscape() }

Slide 45

Slide 45 text

private fun Modifier.notifyInput(block: () -> Unit, blockRight: () -> Unit): Modifier = composed { val blockState = rememberUpdatedState(block) val blockRightState = rememberUpdatedState(blockRight) pointerInput(Unit) { while (currentCoroutineContext().isActive) { awaitPointerEventScope { val event = awaitPointerEvent(PointerEventPass.Initial) if (event.buttons.isSecondaryPressed) { blockRightState.value() } else { blockState.value() } } } } }

Slide 46

Slide 46 text

Composable private fun ArticleHeaderImage( article: Article ) { val interactionSource = remember { MutableInteractionSource() } val isHovered by interactionSource.collectIsHoveredAsState() val borderColor = if (isHovered) Color.Red else Color.Blue val imageModifier = Modifier .hoverable(interactionSource = interactionSource) .border(BorderStroke(2.dp, borderColor)) Image( ... modifier = imageModifier, ... ) }

Slide 47

Slide 47 text

No content

Slide 48

Slide 48 text

Notifications

Slide 49

Slide 49 text

APIs and Services Billing Amazon in-app purchasing API (Appstore SDK) Cloud Messaging A3L Firebase SDK Firebase Javascript SDKs In-App messaging Amazon Device Messaging (ADM)

Slide 50

Slide 50 text

Discover More! developer.amazon.com AmazonAppDev @AmazonAppDev Amazon Appstore Developers @anisha_malde @giolaq