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

0991ca4bc363163337f7b02b98af538a?s=128

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
  2. 1. Android 11 2. Android Studio 3. Modern Android Development

  3. Android 11

  4. 1. Built-in screen recording 2. New Media Control 3. Smart

    Reply 4. Conversations User-sided features
  5. Developer sided Features

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

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

  8. </ Create bubble intent val target = Intent(context, BubbleActivity<:class.java) val

    bubbleIntent = PendingIntent.getActivity(context, 0, target, 0 <* flags </) </ Create bubble metadata val bubbleData = Notification.BubbleMetadata.Builder(bubbleIntent, Icon.createWithResource(context, R.drawable.icon)) .setDesiredHeight(600) .build()
  9. </ Create bubble intent val target = Intent(context, BubbleActivity<:class.java) val

    bubbleIntent = PendingIntent.getActivity(context, 0, target, 0 <* flags </) </ 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()
  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)
  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
  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()
  13. WindowInsets - Can listen to WindowInsets animations - Can show

    keyboard easily - Will be added to appcompat later
  14. doOnLayout { </Show windowInsetsController<.show(WindowInsets.Type.ime()) </Hide windowInsetsController<.hide(WindowInsets.Type.ime()) }

  15. val animationCallback = object : WindowInsetsAnimation.Callback(DISPATCH_MODE_STOP) { override fun onPrepare(animation:

    WindowInsetsAnimation) { </TODO } override fun onStart( animation: WindowInsetsAnimation, bounds: WindowInsetsAnimation.Bounds ): WindowInsetsAnimation.Bounds { </TODO } override fun onProgress( insets: WindowInsets, runningAnimations: List<WindowInsetsAnimation> ): WindowInsets { </TODO } override fun onEnd(animation: WindowInsetsAnimation) { </TODO } }
  16. https://medium.com/androiddevelopers/ani mating-your-keyboard-fb776a8fb66d

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

    or pairing code
  18. Privacy Updates

  19. Scoped Storage - requestLegacyExternalStorage is ignored on Android 11 -

    Access to all files in shared storage requires read/write file permission
  20. One-Time Permission

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

    few months
  22. Don’t ask again - If user taps “Decline” more than

    once, it’s considered as “Don’t ask again”
  23. Background Location Permission - Need to be requested separately -

    Have to request for Foreground Location permission first <manifest <<. > <<<- Required only when requesting background location access on Android 10 (API level 29) and higher. <<> <uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" <> </manifest>
  24. Tools

  25. 1. Database Inspector 2. Android Emulator Windows 3. Dagger Navigation

    4. TFLite 5. Foldables Android Studio 4.1 STABLE
  26. Database Inspector

  27. Android Emulator Window

  28. Dagger Navigation

  29. Dagger Navigation

  30. TFLite

  31. Foldable

  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
  33. Modern Android Development

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

  35. of Android developers prefer using Kotlin 60%

  36. Jetpack

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

    Compose Modern Android Development
  38. • No longer recommends multiple activities • Prefer to use

    Fragment and Nav Arch to structure single-activity Single Activity Architecture
  39. ViewModel+LiveData • ViewModel is not MVVM

  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)
  41. ViewModel+LiveData • ViewModel is not MVVM • Understand how LiveData

    works
  42. • Data Store (Protobuffer) • Room • Scoped Storage Persistence

    Storage
  43. • Manual Injection for small project • Dagger for large

    project Dependency Injection
  44. • Constraint Layout • Motion Layout • Jetpack Compose Layouts

  45. Future

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

    Team Lead nexlabs