• AgroStar India

A Journey to 5 Million Downloads

The AgroStar app recently reached this milestone. Here is the story starting from the first line of code till today.


Early days & the challenges

Before joining AgroStar, I worked on a photo-sharing app with a few hundred users and seeing every new user onboard would bring a smile to my face. When I joined AgroStar, I knew my target audience would be a lot bigger. But what interested me was our users, i.e. the farmers, who needed technical help the most. With the AgroStar app, we can assist farmers in every stage of their crop life cycle, working on our motto of 'Helping farmers win'.

We started developing the app in 2016. Back then, most android phones were very basic with limited memory. Therefore our biggest challenge was to reduce the app size as much as possible. Smaller size implied it occupied less space on the phone, used fewer bytes of data, and thus had a lower chance of being uninstalled. We could pack our entire app in 4 MB, which was like magic for our stakeholders. Things like ProGuard, redex, and font icons helped us achieve this. Ours was the smallest app in the category, and we were proud of it. Today, five years later, phones have much bigger storage, yet we continue to keep our app size small (still less than 10 MB) without sacrificing usability or features.

To make sure our app is accessible to as many farmers as possible, we have kept the minimum SDK support of our app as Android 4.4 (Kitkat), which covers 99.4% of devices in use today. It takes some additional development and testing effort, but the fact that we can serve farmers using even a KitKat device makes it worthwhile.



Features Added Over Time

We have built many features over time. The app initially consisted of a crop section via which a farmer could look at the specific sub-section, i.e. Seeds, Crop Protection, Crop Nutrition, or Hardware, and find the information they needed for their issue. They could then buy any products from our app, and we would deliver them to their doorstep.

We then added Tip of the Day and Krishi Gyaan articles, which were an instant hit. As of today, we publish 100–150 articles every day. Next, we launched the Mandi feature, which didn't turn out as expected. Our goal was to provide nearby Mandi's information to the farmer. Though we were successful in doing that, the inaccuracy of the data we found made us discontinue the feature.

We then launched the Krishi Charcha feature, which lets users post their queries directly onto the app so that our Agri experts or other fellow farmers could help them. This feature was an even bigger hit. Within a few months of its launch, we could see almost a thousand posts created in a week. This feature is still one of the most used features in the app today: farmers make over a thousand posts every day. Another noteworthy thing about this feature was we had built the initial feature within ten days as our COO Sitanshu had given us the challenge, and we were successful in doing so.

Then we added the weather feature, which turned out to be an essential one for a farmer. We have revamped this feature the most (5–6 times) to give the farmer the best experience possible. The current version is short and precise. It notifies the users (especially during the rainy season) of any alerts related to weather for their crops. We worked with OpenWeatherMap, The Weather Company, and AccuWeather to provide the most accurate weather-related information possible. Our initial e-commerce flow was pretty simple. A farmer could request help for a particular product or issue via the app. Our customer service representative would call them to resolve their query, and if the farmer would like, they could place the order for the product(s) on the same call.

But we wanted to provide instant gratification to the farmer, so later, we removed the need for a call and let the farmer place the order directly via the app. We have even integrated the Razorpay payment gateway to speed up the process even further. We are working on increasing the user's content consumption by providing content in the form of videos. Our plan in the future is to personalize the scope even further to provide the most relevant information to the user when they need it.



The Million Milestone

Right around the beginning of 2019, I knew we would be reaching a million downloads soon. I used to check the google play console every few days to check if we did. I still remember checking the console on Friday evening, and from the rate of increase, I estimated we would hit the milestone in a day or two. And on Saturday evening, it did happen. I kept refreshing the page, and finally, it showed a million downloads! I was super happy and immediately grabbed a screenshot and sent it to the office group. Everyone was delighted, and we had a blast next week with the whole office celebrating. It took us three years to get the first million downloads, and the subsequent 4 million downloads came in around 1.5 years.

AgStars celebrating the 5M milestone

Technical Details

The initial app was written in Java using MVP architecture pattern, focusing on keeping the app size small. MVP was one of the most widely used architecture patterns in Android back then, and its simplicity allowed us to learn to write test cases. We wrote both unit tests as well as instrumentation tests. There were times when we would write presenter tests just to see the magic number of 100% code coverage for the presenter and show it off to one another 😀.

Over time we have moved to Kotlin from Java and from MVP to MVVM architecture. The app now consists of both Java as well as Kotlin code. It follows a mix of MVP and MVVM architecture. Any new features we write (or old features we work on) are being written in Kotlin using MVVM (mostly, but sometimes MVP when the use-case is easy) architecture. Kotlin helped us reduce our LOC (Lines of Code) by 10–20%, and MVVM helped us reduce the dependency between the view and the business logic. We are also experimenting with coroutines and plan to use them a lot in the coming days.

One of the biggest pain points of Android development is waiting for the app to build after you have made changes. We have also invested our time here and have optimized our build times down to half of what they used to (From 7–8 mins to 3–4 mins, and we plan to bring it down even further). We have also created CI/CD using the slack bot for our testers which works with Jenkins, AWS lambda functions, and App Center to generate builds for testers using a simple slack command, thereby saving a lot of developers as well as testers time. We have also created a slack bot that runs our unit tests every night.

Another cool thing that we do is A/B experimentation. We release almost all the new features as A/B experiments. We make them available to everyone only if we get the expected results for that feature. We achieve this using Firebase Remote Config and configurations at our backend. We use many other firebase products like FCM, Crashlytics, Firebase Performance, Firebase Storage, etc.



It has been a fantastic journey so far, filled with a lot of learning, fun, and fulfilment. Getting to build an app from the very beginning and to see it reach 5 million installs has been amazing, and I am looking forward to many such milestones ahead with the AgroStar app.



Written by:

Sanket Vetkoli