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

What's New in #AndroidDev

What's New in #AndroidDev

My talk at the GDG Philippines Android 11 Meetup (https://www.youtube.com/watch?v=d_OmJ8akJWc) on June 27, 2020

Jomar Tigcal

June 27, 2020
Tweet

More Decks by Jomar Tigcal

Other Decks in Technology

Transcript

  1. What’s new in #AndroidDev
    Jomar Tigcal
    Android Developer, Trainer, Consultant

    View Slide

  2. View Slide

  3. Android 11

    View Slide

  4. Conversations
    Conversation Notifications Section
    ● Open as Bubble
    ● Create Home Screen Shortcut
    ● Change Priority

    View Slide

  5. Conversations
    val style =
    NotificationCompat.MessagingStyle(person)
    .addMessage(...).
    ...
    NotificationCompat.Builder(this, "notif")
    .setShortcutId(shortcutInfo.id)
    ...
    .build()
    val person = Person.Builder().build()
    val shortcutInfo =
    ShortcutInfoCompat.Builder(this, "sample")
    .setPerson(person)
    .setLongLived(true)
    ...
    build()
    ShortcutManagerCompat.pushDynamicShort
    cut(shortcutInfo)

    View Slide

  6. Bubbles
    Keep conversations while multitasking
    Alternative to SYSTEM_ALERT_WINDOW
    Notification API
    Developer Preview in Android 10

    View Slide

  7. Bubbles
    val bubbleMetadata =
    Notification.BubbleMetadata.Builder(shortcu
    tInfo.id)
    NotificationCompat.Builder(this, "notif")
    .setBubbleMetadata(bubbleMetadata)
    .setShortcutId(shortcutInfo.id)
    ...
    .build()
    https://d.android.com/guide/topics/ui/bubbles

    View Slide

  8. Quick Access Device Controls
    Long pressing Power button:
    ● Payment Methods
    ● Smart Home Controls
    Add your own: ControlsProviderService
    https://d.android.com/preview/features/device-control

    View Slide

  9. New Media Controls
    near Quick Settings
    Carousel for multiple apps
    Output Picker to switch output device
    Beta 1: toggle Media resumption at
    Settings -> System -> Developer options
    https://d.android.com/preview/features/media-controls

    View Slide

  10. Other UI Changes
    5G visual indicators
    Voice Access now understand screen
    content and context
    Hingle Angle API for Foldables
    DisplayCutout for curved/waterfall
    displays
    New Emojis
    and more...
    Consolidated keyboard suggestions
    Keyboard/IME Animation
    (WindowInsets)
    Screen Recorder
    App Suggestions on Home Screen
    Recents (Screenshot, Select, Share)
    New Screenshot UI
    Notification History

    View Slide

  11. Android 11
    SDK:
    Android SDK Build Tools 30
    build.gradle:
    ● compileSdkVersion 30
    ● targetSdkVersion 30
    https://developer.android.com/preview

    View Slide

  12. One-Time Permissions
    Permissions:
    ● Microphone, Camera, Location
    While in use and in foreground

    View Slide

  13. Permissions auto-reset
    Targets Android 11
    Unused for long period of time
    Auto-reset and notify
    Settings.ACTION_APPLICATION_DETAILS_SETTINGS

    View Slide

  14. Phone Permissions
    READ_PHONE_NUMBERS instead of READ_PHONE_STATE for:
    ● TelephonyManager.getLine1Number
    ● TelecomManager.getLine1Number
    android:maxSdkVersion="29" />

    View Slide

  15. Background Location
    Targets Android 11:
    Request Foreground Permission, then
    Request Background Permission
    * Educate/Explain
    * Open App Settings
    Approval for background access by 2021

    View Slide

  16. Foreground Service Types
    Targets Android 11: New Types (Camera and Microphone)

    ...
    ...
    android:foregroundServiceType="camera|microphone" />

    View Slide

  17. Package Visibility
    Target Android 11:
    Can no longer query installed apps
    must declare packages in manifest
    ● Specific package
    ● Intent Filter
    All apps: android.permission.QUERY_ALL_PACKAGES
    (Guideline soon…)

    View Slide

  18. restricted non-SDK interfaces
    non-SDK test APIs (@TestApi) now restricted by default
    greylist in Android 10 (API level 29) that are now restricted in Android 11
    greylist in Android 10 (API level 29) that were added to the Android SDK
    (whitelist) in Android 11
    https://d.android.com/distribute/best-practices/develop/restrictions-non-sdk-interfaces

    View Slide

  19. Scoped Storage
    scoped access into external storage
    Introduced in Android 10; Mandatory in Android 11
    Storage permission renamed to Files & Media
    File Path Access: requestLegacyExternalStorage true
    Bulk media edit access: createWriteRequest, createDeleteRequest,
    createTrashRequest, createFavoriteRequest
    All Files Access: MANAGE_EXTERNAL_STORAGE ,Google Play manual review

    View Slide

  20. Data Access Auditing
    Provide more transparency into how app and its dependencies are accessing
    private data
    AppOpsManager.AppOpsCollector callbacks invoked when
    user-permission-required data is accessed
    Attribute access to logical features within the app

    View Slide

  21. Developer Options > Wireless debugging
    Pair with Code
    ● Linux/Windows: adb connect ipaddress:port
    ● Mac: adb pair pairingCodeIpAddress:port
    Pair with QR: Soon in Android Studio
    Wireless Debugging

    View Slide

  22. For faster installs of large APKs
    Sign your APK with the new APK Signature Scheme v4 format
    adb install --incremental
    * Pixel 4, device launching with Android 11
    ADB Incremental

    View Slide

  23. ActivityManager.getHistoricalProcessExitReasons()
    //List
    ApplicationExitInfo.getReason()
    ● REASON_ANR
    ● REASON_CRASH
    ● REASON_DEPENDENCY_DIED
    ● REASON_LOW_MEMORY
    ● REASON_UNKNOWN
    ● ...
    Crash Reasons

    View Slide

  24. Others

    View Slide

  25. Link
    App Compatibility Changes
    System > Advanced > Developer options
    Without changing targetSdkVersion
    Debuggable app
    Toggle one or more features to focus testing
    Default Enabled Changes (all apps on 11)
    Default Disabled Changes (Experimental)
    Enabled for targetSdkVersion

    View Slide

  26. Modern Android Development
    Kotlin
    Android Jetpack
    Android Studio
    Android App Bundle
    https://developer.android.com/modern-android-development

    View Slide

  27. Android App Bundle
    Official publishing format
    Reduce app size
    Efficient release process
    Dynamic Feature
    App Signing by Google Play
    Required for new apps in 2021
    https://g.co/androidappbundle

    View Slide

  28. Kotlin
    ● 70% of top 1k Android apps
    ● 60% of Pro Android Developers
    ● 55 Google apps
    ● Coroutines Officially
    Recommended
    ● @RecentlyNullable,
    @RecentlyNonNull to @Nullable
    and @NonNull
    ● New @RecentlyNullable,
    @RecentlyNonNull
    ● Kotlin-first libraries
    https://developer.android.com/kotlin

    View Slide

  29. Jetpack
    New Android Jetpack Libraries:
    ● Hilt: dependency injection (DI) library
    ● App Startup: initialize components at application startup
    ● Paging 3: load and display data incrementally
    + Updates to existing libraries
    https://developer.android.com/jetpack

    View Slide

  30. Jetpack Compose
    Android’s modern toolkit for building native UI
    Kotlin-based
    Reactive
    Developer Preview
    https://developer.android.com/jetpack/compose

    View Slide

  31. What’s New in Android Studio
    Android Studio 4.0 Stable
    Android Studio 4.1 Beta
    Android Studio 4.2 Canary

    View Slide

  32. Android Studio 4.0 Stable
    Motion Editor
    Live Layout Inspector
    Layout Validation
    Build Analyzer
    Java 8 library desugaring in D8 and
    R8
    Dynamic Feature Dependency
    Support for Kotlin DSL script files
    CPU Profiler upgrades
    R8 Rules Editing
    Kotlin Android live templates

    View Slide

  33. Android Studio 4.1 Beta
    Database Inspector
    Android Emulator in Android Studio
    Material Design Components
    Dagger Navigation support
    Native Memory Profiler
    Faster Apply Changes

    View Slide

  34. Android Studio 4.2 Canary
    Wireless ADB Debugging with Android 11
    Jetpack Compose
    ConstraintLayout Visualization
    Parallel Instrumentation testing
    Test Failure Retention

    View Slide

  35. New Google Play Console (Beta)
    ● Google Material Design, Responsive
    ● New Navigation grouping:
    Release, Grow, Quality, Monetize
    ● Policy Section: Policy Status, App Content
    ● Rolling out Soon: Inbox
    ● User management and Permissions
    https://play.google.com/console

    View Slide

  36. Google Play Console (Beta): Release
    ● Internal Testing
    ● Public Testing (Closed/Open)
    ● Pre-launch Report
    ● Launch (Production/Pre-registration)
    ● Device Catalog
    ● App bundle explorer
    ● App Signing
    ● Advanced Settings

    View Slide

  37. Google Play Console (Beta): Quality
    ● Android Vitals
    ● User feedback -> Ratings and reviews

    View Slide

  38. Google Play Console (Beta): Grow
    ● Acquisition analysis page
    ● Store listing conversion analysis page
    ● Simplified store listing page
    ● Store listing experiments
    ● New store settings page
    (category, contact, external marketing)
    ● Translation services for localization

    View Slide

  39. 11 Weeks of Android
    https://goo.gle/11-Weeks-Android

    View Slide

  40. Week 1: People & Identity
    ● Blog Post:
    https://android-developers.googleblo
    g.com/2020/06/11-weeks-of-android-
    people-identity.html
    ● Videos:
    https://goo.gle/people-identity
    ● Pathway:
    https://d.android.com/courses/pathw
    ays/android-week1-people-identity

    View Slide

  41. Week 2: Machine Learning
    TensorFlow Lite, TF Hub, MLKit
    ● Blog Post: https://goo.gle/MLWrap
    ● Videos: https://goo.gle/ml-11weeks
    ● Pathway: https://goo.gle/MLPath

    View Slide

  42. Resources
    ● Android 11 Beta Launch: https://developer.android.com/android11
    ● Android 11 Preview: https://developer.android.com/preview
    ● Android 11 Videos: https://goo.gle/android11
    ● 11 Weeks of Android: https://goo.gle/11-Weeks-Android
    ● 11 Weeks of Android Videos: https://goo.gle/android-11weeks
    ● 11 Weeks of Android Pathways: https://goo.gle/3dwqDGy
    ● Android 11 Meetups: https://d.android.com/android11/meetups

    View Slide

  43. Questions?
    ?

    View Slide

  44. Thank you!
    Build something awesome!
    Provide feedback:
    talkback.tigcal.com
    https://www.tigcal.com
    [email protected]
    @jomartigcal
    medium.com/@jomartigcal

    View Slide

  45. What’s new in #AndroidDev
    Jomar Tigcal
    Android Developer, Trainer, Consultant

    View Slide