General

  1. Multitasking - multi-window mode and picture-in-picture mode. This includes the ability to launch window in adjacent activity, and drag and drop between activities.
  2. Notifications - Custom quick settings tile for an activity
  3. Multi-locale - users can specify locale beyond their primary locale
  4. ScopedDirectoryAccess for the shared storage
  5. New file-level encryption mode (as opposed to block-level encryption) and the corresponding Direct Boot
  6. Java 8, Jack, and ndk support in Gradle
  7. GCC deprecated in favor of Clang

TechTalk on Image size/compression

  1. PNG - Get image down to 256-bit palette (if possible) or compress them using Zopfli. Test the difference with butteraugli
  2. Convert PNG to Vector drawable using Potrace. Vector drawable are natively supported on Android 5.0 and above. Use compat to use them on the older versions. Or generate PNG for the older versions (not recommended)
  3. WebP is another option (Note: Speaker failed to mention that WebP is natively supported only on Android).
  4. Avoid JPEGs. They are usually larger in size.

Techtalk on App size

  1. Four types of sizes - raw apk size, download size (which includes expansion files), install size (apk size + oat files + extracted .so files), and update size ( binary diff)
  2. Resources.arsc is uncompressed since it has to be memory-mapped - don’t manually compress it. Instead, eliminate the bloat in it using blamer
  3. Native libraries are uncompressed. To use them without extraction, use “android:extractNativeLibs=false” (6.0+ only)
  4. Scrape unused configs using resConfigs
  5. Analyze third-party dependencies using " gradlew app:dependencies"

Techtalk on new App library

  1. New MessagingStyle notification and NotificationCompat#areNotificationsEnabled
  2. Faster Chrome custom tabs with preloading in the background
  3. Dropping support for versions below API 9
  4. Breaking library into multiple modules (similar to how Google Play Services were broken last year)

Techtalk on fragments

  1. ChildFragment creation was a mess and Google is trying to fix that.
  2. Don’t use Fragments when a ViewGroup will suffice.
  3. New FragmentTransaction#commitNow for synchronous commits but without side-effects of executePendingTransactions.
  4. Fragments allow high-level integration since they automatically plug themselves into activity life-cycles
  5. Use Activity#onInflate to provide config key etc. to a third-party fragment.
  6. There were tons of questions related to how to deal with IllegalStateException which happens when a FragmentTransaction is committed after Activity#onSaveInstanceState has been executed. Google’s answer was “it depends on the situation”.

Techtalk on themes and styles

  1. Themes and styles are both collections of key: value pairs (or key:value-type:value triplet)
  2. Styles are used for styling a View while Theme is used for setting the theme at the Activity level
  3. Themes inherit while styles overlay

Techtalk on effectively using Android Studio

The session was filled with effective use of Android Studio. Some useful tips are listed below

  1. Multi-cursor editing using Cmd + Shift + 8
  2. Ctrl-shift- for adding bookmark, use ctrl- to jump to that line
  3. Object. to see possible auto-generated code completion options on the Object
  4. Ctrl-shift-space for smarter auto-completion
  5. Conditional breakpoints
  6. C++11 support is available (still experimental)
  7. adb shell setprop debug.checkjni 1  for JNI debugging
  8. Setting android.defaultConfig.multiDexEnabled = true in the gradle file will produce legacy multi-dex (which uses DexClassLoader) for API < 21 and modern multi-dex (ART supports loading multiple dex files natively). Incremental legacy multi-dex builds are slower than the modern. Therefore, for faster testing and debugging, add two targets, one <21 and one >= 21, and use the latter for debug builds.
  9. At least provide 4GB (Xmx4096m) for gradle to run

Android Application architecture for next one Billion users

  1. In 2000, 25% of 400M users were in the developing world. In 2016, 63% of 3B users are in the developing world.
  2. 90% of the urban population has at least 3G. 30% of rural population has at least 3G.
  3. Applications should work in the offline mode. And they should be optimized for bad networks.
  4. For the offline mode, remove the network from the user flow. Use a local persistent model, all user changes will be synced into this model. And the local model will be synced with the remote model when the network is available. Give feedback to the user on the local model change. Network feedback will always update the local model first and that will be synced to the view.
  5. Network and non-network tasks should be in different queues. So, if network tasks are pending, they should not block non-network tasks.
  6. Don’t just translate, localize the app.
  7. Text-free layouts are more global.
  8. Fetch lower quality content on 2G (and maybe re-fetch higher quality on 4G)
  9. Autoplay video only on fast networks. Google ExoPlayer automatically supports that.
  10. Rather than pre-fetching content using an AlarmManager, use JobScheduler (for API >= 21) or GCMNetworkManager (for older versions).
  11. Pre-fetching should not fill the internal storage. Warn the user before large pre-fetches.
  12. Check for the metered network and (deprecated) background data restricted setting.
  13. Search should work locally in the offline state.
  14. Auto-retry user’s state-change actions like sending messages. Or at least, show notification on the failure.
  15. Show “No Internet connected” banner
  16. Batch network requests
  17. When returning a photo URL, return its size as well, so, a good placeholder can be displayed till it is downloaded.
  18. For network-local model interaction, don’t think request-response. Think sync.
  19. For network-local model interaction, some versioning might be needed to perform the sync.

Techtalk on Recycler View

  1. ListView was not originally created for the infinite scroll social network streams. Developers started using various undefined features to make it work. That has made it even harder for Google to improve the ListView. Also, the animations are difficult with ListView.
  2. RecyclerView was created with infinite scroll streams in mind.
  3. It has a LayoutManager which decides the layout, scrolling, and bringing new items int the focus area.
  4. It has an Adapter which asks “what changed” not just “something changed”. The adapter creates the View/ViewHolder, binds an item, notifies the RecylerView, handles clicks and takes care of the recovery.
  5. RecyclerView gets the child from ChildHelper. Use AdapterHelper to synchronize calls to the Adapter.
  6. RecyclerViewPool pools unused ViewHolders (to avoid memory allocation/deallocation).
  7. ItemTouchHelper takes care of Drag and Drop.
  8. ItemDecoration is used for drawing on the RecyclerView canvas.
  9. ItemAnimator is used for animations when an item is added, removed, changed, or moved.
  10. Adapter and layout positions are not always in sync. That’s why helpers are important to perform the automatic translation.

Note: I missed a session on Espresso UI testing