Slide 1

Slide 1 text

What’s new in Android 14? Merab Tato Kutalia Android GDE @ Choco @TatoKutalia

Slide 2

Slide 2 text

No content

Slide 3

Slide 3 text

Firebase

Slide 4

Slide 4 text

API Changes

Slide 5

Slide 5 text

Non-linear font-scaling ● Non-linear font-scaling up to 200% ● Use TypedValue.applyDimension() to convert from sp units to pixels, and use TypedValue.deriveDimension() to convert pixels to sp. These methods apply the appropriate non-linear scaling curve automatically.

Slide 6

Slide 6 text

Per-language app preferences ● Automatically generate an app's localeConfig ● Starting with Android Studio Giraffe Canary 7 and AGP 8.1.0-alpha07, you can configure your app to support per-app language preferences automatically. ● Dynamic updates for an app's localeConfig ● App language visibility for input method editors (IMEs)

Slide 7

Slide 7 text

Updates to OpenJDK 17 ● Java 17 support ● Sealed classes ● Text blocks ● Pattern matching for instanceof

Slide 8

Slide 8 text

Grammatical Inflection API ● Grammatical gender in strings - setRequestedApplicationGrammaticalGender

Slide 9

Slide 9 text

Regional preferences enable users to personalize temperature units, the first day of the week, and numbering systems Regional Preferences

Slide 10

Slide 10 text

Regional preferences enable users to personalize temperature units, the first day of the week, and numbering systems Sharesheet custom actions

Slide 11

Slide 11 text

If you've already migrated your app to the new system back APIs, you can opt in to predictive back to automatically receive in-app animations and also support custom transitions. Support for built-in and custom animations

Slide 12

Slide 12 text

Screenshot Detection ● The API doesn't detect screenshots that are taken when running test commands related to screenshots, including ADB, or within instrumentation tests that capture the device's current screen contents.

Slide 13

Slide 13 text

Apps can kill only their own background processes ● killBackgroundProcesses(), the API can kill only the background processes of your own app.

Slide 14

Slide 14 text

Foreground service types - user-initiated data transfer jobs ● If your app targets Android 14, it must specify at least one foreground service type for each foreground service within your app. ● camera ● connectedDevice ● dataSync ● health ● location ● mediaPlayback ● mediaProjection ● microphone ● phoneCall

Slide 15

Slide 15 text

User-initiated data transfer jobs ● User initiated jobs must be scheduled while the application is visible to the user ● RUN_USER_INITIATED_JOBS - permission ● Can be cancelled by user or system

Slide 16

Slide 16 text

Schedule exact alarms are denied by default SCHEDULE_EXACT_ALARM, the permission introduced in Android 12 for apps to schedule exact alarms, is no longer being pre-granted to most newly installed apps targeting Android 13 and higher (will be set to denied by default). If the user transfers app data to a device running Android 14 through a backup-and-restore operation, the permission will still be denied. If an existing apps already had this permission, it'll be pre-granted when the device upgrades to Android 14. Apps will not be able to publish a version of their app with this permission in the manifest unless they qualify based on the policy language.

Slide 17

Slide 17 text

Grant partial access to photos and videos If your app already uses the photo picker, you don't need to take any action to support this change. Otherwise, consider using the photo picker instead of adopting this change. Temporary URI

Slide 18

Slide 18 text

Data safety information is more visible

Slide 19

Slide 19 text

Context-registered broadcasts are queued while apps are cached When the app leaves the cached state, such as returning to the foreground, the system delivers any queued broadcasts. Multiple instances of certain broadcasts may be merged into one broadcast. Depending on other factors, such as system health, apps may be removed from the cached state, and any previously queued broadcasts are delivered.

Slide 20

Slide 20 text

Minimum installable target API level ● Starting with Android 14, apps with a targetSdkVersion lower than 23 can't be installed. ● Malware often targets older API levels in order to bypass security and privacy protections that have been introduced in newer Android versions. For example, some malware apps use a targetSdkVersion of 22 to avoid being subjected to the runtime permission model introduced in 2015 by Android 6.0 Marshmallow (API level 23).

Slide 21

Slide 21 text

Restrictions to implicit and pending intents For apps targeting Android 14, Android restricts apps from sending implicit intents to internal app components in the following ways: ● Implicit intents are only delivered to exported components. Apps must either use an explicit intent to deliver to unexported components, or mark the component as exported. ● If an app creates a mutable pending intent with an intent that doesn't specify a component or package, the system now throws an exception.

Slide 22

Slide 22 text

Runtime-registered broadcasts receivers must specify export behavior context-registered receivers are required to specify a flag to indicate whether or not the receiver should be exported to all other apps on the device: either RECEIVER_EXPORTED or RECEIVER_NOT_EXPORTED, respectively. If your app is registering a receiver only for system broadcasts through Context#registerReceiver methods, such as Context#registerReceiver(), then it shouldn't specify a flag when registering the receiver.

Slide 23

Slide 23 text

Safer dynamic code loading If your app targets Android 14 and uses Dynamic Code Loading (DCL), all dynamically-loaded files must be marked as read-only. Otherwise, the system throws an exception.

Slide 24

Slide 24 text

Zip path traversal For apps targeting Android 14, Android prevents the Zip Path Traversal Vulnerability in the following way: throws a ZipException if zip file entry names contain ".." or start with "/". Apps can opt-out from this validation by calling dalvik.system.ZipPathValidator.clearCallback().

Slide 25

Slide 25 text

Health Connect Single data repository to read/write health-related data. All other health apps connect to Health Connect. Available as a part of project Mainline.

Slide 26

Slide 26 text

And many more… Questions?