$30 off During Our Annual Pro Sale. View Details »

Android Studio - What's new 2020

Android Studio - What's new 2020

In this talk, we will take a look at the new Android Studio 4.0 and the tooling that has been added in this new release. Looking at how we can now inspect Databases, use the new Motion Editor and other small treats that the latest release has included. Join to learn about all the new goodies you can play around with in Android Studio!

Rebecca is a Principal Android Engineer at Over (acquired by GoDaddy), she has been passionately building Android Apps for over 8 years now. She loves making beautiful Android Apps and teaching others all the tricks she learns along the way. She is a Google Developer Expert for Android and blogs regularly at https://riggaroo.dev. When she isn't coding or teaching, she can be found baking up a storm in her kitchen.

Rebecca Franks

August 05, 2020
Tweet

More Decks by Rebecca Franks

Other Decks in Programming

Transcript

  1. Rebecca Franks
    Android Engineer & GDE
    @riggaroo
    What’s new in
    Android Studio?

    View Slide

  2. Android Studio 4.0

    View Slide

  3. Android Studio 4.0 Treats
    • Motion Editor
    • Live Layout Inspector
    • Multi preview of Layouts
    • Java 8 library desugaring
    • Gradle build analyser

    View Slide

  4. Motion Editor
    UI Tool for editing & previewing Motion Scene Files from MotionLayout
    bit.ly/motion-editor

    View Slide

  5. View Slide

  6. Resources
    bit.ly/motion-editor < video
    bit.ly/motion-layout < blog

    View Slide

  7. Live Layout Inspector
    - Similar to Chrome Developer Tools
    - Real time information whilst running on device
    - 3D Preview
    - Property resolution - Why is this colour blue?

    View Slide

  8. Layout Validation ✅
    - Help makes your layouts by showing you different previews
    - Preview different font sizes, common types of colour blindness, languages
    etc

    View Slide

  9. Java 8 library desugaring
    AS now includes support for using a number of Java 8 language APIs without
    requiring a minimum API level for your app.
    In AS 4.0, the desugaring engine extended to be able to desugar Java
    language APIs:
    • Sequential streams (java.util.stream)
    • A subset of java.time
    • java.util.function
    • Recent additions to java.util.{Map,Collection,Comparator}
    • Optionals java.util.Optional
    • Additional methods to AtomicInteger etc
    • ConcurrentHashMap

    View Slide

  10. Java 8 library desugaring
    android {
    defaultConfig {
    // Required when setting minSdkVersion to 20 or lower
    multiDexEnabled true
    }
    compileOptions {
    // Flag to enable support for the new language APIs
    coreLibraryDesugaringEnabled true
    // Sets Java compatibility to Java 8
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8
    }
    }
    dependencies {
    coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.0.4'
    }

    View Slide

  11. Build Analyzer
    - Diagnose issues with your build process & provide valuable build info
    - Make sure you are using Android Gradle Plugin 4.0.0 (or higher)

    View Slide

  12. View Slide

  13. View Slide

  14. View Slide

  15. Android Studio 4.2 Preview

    View Slide

  16. Android Studio 4.2 Treats
    • Database Inspector (4.1+)
    • New project template using Material Components (4.1+)
    • TensorFlow Lite Model Binding (4.1+)
    • Run Android Emulator inside AS (4.1+)
    • Jetpack Compose Previews + Run on device (4.2 Preview)

    View Slide

  17. Database Inspector
    - Query, modify your app’s database in real time whilst its running.

    View Slide

  18. Material Components in AS
    New Project template in Android Studio is now using the MaterialComponents
    theming

    View Slide

  19. View Slide

  20. TensorFlow Lite Model
    binding
    - ML Model binding makes it easier to import .tflite files and use them in your
    projects.
    - Android Studio generates easy to use classes to make use of it.
    https://www.tensorflow.org/lite/guide/codegen

    View Slide

  21. View Slide

  22. More TensorFlow Learning
    https://github.com/margaretmz/icon-classifier
    https://codelabs.developers.google.com/codelabs/recognize-flowers-with-
    tensorflow-on-android-beta/#0

    View Slide

  23. Emulator inside Android
    Studio
    Preferences -> Emulator -> Launch in a tool window

    View Slide

  24. View Slide

  25. Jetpack Compose Previews
    - Support for Interactive previews (click buttons to see how state changes)
    - Deploy to device - deploy a snippet of code to your device, helps make
    testing and development easier

    View Slide

  26. View Slide

  27. Resources
    https://developer.android.com/studio

    View Slide

  28. Rebecca Franks
    Android Engineer & GDE
    @riggaroo
    Thank you!

    View Slide