Gemini AI with Android Studio

Whenever I got a chance to try and use Gemini models, the results were disappointing. The results reflected that the context was always not enough. My prompts to Gemini were mostly text based and learning oriented. However, other models like GPT, Sonnet they were able to provide relevant answers. Only when the prompts were carefully crafted with TCREI framework (Tiny Crab Rode Enormous Iguana – Task, Context, Reference, Evaluate, Iterate), I got a decent response from Gemini. Until last week, I had ChatGPT (on browser) and Github Copilot (on IDEs) as my top go-to AI assistants (not agents). I kind of not trusted the agent making code changes and preferred to Ask and do the changes myself.

Generated by gemini.google.com

Problem Statement:

Challenges in implementing:

Working with Agents:

The debugging capability of these Agents are mind-blowing. They are able to fire complex bash commands to read the logs, identify the issue, automatically try alternate approaches, re-run the commands, verify the logs again and stop this loop when it finds the success logs. That’s a lot of time saved and things get done at jet speed. The agent also helped in writing Github Actions workflow yaml files and also a pristine and neat github friendly ReadMe.md with badges.

Within 5 days, I was able to get the Android app to a decent shape and even upload to Google Playstore. I did manual testing though. I am sure testing with Agents, MCP Servers will add more value to the quality of the product.

Though most code is written by Gemini, I am still the proud owner for the few lines of code I added by hand. The agent did the heavy lifting as a developer. I was just supervising it like a manager or a product owner. The source code is available here –> https://github.com/sudhans/Image2Pdf.

Gotchas: There were a few times, the Agent was not able to refactor/write to the same file and it kept retrying. I had to force stop the task. When changes were made manually, the agent took it for granted and rolled back the manual changes – Eg. a deprecated method call was updated as per the documentation.

At times, the editing of files by the Agent could take time and if you try to type another query in the Gemini Agent chat, it could temporarily freeze the IDE till the response for the previous task is complete.

Conclusion:

Learn to work with Agents. Give better inputs to the agents via prompts. Agents can auto pick the models. Know the strengths of different models available. The Agents are here for a revolution. This also reminds me of the famous quote from the movie – iRobot

Note: cloudfare.com is down today and I got time for posting 🙂 Cloudfare took down Udemy, Kodecloud, Pluralsight, ChatGPT along with it.

Scroll to Top