Lock in $30 Savings on PRO—Offer Ends Soon! ⏳

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
Tweet

More Decks by Wajahat Karim

Other Decks in Technology

Transcript

  1. 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
  2. GDG Lahore So… what is new? What’s new about What’s

    New in Android? People Controls Privacy
  3. GDG Lahore Credits: OneSignal Conversations • Dedicated section at top

    of the notifications ◦ Only for chat / messaging apps
  4. GDG Lahore Credits: InfoTechNews Chat Bubbles • Help users to

    keep conversations in view and accessible while multitasking ◦ Only for chat / messaging apps ◦ Created with Notifications API ◦ Better than SYSTEM_ALERT_WINDOW permission https://wajahatkarim.com/2020/04/what-happened-to-chat-bubbles/
  5. GDG Lahore Credits: Android Central Autofill Keyboard • Lets Autofill

    apps and Input Method Editors (IMEs) like Keyboards securely offer context-specific entities and strings directly in an IME’s suggestion strip.
  6. GDG Lahore Credits: CNET Quick Controls • Triggers on long

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

    embedded directly at the top of your screen ◦ Used to be clustered between notifications ◦ Only accessible through Developer Options for now
  8. GDG Lahore Credits: MashTips Share Menu • Pin Apps in

    Share Menu ◦ Allows faster sharing
  9. GDG Lahore • Scheduling dark mode ◦ All time dark

    or light ◦ Switch between dark / light at specific times Credits: MashTips Improved Dark Mode
  10. GDG Lahore • Picture-in-Picture displays can be resized ◦ Such

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

    ◦ Quick settings tile ◦ No more third parties
  12. 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 “auto-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
  13. GDG Lahore Window Insets • More information about the multiple

    types of content being displayed ◦ Status, navigation, IME, ...
  14. 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()) // ... } }
  15. GDG Lahore IME Animations • Synchronize keyboard animations with app

    content changes ◦ Listen for changes ▪ AND/OR ◦ Drive keyboard animation directly
  16. GDG Lahore Data Access Auditing • Listen for when user-permission-required

    data is accessed • Great for large apps or use of external libraries
  17. 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)
  18. GDG Lahore • More restrictive in Android 11 • First,

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

    • Android 11 adds ◦ Camera ◦ Microphone Foreground Services
  20. GDG Lahore Crash Reasons Reporting • API to query why

    your app crashed ◦ Upload reports
  21. 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. }
  22. GDG Lahore ADB Incremental • Faster installs via command-line •

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

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

    R • Test changes with behavior toggles ◦ Command-line ◦ New Developer Options panel
  25. 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