In this slide, you will find out some key points
1) Android 13 Behaviour, Feature & APIs
2) Features and Improvements from Compose 1.2
3) Apps Adapility for all screen sizes.
of targetSDK. For apps with targetSDK < 33, Android will typically ask for the Notification Permission on first launch. Notification Permission Privacy
requesting permission • No additional limits on prompting • Check notification access through PermissionChecker, or NotificationManager.areNotificationsEnabled UX - Following Best Practices
external apps to apps targeting Android 13 or higher when they match an <intent-filter> element. There are a few exceptions: • Components without Intent filters • Intents from the system • Intents from root
a runtime receiver if not SecurityException will be thrown // I want to receive broadcasts from other apps! context.registerReceiver(broadcastReceiver, intentFilter, RECEIVER_EXPORTED); // I don’t want to receive broadcasts from other apps! context.registerReceiver(broadcastReceiver, intentFilter, RECEIVER_NOT_EXPORTED);
in the restricted • What work your app can do when the user places your app in the restricted state. • Check if you’re in one of the restricted states: ◦ ActivityManager.isBackgroundRestricted () ◦ UsageStatsManager.getAppStandbyBuck et()
android:enableOnBackInvokedCallback="true"> Optional opt-in flag in the manifest: Android 13 The new back dispatching will be enabled by default for application targeting SDK 34 Android 14 Once the new behavior is enabled, KEYCODE_BACK and onBackPressed() won't be used anymore. Application will have to rely entirely on the OnBackInvokedCallback Jetpack supports the new Back API androidx.activity:activity:1.6.0 Opt in the new behavior
this on the main thread as it may require Activity.restart() AppCompatDelegate.setApplicationLocales(appLocale) //get in-app local language Val appLocale = AppCompatDelegate.getApplicationLocales() Update in-app local language
No runtime permissions • Better UX to access photos & videos • Continuously improved through Google Play System Updates • Backported to Android 11 & 12 • Will soon include cloud photos and albums Photo Picker
mode. // This means that the user can select one photo or video. val intent = Intent(MediaStore.ACTION_PICK_IMAGES) startActivityForResult(intent, PHOTO_PICKER_REQUEST_CODE)
mode. // This means that the user can select multiple photos/videos, up to the limit. // specified by the app in the extra (10 in this example). val maxNum = 10 val intent = Intent(MediaStore.ACTION_PICK_IMAGES) intent.putExtra(MediaStore.EXTRA_PICK_IMAGES_MAX,maxNum) startActivityForResult(intent, PHOTO_PICKER_MULTI_SELECT_RC)
the photo picker. override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent) { when(resultCode) { PHOTO_PICKER_REQUEST_CODE -> { // Get photo picker response for single select. val currentUri: Uri = data.data return } PHOTO_PICKER_MULTI_SELECT_RC -> { // Get photo picker response for multi select. var results = data.clipData return }
= 2.5.em, platformStyle = PlatformTextStyle( includeFontPadding = false ), lineHeightStyle = LineHeightStyle( alignment = Alignment.Center, trim = Trim.None ) ) ) Set includeFontPadding true to left vs right fase and LineHeightSytle
Drag and Drop Resizable Window Don’t assume your app will be only used in a certain orientation Don’t assume your app will be only used through a touch screen Multi-window by default Compatibility mode Input support
different device types, starting with foldables and tablet Window Metrics: access currentWindowMetric, maxWindowMetric in advance Window size classes: provide opinionated layout breakpoints for you to know how to adapt your UI based on screen size, partition as compact, medium, expended Activity embedding: allows displaying two Activities simultaneously, with each taking up a portion of the window. SlidingPaneLayout: Places content side by side if the window size allows Resizable and desktop emulators Large Screens made easy