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

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

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

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

354271902cd8ba2762d05b251dfa0f84?s=128

pluulove (노현석)

June 11, 2022
Tweet

More Decks by pluulove (노현석)

Other Decks in Programming

Transcript

  1. Whats new in Android development tools Android Studio Hyeonseok Noh

    Android Developer Kakaobank
  2. Adobe Stock#243026154 Android Developer Google Developers Experts for Android Kakaobank

    Hyoenseok Noh Pluu
  3. #io22 https://youtu.be/RFv8GkLd5OY

  4. 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
  5. None
  6. Bumblebee Animated Vector Drawable Preview

  7. Android 11+ ૑ਗ Wi-Fiܳ ా೧ ӝӝী োѾ Bumblebee

  8. 1. ѐߊ੗ ২࣌ > ޖࢶ ٣ߡӦ ON 2. Android Studio

    > run configurations ݫ׏ীࢲ “Pair Devices Using Wi-Fi”ࢶఖ
  9. QR code Pairing code

  10. QR code Pairing code

  11. Device Manager ADB over Wi-Fi Emulator tool window Instrumented Tests

    Profileable Apps Layout Inspector Snapshots Interactive Preview Animated Vector Drawable Preview
  12. Android Studio Chipmunk Patch 1

  13. Chipmunk Compose Animation Preview

  14. None
  15. 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
  16. System Trace Recording record step : Start Profiler > CPU

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

    > [ON] System Trace Recording > Record
  18. None
  19. 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
  20. 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
  21. Android Studio Dolphin Beta 2 Android Studio Electric Eel Canary

    3
  22. Build Analyzer

  23. Upgrade Assistant

  24. Build Analyzer ~ Warning Jetifierܳ ઁѢܳ ঐद੸ਵ۽ ֢୹. ੹੉੸ ੄ઓࢿ(transitive

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

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

    ઁѢद ૐ࠙ ࠽٘ ࣘبо 5~8% ࡈۄ૗ https://developer.android.com/jetpack/androidx/migrate
  27. 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") } } } } }
  28. 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
  29. 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
  30. Library has policy issues in SDK Index ੉ ۄ੉࠳۞ܻ ߡ੹ীח

    Google Play झషযীࢲ ѱदܳ ରױೞח ੿଼ ੉ग Electric Eel https://play.google.com/sdks
  31. Arctic Fox

  32. Arctic Fox

  33. None
  34. ./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() } }
  35. п ݽٕ੄ R ௿ېझী ؀ೠ ֎੐झಕ੉झܳ ࢎਊೞب۾ ߸҃ AGPח ࠽٘

    द ܻࣗझܳ জ R ௿ېझী 
 ࠂઁೞ૑ ঋইب ػ׮, Non-Transitive R Classes 01 ௏٘ܳ ߸҃ೞ؊ۄب ৔ೱਸ ߉ח 
 ࢜۽਍ ݽٕ݅ ׮द ҅࢑ೠ׮. Lint Cache 02 More Builds Chipmunk
  36. 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
  37. 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
  38. None
  39. https://developer.android.com/topic/performance/baselineprofiles Baseline Profiles Play Storeীࢲ জਸ ࢸ஖ द ޷ܻ ஹ౵ੌ೧ঠ

    ೞח ௿ېझ ߂ ݫࢲ٘ ݾ۾ TBD
  40. Profiler debuggable builds ٣ߡӦ ੿ࠁ হ੉ ೐۽౵ੌ݂ਸ द੘. ೐۽౵ੌ݂݅ਸ ਤೠ

    పझ౟о оמ - Enabled : CPU/Memory profilers TBD
  41. Quality

  42. Dolphin

  43. Dolphin https://developer.android.com/studio/preview/features#logcat New Logcat • New formatter/ࠂࣻ Logcat windows/Log View

    ఋੑ ߸҃ • জ ୽ج/׮द द੘ द ۽Ӓ ୶о۽ ୶੸
  44. Adobe Stock#243026154 Device Mirroring • File > Settings > Experimental

    : Check Mirroring Electric Eel
  45. Adobe Stock#243026154 Support Resizable Emulator

  46. Visual linting ׮নೠ ചݶ ௼ӝীࢲ Visual Lint ޙઁ ഛੋ Layout

    Validationਸ ৌݶ ݽٚ ۨ੉ইਓ੉ ৈ۞ ੢஖ ௼ӝ۽ ۪؊݂ ֢୹ Electric Eel
  47. Compose Live Edit / Compose Preview

  48. Live Edit “Live edit of literals”ࠁ׮ ѐࢶػ সؘ੉౟ ୊ܻ ੗زਵ۽

    ޷ܻ ࠁӝܳ সؘ੉౟, ௏٘ ߸҃ ࢎ೦ਸ पदрਵ۽ ഛੋ оמ https://developer.android.com/jetpack/compose/tooling#live-edit Electric Eel
  49. Electric Eel

  50. Preferences | Editor | Live Edit Live Edit

  51. Compose Preview Light/Dark Theme, ٣߄੉झ ߑೱ, ചݶ ௼ӝ ١ ׮নೠ

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

    Configuration.UI_MODE_NIGHT_YES) @Composable fun NiaCatalogPreview() { NiaTheme { Surface { // composable function } } }
  53. 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
  54. Compose Animation ݽٚ গפݫ੉࣌ਸ ೠ ߣী ѨࢎೞҊ ઑ੿ оמ. ౠ੿

    গפݫ੉࣌ਸ Ҋ੿ب оמ Electric Eel
  55. 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
  56. Compose 1.2-alpha03

  57. Etc

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

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

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

    android.enableJetifier=false ೐۽ં౟੄ 80%о ࢎਊ ઺ 80% ઁѢद ૐ࠙ ࠽٘ ࣘبо 10% ੉࢚ ೱ࢚ ~10%
  61. 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
  62. Issue Tracker https://issuetracker.google.com/issues

  63. Thank you! Hyeonseok Noh @pluulove Android Developer Kakaobank https://developer.android.com/studio/releases https://developer.android.com/studio/preview/features

    https://developer.android.com/studio/releases/gradle-plugin Resources