Realtor.com is a leading online real estate destination operated by News Corp subsidiary Move, Inc. It provides a platform for finding properties to buy or rent through location based searches. Realtor.com attracts nearly 60 million unique visitors each month to its desktop and mobile platforms. Property search is increasingly important for their audience through their home shopping experience, or while on the go driving through a desired neighborhood. Mobile is the fastest growing segment of users for realtor.com.
What they did
Realtor.com enabled Android Instant Apps support by modularizing its 12 MB app into instant app modules; each below 4MB in size. The team monitored the size limit with the APK analyzer, and obtained the method count for various third party modules from www.methodscount.com.
They partially reduced the size using Proguard code and resource shrinking. Additionally, they were able to make further reductions by consolidating multiple third party analytics SDKs, and replacing other third party SDKs with smaller in-house modules. With a modular design effort already underway, some of the work required for instant apps had already begun, however, the 64K dex limit was still an issue.
The team managed to reduce some of the methods by encapsulating each tracking SDK into its own library project so that each library could be individually registered with the tracking manager module. This tracking manager allowed the instant app to include a subset of tracking libraries while including the full set in the installed app.
A callback interface was used for the instant app module which could be connected to other functionality available just for the installed app, such as logging in or saving a listing, and ignored for the instant app. Additionally, they used Dagger dependency injection to simplify passing of singleton modules in the refactored instant app codebase. However, it was important for the team to approach this convenience technique cautiously to avoid memory leaks which are also possible when using static singleton classes.
After the initial release, the instant app APK size increased substantially beyond the 4MB limit due to adding additional features such as Cast v3. They discovered this issue during regression testing for a follow-up release which occurred when the Play Console blocked deployment to production. To prevent this issue in the future, the team implemented a size check into the CI Pipeline autobuild. The check builds the release variant (since debug will be larger), and extracts the APK from the ZIP build artifact before checking its size (the size limit applies to the pre-zipped size); any commits failing this check will be blocked. The quality engineering team also uses the pre-release deployment track rather than development, as the development track has a higher size limit.
Since launching the instant app in May 2017, Realtor.com has increased their key conversion metrics, and has doubled the number of leads per property listing details pageview.
Laurie Kahn, realtor.com's Principal Product Manager, responsible for driving the instant apps implementation, said that: "I see Instant Apps as the future of how apps will be built. It makes it easy for a user to have a great app experience without the extra step of installing the app from the Play Store. We are already seeing great success with our instant app."
Learn more about realtor.com's experience with instant apps.
As of May 2017, Android Instant Apps is open to all developers. Get started with instant apps.