Show the annual plan first? Or the monthly? Which should you choose? It depends. That’s why you must use A/B tests to prove or disapprove your assumptions about any changes to your app’s checkout experience. Let’s see how it’s done.
Continue ReadingFall in love ❤️ with Android Studio all over again
I still remember that day back in May of 2013. I was sitting in Moscone Center, eager to hear what Google had to announce at its annual Google I/O conference. And then it happened. Android Studio was announced. The crowd went wild. And I joined the hundreds of other conference-goers in an attempt to download the brand new app over the conference wifi.
Fast forward to today, it’s been ten years, and Android Studio continues to deliver on its promise. We are both faster and more productive as app developers due to its existence.
So in honor of its ten-year anniversary, here are ten features that will make you fall in love ❤️ with Android Studio. In no particular order…
Continue ReadingHow to fix common Android API deprecations
Each year there’s a new version of the Android SDK released. Along with the myriad of new features come deprecations. When something is deprecated, although it’s still available, it’s best to migrate to the recommended new API. With that being said here are some common deprecations I encountered in my company’s Android codebase and how to fix them.
Deprecated Menu APIs on Fragments
The Fragment APIs for providing a menu to your activity’s ActionBar
have been deprecated as they tightly couple your fragment to your activity and are not testable in isolation. The new MenuHost
and MenuProvider
APIs provide a testable, lifecycle-aware equivalent API surface that fragments should use instead.
Improved caching with Kotlin flows and the reduce function
I’ve been on a caching crusade. I’m working to reduce the load on our database by focusing on various caching solutions. In an ideal world, data that is “static” will be heavily cached; minimal database interaction required. However, that’s not the world I’m living in. Each request to our GraphQL API leads directly to a database hit. Ugh!
Apollo GraphQL offers a few caching solutions to help with this endeavor. We decided to go with the responseCachePlugin. This plugin stores cacheable data in a datastore of your choice, for us that was Redis. The key thing to keep in mind is that the data must be cacheable. Which leads us to “the problem.”
Continue Reading