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

Android 11 and the future

Android 11 and the future

Talk from GDG DevFest Yangon 2020

Aung Kyaw Paing

October 17, 2020
Tweet

More Decks by Aung Kyaw Paing

Other Decks in Programming

Transcript

  1. Android 11 and
    the Future
    Aung Kyaw Paing
    Mobile Development Team Lead
    nexlabs

    View Slide

  2. 1. Android 11
    2. Android Studio
    3. Modern Android Development

    View Slide

  3. Android 11

    View Slide

  4. 1. Built-in screen recording
    2. New Media Control
    3. Smart Reply
    4. Conversations
    User-sided features

    View Slide

  5. Developer
    sided Features

    View Slide

  6. Bubbles
    - Started from Notification panel
    - OS-level support

    View Slide

  7. android:name=".bubbles.BubbleActivity"
    android:theme="@style/AppTheme.NoActionBar"
    android:label="@string/title_activity_bubble"
    android:allowEmbedded="true"
    android:resizeableActivity="true"
    <>

    View Slide

  8. Create bubble intent
    val target = Intent(context, BubbleActivityval bubbleIntent = PendingIntent.getActivity(context, 0, target, 0 Create bubble metadata
    val bubbleData = Notification.BubbleMetadata.Builder(bubbleIntent,
    Icon.createWithResource(context, R.drawable.icon))
    .setDesiredHeight(600)
    .build()

    View Slide

  9. Create bubble intent
    val target = Intent(context, BubbleActivityval bubbleIntent = PendingIntent.getActivity(context, 0, target, 0 Create bubble metadata
    val bubbleData = Notification.BubbleMetadata.Builder(bubbleIntent,
    Icon.createWithResource(context, R.drawable.icon))
    .setDesiredHeight(600)
    .build()
    Create notification
    val chatPartner = Person.Builder()
    .setName("Chat partner")
    .setImportant(true)
    .build()

    View Slide

  10. Create bubble intent
    val target = <val bubbleIntent = < Create bubble metadata
    val bubbleData = < Create notification
    val chatPartner = <val builder = Notification.Builder(context, CHANNEL_ID)
    .setContentIntent(contentIntent)
    .setSmallIcon(smallIcon)
    .setBubbleMetadata(bubbleData)
    .addPerson(chatPartner)

    View Slide

  11. Conversations
    - Show at the top under seperate section
    - Can promote to bubble
    - Conversation-specific actions
    - Mark as priority
    - Promote to bubble
    - Silence notification
    - Custom sounds/vibrations

    View Slide

  12. Create notification
    val chatPartner = Person.Builder()
    .setName("Chat partner")
    .setImportant(true)
    .build()
    Use Person in MessageStyle
    val notification = Notification.Builder(context, channelId)
    .setStyle(
    Notification.MessagingStyle.Builder(person)
    .addMessage(<<build()
    )
    .build()

    View Slide

  13. WindowInsets
    - Can listen to WindowInsets animations
    - Can show keyboard easily
    - Will be added to appcompat later

    View Slide

  14. doOnLayout {
    windowInsetsControllerwindowInsetsController}

    View Slide

  15. val animationCallback = object : WindowInsetsAnimation.Callback(DISPATCH_MODE_STOP) {
    override fun onPrepare(animation: WindowInsetsAnimation) {
    }
    override fun onStart(
    animation: WindowInsetsAnimation,
    bounds: WindowInsetsAnimation.Bounds
    ): WindowInsetsAnimation.Bounds {
    }
    override fun onProgress(
    insets: WindowInsets,
    runningAnimations: List
    ): WindowInsets {
    }
    override fun onEnd(animation: WindowInsetsAnimation) {
    }
    }

    View Slide

  16. https://medium.com/androiddevelopers/ani
    mating-your-keyboard-fb776a8fb66d

    View Slide

  17. Wireless
    debugging
    Easily set up Wifi ADB through QR code or
    pairing code

    View Slide

  18. Privacy
    Updates

    View Slide

  19. Scoped Storage
    - requestLegacyExternalStorage is ignored
    on Android 11
    - Access to all files in shared storage
    requires read/write file permission

    View Slide

  20. One-Time
    Permission

    View Slide

  21. Permission
    Auto-reset
    - Auto reset to decline permission after a
    few months

    View Slide

  22. Don’t ask again
    - If user taps “Decline” more than once, it’s
    considered as “Don’t ask again”

    View Slide

  23. Background
    Location
    Permission
    - Need to be requested separately
    - Have to request for Foreground Location
    permission first

    <<Android 10 (API level 29) and higher. <<>


    View Slide

  24. Tools

    View Slide

  25. 1. Database Inspector
    2. Android Emulator Windows
    3. Dagger Navigation
    4. TFLite
    5. Foldables
    Android Studio 4.1 STABLE

    View Slide

  26. Database Inspector

    View Slide

  27. Android Emulator Window

    View Slide

  28. Dagger Navigation

    View Slide

  29. Dagger Navigation

    View Slide

  30. TFLite

    View Slide

  31. Foldable

    View Slide

  32. 1. Layout Inspector Live Update On/Off
    2. Jetpack Compose support
    3. Safe Args Support
    4. Accessibility Scanner
    5. Multiple Parallel Instrumentation
    Testing
    Android Studio 4.2 Preview

    View Slide

  33. Modern Android
    Development

    View Slide

  34. https://developer.android.com/modern-and
    roid-development

    View Slide

  35. of Android developers prefer using
    Kotlin
    60%

    View Slide

  36. Jetpack

    View Slide

  37. 1. Single-Activity Architecture
    2. ViewModel+LiveData
    3. Dagger
    4. Constraint Layout/Jetpack Compose
    Modern Android Development

    View Slide

  38. ● No longer recommends multiple
    activities
    ● Prefer to use Fragment and Nav Arch
    to structure single-activity
    Single Activity Architecture

    View Slide

  39. ViewModel+LiveData
    ● ViewModel is not MVVM

    View Slide

  40. “The description of the
    class for what it does,
    matches View Model. That has
    nothing to do with MVVM. We
    are not telling you to use
    or not to use MVVM”
    -Yigit Boyar
    (droidcon NYC 2017)

    View Slide

  41. ViewModel+LiveData
    ● ViewModel is not MVVM
    ● Understand how LiveData works

    View Slide

  42. ● Data Store (Protobuffer)
    ● Room
    ● Scoped Storage
    Persistence Storage

    View Slide

  43. ● Manual Injection for small project
    ● Dagger for large project
    Dependency Injection

    View Slide

  44. ● Constraint Layout
    ● Motion Layout
    ● Jetpack Compose
    Layouts

    View Slide

  45. Future

    View Slide

  46. Android 11 and
    the Future
    Aung Kyaw Paing
    Mobile Development Team Lead
    nexlabs

    View Slide