Upgrade to Pro — share decks privately, control downloads, hide ads and more …

What's new in Android 14?

What's new in Android 14?

Android 14 is the latest version of Google's mobile operating system, and it comes with a number of new features and improvements. In this session, we will take a look at some of the most significant changes and how to implement them like performance, UI, new features and many more

Merab Tato Kutalia

May 31, 2023
Tweet

More Decks by Merab Tato Kutalia

Other Decks in Technology

Transcript

  1. 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.
  2. 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)
  3. Updates to OpenJDK 17 • Java 17 support • Sealed

    classes • Text blocks • Pattern matching for instanceof
  4. Regional preferences enable users to personalize temperature units, the first

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

    day of the week, and numbering systems Sharesheet custom actions
  6. 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
  7. 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.
  8. Apps can kill only their own background processes • killBackgroundProcesses(),

    the API can kill only the background processes of your own app.
  9. 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
  10. 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
  11. 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.
  12. 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
  13. 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.
  14. 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).
  15. 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.
  16. 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.
  17. 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.
  18. 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().
  19. 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.