I/O Extended 2022 in Android ~ Whats new in And...

I/O Extended 2022 in Android ~ Whats new in Android development tools

Google IO Extended 2022 Korea Android에서 발표한 "Whats new in Android development tools" 입니다

pluulove (노현석)

June 11, 2022

Annual Pro sale · Save $30

Have presentations of your own?

Share with private links, password protection, and more control over your work.

Transcript

63 slides
  1. 2021.2.1 Stable Patch 1 Chipmunk 01 2021.3.1 Beta 2 Dolphin

    02 2022.1.1 Canary 3 Electric Eel 03 Android Studio
  2. 1. ѐߊ੗ ২࣌ > ޖࢶ ٣ߡӦ ON 2. Android Studio

    > run configurations ݫ׏ীࢲ “Pair Devices Using Wi-Fi”ࢶఖ
  3. Device Manager ADB over Wi-Fi Emulator tool window Instrumented Tests

    Profileable Apps Layout Inspector Snapshots Interactive Preview Animated Vector Drawable Preview
  4. Jank Detection in CPU profiler 1. UI jank detection ~

    Detect jank on Android 12 and higher : https://developer.android.com/studio/profile/jank- detection#detect_jank_on_android_12_and_higher 2. Spot your UI jank using CPU profiler in Android Studio : https://medium.com/androiddevelopers/spot-your-ui-jank-using-cpu- profiler-in-android-studio-9a4c41a54dab
  5. System Trace Recording record step : Start Profiler > CPU

    > [ON] System Trace Recording > Record
  6. System Trace Recording record step : Start Profiler > CPU

    > [ON] System Trace Recording > Record
  7. UI ߡߢѢܿ੉ হ਺ 01 জ੉ ੉੹ ೐ۨ੐੉ ಴दغӝ ੹ী दझమ

    ী ೐ۨ੐ਸ ҅ࣘ ࠁմ ҃਋. ੉੹ ೐ۨ੐੉ ߡߢѢܻӝ ٸޙী ߊࢤ. 02 জ ೐۽ࣁझо ৘࢚ࠁ׮ য়ې प೯. ೐ۨ੐੄ Deadline੄ ӝળਸ ֈযࢾӝ ٸޙী ߡߢѢܿਵ۽ р઱ػ ೐ۨ੐. 03 Janky frames 1. Detect jank on Android 12 and higher : https://developer.android.com/studio/profile/jank- detection#detect_jank_on_android_12_and_higher 2. Spot your UI jank using CPU profiler in Android Studio : https://medium.com/androiddevelopers/spot-your-ui-jank-using- cpu-profiler-in-android-studio-9a4c41a54dab
  8. AndroidXܳ ޷૑ਗೞח ۄ੉࠳۞ܻܳ ਤೠ ഐജࢿ ೒ېӒ. ؀ࠗ࠙ AndroidXܳ ૑ਗ೮׮Ҋ ౸ױೞৈ

    ؊ ੉࢚ ೐۽ં౟ী ࠛ೙ਃ. ೒ېӒ۽ ੋ೧ ࠽٘ ࢿמ੉ ੷ೞؼ ࣻ ੓׮. Chipmunk Jetifier warning # gradle.properties android.enableJetifier=true Jetifier warning and check in Build Analyzer : https://developer.android.com/studio/releases/gradle-plugin#jetifier-build- analyzer Deprecated
  9. Build Analyzer ~ Warning Jetifierܳ ઁѢܳ ঐद੸ਵ۽ ֢୹. ੹੉੸ ੄ઓࢿ(transitive

    dependencies)ਸ ా೧ deprecatedػ ಁః૑ܳ ೙ਃ۽ ೞח ۄ੉࠳۞ܻী ੄ઓೠ׮ח Ѫਸ ঌ۰ષ.
  10. Build Analyzer ~ Warning Jetifierܳ ઁѢܳ ঐद੸ਵ۽ ֢୹. ੹੉੸ ੄ઓࢿਸ

    ా೧ deprecatedػ ಁః૑ܳ ೙ਃ۽ ೞח ۄ੉࠳۞ܻী ੄ઓೠ׮ח Ѫਸ ঌ۰ષ.
  11. Build Analyzer ~ Fixed grade.properties੄ enableJetifier ࣘࢿਸ False۽ ؀਽ ࣘࢿ

    ઁѢद ૐ࠙ ࠽٘ ࣘبо 5~8% ࡈۄ૗ https://developer.android.com/jetpack/androidx/migrate
  12. Run script on sunflower ganadist ~ https://gist.github.com/ganadist/b43d64510fbff2ff74f1aa92004fd3ff subprojects { afterEvaluate

    { configurations.all { resolutionStrategy.eachDependency { DependencyResolveDetails details -> // minimum version of GMS Libraries which is migrated with AndroidX if (details.target.group.startsWith("com.android.support") || details.target.group.startsWith("android.arch")) { throw new GradleException("${details.target} library was included") } } } } }
  13. Run script ~ result * What went wrong: Execution failed

    for task ':app:dataBindingMergeDependencyArtifactsDebug'. > Could not resolve all files for configuration ':app:debugCompileClasspath'. > Could not resolve com.android.support:support-v4:23.0.0. Required by: project :app > com.google.android.gms:play-services-basement:9.0.0 > com.android.support:support-v4:23.0.0 library was included com.google.firebase:firebase-auth:9.0.0 +--- com.google.android.gms:play-services-base:9.0.0 | +--- com.google.android.gms:play-services-basement:9.0.0 | | \--- com.android.support:support-v4:23.0.0 | +--- com.google.firebase:firebase-common:9.0.0 | \--- com.google.android.gms:play-services-tasks:9.0.0 +--- com.google.android.gms:play-services-basement:9.0.0 +--- com.google.firebase:firebase-auth-common:9.0.0 +--- com.google.firebase:firebase-auth-module:9.0.0 +--- com.google.firebase:firebase-common:9.0.0 \--- com.google.android.gms:play-services-tasks:9.0.0 ganadist ~ https://gist.github.com/ganadist/b43d64510fbff2ff74f1aa92004fd3ff
  14. Library has policy issues in SDK Index ੉ ۄ੉࠳۞ܻ ߡ੹ীח

    Google Play झషযীࢲ ѱदܳ ରױೞח ੿଼ ੉ग https://cs.android.com/android-studio/platform/tools/base/+/mirror-goog-studio-main:lint/libs/lint-checks/src/main/java/ com/android/tools/lint/checks/GooglePlaySdkIndex.kt Electric Eel
  15. Library has policy issues in SDK Index ੉ ۄ੉࠳۞ܻ ߡ੹ীח

    Google Play झషযীࢲ ѱदܳ ରױೞח ੿଼ ੉ग Electric Eel https://play.google.com/sdks
  16. ./gradlew --info --refresh-dependencies > Configure project : Evaluating root project

    'sunflower' using build file '/Users/pluu/SampleProject/sunflower/build.gradle'. Downloading https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/7.2.1/gradle-7.2.1.pom to /Users/ pluu/.gradle/.tmp/gradle_download2958690770490799267bin Resource missing. [HTTP GET: https://dl.google.com/dl/android/maven2/org/jetbrains/kotlin/kotlin-gradle-plugin/1.6.21/kotlin- gradle-plugin-1.6.21.pom] Resource missing. [HTTP GET: https://dl.google.com/dl/android/maven2/com/google/dagger/hilt-android-gradle-plugin/2.41/hilt- android-gradle-plugin-2.41.pom] … Downloading https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-gradle-plugin/1.6.21/kotlin-gradle- plugin-1.6.21.pom to /Users/pluu/.gradle/.tmp/gradle_download1710862990632809244bin Downloading https://repo.maven.apache.org/maven2/com/google/dagger/hilt-android-gradle-plugin/2.41/hilt-android-gradle- plugin-2.41.pom to /Users/pluu/.gradle/.tmp/gradle_download13128778667499341771bin … // root build.gradle buildscript { repositories { google() mavenCentral() } }
  17. п ݽٕ੄ R ௿ېझী ؀ೠ ֎੐झಕ੉झܳ ࢎਊೞب۾ ߸҃ AGPח ࠽٘

    द ܻࣗझܳ জ R ௿ېझী 
 ࠂઁೞ૑ ঋইب ػ׮, Non-Transitive R Classes 01 ௏٘ܳ ߸҃ೞ؊ۄب ৔ೱਸ ߉ח 
 ࢜۽਍ ݽٕ݅ ׮द ҅࢑ೠ׮. Lint Cache 02 More Builds Chipmunk
  18. android { testOptions { managedDevices { devices { pixel2api30 (com.android.build.api.dsl.ManagedVirtualDevice)

    { // Use device profiles you typically see in Android Studio. device = "Pixel 2" // Use only API levels 27 and higher. apiLevel = 30 // To include Google services, use "google". systemImageSource = "aosp" // Whether the image must be a 64 bit image. Defaults to false, // in which case the managed device will use a 32 bit image. // Not applicable to arm64 machines. require64Bit = false } } } } } Dolphin Gradle Managed Virtual Devices
  19. android { testOptions { managedDevices { devices { pixel2api30 (com.android.build.api.dsl.ManagedVirtualDevice)

    { // Use device profiles you typically see in Android Studio. device = "Pixel 2" // ATD currently support only API level 30. apiLevel = 30 // You can also specify "google-atd" if you require Google Play Services. systemImageSource = "aosp-atd" // Whether the image must be a 64 bit image. require64Bit = false } } } } } Dolphin Android testing ~ Gradle Managed Virtual Devices : https://developer.android.com/studio/preview/features#gmd AVD location : /Users/$USER/.android/avd/gradle-managed Automated Test Devices
  20. Visual linting ׮নೠ ചݶ ௼ӝীࢲ Visual Lint ޙઁ ഛੋ Layout

    Validationਸ ৌݶ ݽٚ ۨ੉ইਓ੉ ৈ۞ ੢஖ ௼ӝ۽ ۪؊݂ ֢୹ Electric Eel
  21. Live Edit “Live edit of literals”ࠁ׮ ѐࢶػ সؘ੉౟ ୊ܻ ੗زਵ۽

    ޷ܻ ࠁӝܳ সؘ੉౟, ௏٘ ߸҃ ࢎ೦ਸ पदрਵ۽ ഛੋ оמ https://developer.android.com/jetpack/compose/tooling#live-edit Electric Eel
  22. Compose Preview Light/Dark Theme, ٣߄੉झ ߑೱ, ചݶ ௼ӝ ١ ׮নೠ

    ઑѤীࢲ Composableਸ ޷ܻ ഛੋೡ ࣻ ੓׮. https://developer.android.com/jetpack/compose/tooling
  23. Preview sample @Preview(showBackground = true) @Preview(showBackground = true, uiMode =

    Configuration.UI_MODE_NIGHT_YES) @Composable fun NiaCatalogPreview() { NiaTheme { Surface { // composable function } } }
  24. Multipreview sample @Preview(showBackground = true) @Preview(showBackground = true, uiMode =

    Configuration.UI_MODE_NIGHT_YES) annotation class SamplePreview @SamplePreview @Composable fun NiaCatalogPreview() { NiaTheme { Surface { NiaCatalog() } } https://developer.android.com/jetpack/compose/tooling#preview-features Compose 1.2
  25. Compose Recomposition Counts Layout Inspectorܳ ࢎਊೞৈ 
 ۨ੉ইਓ ҅க੄ п

    Composable੉ ੤ҳࢿغѢա Ѥցګ द੼ਸ ഛੋ оמ. https://github.com/ComposeDesigner/ComposeLoginScreen https://developer.android.com/studio/preview/features#new_in_compose Compose 1.2-alpha03
  26. Etc

  27. Android Studioী োѾػ Google ҅੿੄ Firebase Crashlytics۽ ఐ૑ػ ী۞ܳ ഛੋೡ

    ࣻ ੓׮ • Crashо ߊࢤೠ Devices • Android Versions • App version, ࣻ૘ दр App Insights Electric Eel
  28. Electric Eel Android Studioী োѾػ Google ҅੿੄ Firebase Crashlytics۽ ఐ૑ػ

    ী۞ܳ ഛੋೡ ࣻ ੓׮ • Crashо ߊࢤೠ Devices • Android Versions • App version, ࣻ૘ दр App Insights
  29. gradle.properties # Automatically convert third- party libraries to use AndroidX

    android.enableJetifier=false ೐۽ં౟੄ 80%о ࢎਊ ઺ 80% ઁѢद ૐ࠙ ࠽٘ ࣘبо 10% ੉࢚ ೱ࢚ ~10%
  30. Dolphin Electric Eel Logcat v2 SDK Index Integration WearOS Launch

    Configurations WearOS Pairing Assistant & Toolbar Gradle Managed Devices Compose Recomposition in Layout Inspector Compose Animation Coordination Preview Live Edit (Jetpack Compose) Visual Lint for Compose Compose Multi-Preview Device Mirroring Resizable Emulator App Quality Insights android studio

More Decks by pluulove (노현석)

Other Decks in Programming