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

What's New in Android 11 - GDG Lahore

What's New in Android 11 - GDG聽Lahore

馃攰 Wajahat Karim talks about the new features and APIs in Android 11 at Android 11 Meetups organized by GDG Lahore.

馃憠 Full video: https://youtu.be/mE-B2h5l2ac

Wajahat Karim

July 04, 2020

More Decks by Wajahat Karim

Other Decks in Technology


  1. GDG Lahore What鈥檚 new in Android Wajahat Karim Google Developer

    Expert in Android wajahatkarim.com
  2. GDG Lahore This is Wajahat Karim! - Google Developer Expert

    in Android - Over 8 years experience in Android - Open Source Contributor - Technical Blogs & Books Writer - Love to share my knowledge with others Follow me on Twitter @WajahatKarim Visit my website: wajahatkarim.com
  3. GDG Lahore

  4. GDG Lahore So鈥 what is new? What鈥檚 new about What鈥檚

    New in Android? People Controls Privacy
  5. GDG Lahore People

  6. GDG Lahore Credits: OneSignal Conversations 鈥 Dedicated section at top

    of the noti铿乧ations 鈼 Only for chat / messaging apps
  7. GDG Lahore Credits: InfoTechNews Chat Bubbles 鈥 Help users to

    keep conversations in view and accessible while multitasking 鈼 Only for chat / messaging apps 鈼 Created with Noti铿乧ations API 鈼 Better than SYSTEM_ALERT_WINDOW permission https://wajahatkarim.com/2020/04/what-happened-to-chat-bubbles/
  8. GDG Lahore Credits: Android Central Auto铿乴l Keyboard 鈥 Lets Auto铿乴l

    apps and Input Method Editors (IMEs) like Keyboards securely offer context-speci铿乧 entities and strings directly in an IME鈥檚 suggestion strip.
  9. GDG Lahore Controls

  10. GDG Lahore Credits: CNET Quick Controls 鈥 Triggers on long

    press Power button 鈼 Power off options 鈼 Google Play cards 鈼 Smart Home device controls
  11. GDG Lahore Credits: 9to5google Media Resumptions 鈥 Control panel-esque setup

    embedded directly at the top of your screen 鈼 Used to be clustered between noti铿乧ations 鈼 Only accessible through Developer Options for now
  12. GDG Lahore Credits: MashTips Share Menu 鈥 Pin Apps in

    Share Menu 鈼 Allows faster sharing
  13. GDG Lahore 鈥 Scheduling dark mode 鈼 All time dark

    or light 鈼 Switch between dark / light at speci铿乧 times Credits: MashTips Improved Dark Mode
  14. GDG Lahore 鈥 Picture-in-Picture displays can be resized 鈼 Such

    as Google Maps navigation 鈼 YouTube videos 鈼 Video Calls Credits: 9to5google Resizable Picture-in-Picture
  15. GDG Lahore Credits: 9to5google Screen Recorder 鈥 Native screen recording

    鈼 Quick settings tile 鈼 No more third parties
  16. GDG Lahore Privacy

  17. GDG Lahore Credits: VentureBeat Permissions 鈥 One-time permissions 鈼 lets

    users give an app access to the device microphone, camera, or location, just that one time 鈥 Permissions auto-reset 鈼 Android 11 will 鈥渁uto-reset鈥 all of the runtime permissions of the app if its not used for a while (e.g. 3 months) 鈥 Background location 鈼 Developers will need to get approval to access background location in their app to prevent misuse
  18. GDG Lahore Developers

  19. GDG Lahore Window Insets 鈥 More information about the multiple

    types of content being displayed 鈼 Status, navigation, IME, ...
  20. GDG Lahore WindowInsets // get WindowInsets object from listener view.setOnApplyWindowInsetsListener

    { view, insets -> // See if the IME is visible val imeVisible = insets.isVisible((WindowInsets.Type.ime())) if (imeVisible) { val imeInsets = insets.getInsets(WindowInsets.Type.ime()) // ... } }
  21. GDG Lahore IME Animations 鈥 Synchronize keyboard animations with app

    content changes 鈼 Listen for changes 鈻 AND/OR 鈼 Drive keyboard animation directly
  22. GDG Lahore IME Animations

  23. GDG Lahore Data Access Auditing 鈥 Listen for when user-permission-required

    data is accessed 鈥 Great for large apps or use of external libraries
  24. GDG Lahore 鈥 Callbacks invoked when user-permission-required data is accessed

    Data Access Auditing
  25. GDG Lahore Data Access Auditing val appOpsCallback = object :

    AppOpsManager.OnOpNotedCallback() { override fun onNoted(syncNotedAppOp: SyncNotedAppOp) { ... } override fun onSelfNoted(syncNotedAppOp: SyncNotedAppOp) { ... } override fun onAsyncNoted(asyncNotedAppOp: AsyncNotedAppOp) { ... } } val appOpsManager = getSystemService(AppOpsManager::class.java) as AppOpsManager appOpsManager.setOnOpNotedCallback(mainExecutor, appOpsCallback)
  26. GDG Lahore One-Time Permissions

  27. GDG Lahore 鈥 More restrictive in Android 11 鈥 First,

    request foreground permission 鈥 Then request background permission 鈥 Takes user to Settings Background Location
  28. GDG Lahore 鈥 Android 10 required manifest attribute for Location

    鈥 Android 11 adds 鈼 Camera 鈼 Microphone Foreground Services
  29. GDG Lahore Foreground Service Type <manifest> ... <service ... android:foregroundServiceType="camera|microphone"

    /> ... </manifest>
  30. GDG Lahore Developer Goodies

  31. GDG Lahore Wi-Fi Debugging Because there are never enough USB

  32. GDG Lahore Wi-Fi Debugging Because there are never enough USB

  33. GDG Lahore Crash Reasons Reporting 鈥 API to query why

    your app crashed 鈼 Upload reports
  34. GDG Lahore Crash Reasons Querying // Returns List of ApplicationExitInfo

    val reasonsList = activityManager.getHistoricalProcessExitReasons( packageName, pid /* 0 for all matches */, max /* 0 for all */) for (info in reasonsList) { // Log/store/upload info.reason // REASON_LOW_MEMORY, REASON_CRASH, REASON_ANR, etc. }
  35. GDG Lahore ADB Incremental 鈥 Faster installs via command-line 鈥

    For huge APKs (think: games) 鈥 Up to 10x faster
  36. GDG Lahore ADB Incremental // First: sign APK, create APK

    Signature Scheme v4 file // Then, run ADB incremental $ adb install --incremental
  37. GDG Lahore Behavior Changes 鈥 Most changes limited to targetSdk

    R 鈥 Test changes with behavior toggles 鈼 Command-line 鈼 New Developer Options panel
  38. GDG Lahore Toggling Behavior Changes // adb shell am compat

    (enable|disable) (CHANGE_ID|CHANGE_NAME) \ PACKAGE_NAME $ adb shell am compat disable DEFAULT_SCOPED_STORAGE \ com.android.samples.android11playground
  39. GDG Lahore But Wait, There鈥檚 More! https://android-developers.googleblog.com/2020/06/unwrapping-android-11-beta-plus-more.html #11WeeksOfAndroid

  40. Thank you! @WajahatKarim wajahatkarim.com youtube.com/c/wajahatkarim3