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

Diving into Android App Bundles

Diving into Android App Bundles

Have you ever been concerned about your app size being unnecessarily large? Or you feel guilty that you ship features that are not useful to over 50% of your users? Android App Bundles is here to help you deliver better apps while still making your code base nicer. I will like to talk to you about it.

Bcf368379f7010d91cd12d2ffa3427f8?s=128

Omolara Adejuwon

August 09, 2019
Tweet

Transcript

  1. Diving Into Android App Bundles DROIDCON KENYA 2019 AUGUST 8TH-9TH,

    2019
  2. DROIDCON KENYA 2019 AUGUST 8TH-9TH, 2019 @_larikraun Omolara Adejuwon Android

    Engineer at Kudi Inc.
  3. Storage Space Many phones have storage less than 1GB available

    space Your app + Photos +Videos + Chats + Other apps =
  4. Time Large Apps Slower downloads Frustrated Users

  5. Cost Many users live on capped data. The larger the

    app, the less willing people are to download
  6. Key Insights 1% 3MB =

  7. ANALYZING APK classes.dex classes2.dex assets/ res/ AndroidManifest.xml

  8. Screen density xxxhdpi xxhdpi xhdpi hdpi mdpi ldpi Architecture arm64

    x86 arm x86_64 Locale en xh db ja ... ...
  9. Android App Bundles

  10. Replaces the traditional monolithic apk

  11. Single artifact with all of your app's code and resources

  12. Play generates the apk optimized for specific devices. Therefore, AABs

    are not installable directly.
  13. 20% average size saving vs universal APK 11% increase in

    installs due to size savings
  14. 7.2% saved in App Size At Kudi

  15. ANALYZING AAB base/ dex/ classes.dex classes2.dex assets/ res/ manifest/ AndroidManifest.xml

  16. Dynamic Feature Modules

  17. None
  18. None
  19. None
  20. AndroidManifest.xml

  21. droidconke/ dex/ classes.dex assets/ res/ manifest/ AndroidManifest.xml base/ dex/ classes.dex

    classes2.dex assets/ res/ manifest/ AndroidManifest.xml Base Module Dynamic Feature Module - droidconke
  22. Dynamic Delivery

  23. The smaller APKs are achieved by delivering only the resources

    the specific devices need.
  24. It works with Split APKs as the underlying principle

  25. Split APKs Base APK: contains all common code and resources

    Configuration APKs: contains resources based on device’s config i.e locale, architecture, screen density Dynamic Feature APKs: contains codes that can be downloaded at a later time. This will be discussed later in the presentation. - Introduced in Lollipop
  26. Screen density xxxhdpi xxhdpi xhdpi hdpi mdpi ldpi Architecture arm64

    x86 arm x86_64 Locale en xh db ja fr ...
  27. Screen density xxhdpi xhdpi hdpi mdpi ldpi Architecture arm64 x86

    arm x86_64 Locale en xh db ja fr ... xxxhdpi
  28. Screen density xxhdpi xhdpi hdpi mdpi ldpi Architecture x86 arm

    x86_64 Locale en xh db ja fr ... arm64 xxxhdpi
  29. Screen density xxhdpi xhdpi hdpi mdpi ldpi Architecture x86 arm

    x86_64 Locale xh db ja ... fr arm64 xxxhdpi
  30. In-App Updates

  31. Play Core library feature that introduces a new request flow

    to prompt active users to update your app
  32. Works only with devices running Android 5.0 (API level 21)

    or higher,
  33. A user experience that provides background download and installation with

    graceful state monitoring. This UX is appropriate when it’s acceptable for the user to use the app while downloading the update. Flexible In-App Updates
  34. None
  35. A full screen user experience that requires the user to

    update and restart the app in order to continue using the app. Immediate In-App Updates
  36. This UX is best for cases where an update is

    critical for continued use of the app. After a user accepts an immediate update, Google Play handles the update installation and app restart. Immediate In-App Updates
  37. None
  38. None
  39. Is update available?

  40. Start the update

  41. Start the update

  42. For flexible updates, you need to handle the app installation

    yourself after the download is complete. Flexible Vs. Immediate In-App Updates For immediate updates, play handles the download and installation for you.
  43. Install the downloaded updated

  44. Conditional Delivery

  45. Let's you control which part of your app is served

    to which users
  46. You can specify conditions under which a feature would be

    delivered as part of the app installation or otherwise left out.
  47. Types of Conditions Country MinSdk Version Device Feature

  48. None
  49. On-Demand Delivery

  50. Let's you install and uninstall specific features in on-demand

  51. None
  52. AndroidManifest.xml

  53. None
  54. None
  55. None
  56. To be able to maximize all the cool features of

    Android App Bundles as explained so far, your app needs to be well modularized. Moyinoluwa Adeyemi just delivered a great talk on App Modularization: From Zero to Hero
  57. Testing Android App Bundles

  58. Unlike APKs, AABs are not installable directly because play generates

    the apk optimized for specific devices
  59. Internal App Sharing

  60. Internal App Sharing gives you a quick and easy way

    to share Android App Bundle and Apk Internally
  61. It lets you upload app bundle or APK and share

    the link with your team.
  62. No signed APK or App bundle is required for Internal

    app sharing.
  63. No Unique Version code enforcement. So multiple APK or App

    bundles can be upload independently, to the play console.
  64. You can also debug the APK or App bundles once

    they’re installed to the tester’s device by uploading Debuggable artifacts.
  65. There are APIs available for Internal App sharing so you

    can automate some of the processes
  66. None
  67. Image Credit: https://medium.com/mindorks/internal-app-sharing-in-android-f80c7751bf37

  68. A Challenge we faced at Kudi

  69. None
  70. None
  71. https://developer.android.com/studio/projects/dynamic-delivery https://developer.android.com/studio/command-line/bundletool https://events.google.com/io/schedule/?section=may-8&sid=b9eabde0-be05- 492c-bf9e-c3f772f1db7e https://codelabs.developers.google.com/codelabs/your-first-dynamic- app/index.html Useful Links

  72. Thank you for listening @_larikraun Omolara Adejuwon