기능 및 API 개요

Android 14에는 개발자를 위한 훌륭한 새로운 기능과 API가 도입되었습니다. 아래 섹션을 통해 앱을 위한 기능을 알아보고 관련 API를 살펴볼 수 있습니다.

새로운 API, 수정된 API, 삭제된 API에 관한 자세한 목록은 API 차이점 보고서를 참고하세요. 새로운 API에 관한 자세한 내용은 Android API 참조를 방문하세요. 새로운 API가 강조 표시되어 쉽게 확인 가능합니다. 또한 플랫폼 변경이 앱에 영향을 줄 수 있는 분야에 관해 알아보려면 Android 14를 타겟팅하는 앱모든 앱의 Android 14 동작 변경사항을 확인해야 합니다.

다국어 지원

앱별 언어 설정

Android 14 expands on the per-app language features that were introduced in Android 13 (API level 33) with these additional capabilities:

  • 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. Based on your project resources, the Android Gradle plugin generates the LocaleConfig file and adds a reference to it in the final manifest file, so you no longer have to create or update the file manually. AGP uses the resources in the res folders of your app modules and any library module dependencies to determine the locales to include in the LocaleConfig file.

  • Dynamic updates for an app's localeConfig: Use the setOverrideLocaleConfig() and getOverrideLocaleConfig() methods in LocaleManager to dynamically update your app's list of supported languages in the device's system settings. Use this flexibility to customize the list of supported languages per region, run A/B experiments, or provide an updated list of locales if your app utilizes server-side pushes for localization.

  • App language visibility for input method editors (IMEs): IMEs can utilize the getApplicationLocales() method to check the language of the current app and match the IME language to that language.

Grammatical Inflection API

30억 명의 사용자가 성별이 지정된 언어를 사용합니다. 이 언어는 이야기하는 사람과 사물의 성별에 따라 문법적 카테고리(예: 명사, 동사, 형용사, 전치사)가 영향을 받는 언어입니다. 일반적으로 성별이 지정된 많은 언어에서 남성형 문법적 성별을 기본 성별이나 일반 성별로 사용합니다.

여성을 남성형 문법적 성별로 언급하는 등 잘못된 문법적 성별로 사용자를 언급하면 사용자의 실적과 태도에 부정적인 영향을 미칠 수 있습니다. 반면 사용자의 문법적 성별을 올바르게 반영하는 언어로 된 UI는 사용자 참여를 개선하고 보다 맞춤설정되고 자연스러운 사용자 환경을 제공할 수 있습니다.

To help you build a user-centric UI for gendered languages, Android 14 introduces the Grammatical Inflection API, which lets you add support for grammatical gender without refactoring your app.

지역 설정

Regional preferences enable users to personalize temperature units, the first day of the week, and numbering systems. A European living in the United States might prefer temperature units to be in Celsius rather than Fahrenheit and for apps to treat Monday as the beginning of the week instead of the US default of Sunday.

New Android Settings menus for these preferences provide users with a discoverable and centralized location to change app preferences. These preferences also persist through backup and restore. Several APIs and intents—such as getTemperatureUnit and getFirstDayOfWeek— grant your app read access to user preferences, so your app can adjust how it displays information. You can also register a BroadcastReceiver on ACTION_LOCALE_CHANGED to handle locale configuration changes when regional preferences change.

To find these settings, open the Settings app and navigate to System > Languages & input > Regional preferences.

Regional preferences screen in Android system settings.
Temperature options for regional preferences in Android system settings.

접근성

비선형 글꼴 크기 200%로 조정

Android 14부터 시스템은 글꼴 크기를 최대 200%까지 지원합니다. 이를 통해 저시력 사용자에게 웹 콘텐츠 접근성 가이드라인(WCAG)에 맞는 추가 접근성 옵션을 제공할 수 있습니다.

화면의 큰 텍스트 요소가 너무 커지지 않도록 시스템에서는 비선형 크기 조정 곡선을 적용합니다. 이 크기 조정 전략은 큰 텍스트가 작은 텍스트와 동일한 비율로 조정되지 않음을 의미합니다. 비선형 글꼴 크기 조정은 다양한 크기의 요소 간에 비례 계층 구조를 유지하는 동시에 높은 수준으로 크기가 조정되는 선형 텍스트 문제(예: 텍스트가 잘리거나 너무 큰 디스플레이 크기로 인해 텍스트를 읽기 어려워지는 경우)를 완화하는 데 도움이 됩니다.

비선형 글꼴 크기 조정으로 앱 테스트

기기의 접근성 설정에서 최대 글꼴 크기를 사용 설정하여 앱을 테스트합니다.

이미 조정된 픽셀(sp) 단위를 사용하여 텍스트 크기를 정의한다면 이러한 추가 옵션과 크기 조정 개선사항이 앱의 텍스트에 자동으로 적용됩니다. 그러나 여전히 최대 글꼴 크기(200%)를 사용 설정한 상태에서 UI 테스트를 실행하여 앱이 글꼴 크기를 올바르게 적용하고, 사용성에 영향을 미치지 않으면서 더 큰 글꼴 크기를 수용할 수 있는지 확인해야 합니다.

200% 글꼴 크기를 사용 설정하려면 다음 단계를 따르세요.

  1. 설정 앱을 열고 접근성 > 디스플레이 크기 및 텍스트로 이동합니다.
  2. 글꼴 크기 옵션의 경우 이 섹션에 제공되는 이미지와 같이 최대 글꼴 크기 설정이 사용 설정될 때까지 더하기(+) 아이콘을 탭합니다.

텍스트 크기에 조정된 픽셀(sp) 단위 사용

항상 sp 단위로 텍스트 크기를 지정해야 합니다. 앱에서 sp 단위를 사용하면 Android에서는 사용자의 기본 텍스트 크기를 적용하고 적절하게 크기를 조정할 수 있습니다.

패딩 또는 뷰 높이에는 sp 단위를 사용하지 마세요. 비선형 글꼴 크기 조정 sp 치수는 비례하지 않을 수 있으므로 4sp + 20sp가 24sp와 같지 않을 수 있습니다.

조정된 픽셀(sp) 단위 변환

TypedValue.applyDimension()을 사용하여 sp 단위에서 픽셀로 변환하고 TypedValue.deriveDimension()을 사용하여 픽셀을 sp로 변환합니다. 이러한 메서드는 적절한 비선형 크기 조정 곡선을 자동으로 적용합니다.

Configuration.fontScale 또는 DisplayMetrics.scaledDensity를 사용하여 수식을 하드코딩하지 마세요. 이제 글꼴 크기 조정이 비선형이므로 이러한 필드가 더 이상 정확하지 않습니다.

사용자 환경

Sharesheet 맞춤 작업 및 개선된 순위 지정

Android 14에서는 맞춤 앱 작업과 사용자에게 더 많은 정보를 제공하는 미리보기 결과를 지원하도록 시스템 Sharesheet를 업데이트합니다.

맞춤 작업 추가

Android 14에서는 앱에서 호출하는 시스템 Sharesheet에 맞춤 작업을 추가할 수 있습니다. Sharesheet로 작업을 맞춤설정하려면 ChooserAction.Builder를 사용하여 맞춤 ChooserAction을 만들고 Intent.createChooser로 만든 IntentIntent.EXTRA_CHOOSER_CUSTOM_ACTIONSChooserActions 목록을 지정하세요.

이 이미지는 앱에 표시된 Sharesheet를 보여주며 이는 사용자가 사람의 이미지를 공유한 결과입니다. Sharesheet에는 이미지를 공유할 수 있는 연락처 및 앱을 나타내는 여러 아이콘이 표시됩니다.

직접 공유 타겟의 순위 향상

Android 14는 앱에서 더 많은 신호를 사용하여 직접 공유 타겟의 순위를 결정하고 사용자에게 더 유용한 결과를 제공합니다. 순위에 가장 유용한 신호를 제공하려면 사용자가 연락처에 메시지를 보낼 때 상응하는 바로가기로 pushDynamicShortcut을 호출하여 바로가기 사용을 보고하고, ShortcutInfoCompat.Builder#addCapabilityBinding("actions.intent.SEND_MESSAGE")를 호출하여 상응하는 기능 'actions.intent.SEND_MESSAGE'를 해당 바로가기에 연결합니다.

뒤로 탐색 예측을 위한 내장 및 맞춤 애니메이션 지원

Video: Predictive back animations

Android 13 introduced the predictive back-to-home animation behind a developer option. When used in a supported app with the developer option enabled, swiping back shows an animation indicating that the back gesture exits the app back to the home screen.

Android 14 includes multiple improvements and new guidance for Predictive Back:

With this Android 14 preview release, all features of Predictive Back remain behind a developer option. See the developer guide to migrate your app to predictive back, as well as the developer guide to creating custom in-app transitions.

앱 스토어 개선사항

Android 14 introduces several new PackageInstaller APIs that allow app stores to improve their user experience.

Request install approval before downloading

Installing or updating an app may require user approval. For example, when an installer making use of the REQUEST_INSTALL_PACKAGES permission attempts to install a new app. In prior Android versions, app stores can only request user approval after APKs are written to the install session and the session is committed.

Starting with Android 14, the requestUserPreapproval() method lets installers request user approval before committing the install session. This improvement lets an app store defer downloading any APKs until after the installation has been approved by the user. Furthermore, once a user has approved installation, the app store can download and install the app in the background without interrupting the user.

Claim responsibility for future updates

The new setRequestUpdateOwnership() method allows an installer to indicate to the system that it intends to be responsible for future updates to an app it is installing. This capability enables update ownership enforcement, meaning that only the update owner is permitted to install automatic updates to the app. Update ownership enforcement helps to ensure that users receive updates only from the expected app store.

Any other installer, including those making use of the INSTALL_PACKAGES permission, must receive explicit user approval in order to install an update. If a user decides to proceed with an update from another source, update ownership is lost.

Update apps at less-disruptive times

App stores typically want to avoid updating an app that is actively in use because this leads to the app's running processes being killed, which potentially interrupts what the user was doing.

Starting with Android 14, the InstallConstraints API gives installers a way to ensure that their app updates happen at an opportune moment. For example, an app store can call the commitSessionAfterInstallConstraintsAreMet() method to make sure that an update is only committed when the user is no longer interacting with the app in question.

Seamlessly install optional splits

With split APKs, features of an app can be delivered in separate APK files, rather than as a monolithic APK. Split APKs allow app stores to optimize the delivery of different app components. For example, app stores might optimize based on the properties of the target device. The PackageInstaller API has supported splits since its introduction in API level 22.

In Android 14, the setDontKillApp() method allows an installer to indicate that the app's running processes shouldn't be killed when new splits are installed. App stores can use this feature to seamlessly install new features of an app while the user is using the app.

사용자가 기기 스크린샷을 찍을 때 감지

To create a more standardized experience for detecting screenshots, Android 14 introduces a privacy-preserving screenshot detection API. This API lets apps register callbacks on a per-activity basis. These callbacks are invoked, and the user is notified, when the user takes a screenshot while that activity is visible.

그래픽

이제 쿼리하고 보간할 수 있는 경로

Android's Path API is a powerful and flexible mechanism for creating and rendering vector graphics, with the ability to stroke or fill a path, construct a path from line segments or quadratic or cubic curves, perform boolean operations to get even more complex shapes, or all of these simultaneously. One limitation is the ability to find out what is actually in a Path object; the internals of the object are opaque to callers after creation.

To create a Path, you call methods such as moveTo(), lineTo(), and cubicTo() to add path segments. But there has been no way to ask that path what the segments are, so you must retain that information at creation time.

Starting in Android 14, you can query paths to find out what's inside of them. First, you need to get a PathIterator object using the Path.getPathIterator API:

Kotlin

val path = Path().apply {
    moveTo(1.0f, 1.0f)
    lineTo(2.0f, 2.0f)
    close()
}
val pathIterator = path.pathIterator

Java

Path path = new Path();
path.moveTo(1.0F, 1.0F);
path.lineTo(2.0F, 2.0F);
path.close();
PathIterator pathIterator = path.getPathIterator();

Next, you can call PathIterator to iterate through the segments one by one, retrieving all of the necessary data for each segment. This example uses PathIterator.Segment objects, which packages up the data for you:

Kotlin

for (segment in pathIterator) {
    println("segment: ${segment.verb}, ${segment.points}")
}

Java

while (pathIterator.hasNext()) {
    PathIterator.Segment segment = pathIterator.next();
    Log.i(LOG_TAG, "segment: " + segment.getVerb() + ", " + segment.getPoints());
}

PathIterator also has a non-allocating version of next() where you can pass in a buffer to hold the point data.

One of the important use cases of querying Path data is interpolation. For example, you might want to animate (or morph) between two different paths. To further simplify that use case, Android 14 also has a new interpolate() method on Path. Assuming the two paths have the same internal structure, the interpolate() method creates a new Path with that interpolated result. This example returns a path whose shape is halfway (a linear interpolation of .5) between path and otherPath:

Kotlin

val interpolatedResult = Path()
if (path.isInterpolatable(otherPath)) {
    path.interpolate(otherPath, .5f, interpolatedResult)
}

Java

Path interpolatedResult = new Path();
if (path.isInterpolatable(otherPath)) {
    path.interpolate(otherPath, 0.5F, interpolatedResult);
}

The Jetpack graphics-path library, now available in alpha, enables similar APIs for earlier versions of Android as well.

핵심 기능

OpenJDK 17 업데이트

Android 14 continues the work of refreshing Android's core libraries to align with the features in the latest OpenJDK LTS releases, including both library updates and Java 17 language support for app and platform developers.

The following features and improvements are included:

  • Updated approximately 300 java.base classes to Java 17 support.
  • Text Blocks, which introduce multi-line string literals to the Java programming language.
  • Pattern Matching for instanceof, which allows an object to be treated as having a specific type in an instanceof without any additional variables.
  • Sealed classes, which allow you restrict which classes and interfaces can extend or implement them.

Thanks to Google Play system updates (Project Mainline), over 600 million devices are enabled to receive the latest Android Runtime (ART) updates that include these changes. This is part of our commitment to give apps a more consistent, secure environment across devices, and to deliver new features and capabilities to users independent of platform releases.

Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.