CursorAdapter and AsyncListUtil are discouraged. Use Paging
instead with a neat, graceful offline use-case
handling trick.
Don’t do manual bitmap management. Use Glide, Picasso, or Lottie instead.
Between TextureView and SurfaceView, use SurfaceView.
Nine patches are discouraged. Use Vector Drawables.
Use FusedLocationProviderClient
for fetching the device location. Wi-Fi access triangulation is coming to Android P. FusedLocationProvider will eventually add support for that for indoor location tracking.
ANR/crash rate reduces engagement - use StrictMode
to catch them early
Avoid IPC on the main thread, StrictMode won’t catch the violation, and you would never know what’s happening on the other side of the IPC call which can block the main thread
If BroadcastReceiver#onReceive is going to take more than 10 seconds, then call goAsync
for background processing and call PendingResult#onFinish() once that’s finished
WakeLocks - avoid using them. All except PARTIAL_WAKE_LOCK are deprecated with Android P.
Only framework spans can be parceled, don’t mix custom spans with framework spans since only the frameworks will be part of the copied text
After ~250 spans or more, SpannableStringBuilder ends up being more performant than SpannableString since the former internally uses trees.
Metrics affecting spans cause measure-layout-draw calls, while appearance affecting spans cause layout-draw calls, therefore, the former is more expensive.
Text measurement takes a lot of time on the UI thread, consider creating PrecomputedText
on the background thread.
android:autoLink = true works via RegEx and has bad performance. Consider using Linkify
on the background thread. Android P also supports deep learning-based TextClassifier
which is also invoked on the background thread.
Testing your app for background restriction - adb shell apps set <package name> RUN_ANY_IN_BACKGROUND ignore # applies background restriction (change “ignore” to “allow” to remove restriction)
Google Tez uses Ultrasound for pairing and sending money to the nearby receiver
Files Go - Folder-based hierarchy won’t work for users who have never had a PC before. Therefore, shows photos based on associations like “WhatsApp Images” or “Camera”. Supports P2P file sharing for fast transfers.