Posted by Paris Hsu – Product Manager, Android Studio
We shared an exciting live demo from the Developer Keynote at Google I/O 2024 where Gemini transformed a wireframe sketch of an app’s UI into Jetpack Compose code, directly within Android Studio. While we’re still refining this feature to make sure you get a great experience inside of Android Studio, it’s built on top of foundational Gemini capabilities which you can experiment with today in Google AI Studio.
Specifically, we’ll delve into:
- Turning designs into UI code: Convert a simple image of your app’s UI into working code.
- Smart UI fixes with Gemini: Receive suggestions on how to improve or fix your UI.
- Integrating Gemini prompts in your app: Simplify complex tasks and streamline user experiences with tailored prompts.
Note: Google AI Studio offers various general-purpose Gemini models, whereas Android Studio uses a custom version of Gemini which has been specifically optimized for developer tasks. While this means that these general-purpose models may not offer the same depth of Android knowledge as Gemini in Android Studio, they provide a fun and engaging playground to experiment and gain insight into the potential of AI in Android development.
Experiment 1: Turning designs into UI code
First, to turn designs into Compose UI code: Open the chat prompt section of Google AI Studio, upload an image of your app’s UI screen (see example below) and enter the following prompt:
“Act as an Android app developer. For the image provided, use Jetpack Compose to build the screen so that the Compose Preview is as close to this image as possible. Also make sure to include imports and use Material3.”
Then, click “run” to execute your query and see the generated code. You can copy the generated output directly into a new file in Android Studio.



With this experiment, Gemini was able to infer details from the image and generate corresponding code elements. For example, the original image of the plant detail screen featured a “Care Instructions” section with an expandable icon — Gemini’s generated code included an expandable card specifically for plant care instructions, showcasing its contextual understanding and code generation capabilities.
Experiment 2: Smart UI fixes with Gemini in AI Studio
Inspired by “Circle to Search“, another fun experiment you can try is to “circle” problem areas on a screenshot, along with relevant Compose code context, and ask Gemini to suggest appropriate code fixes.
You can explore with this concept in Google AI Studio:
1. Upload Compose code and screenshot: Upload the Compose code file for a UI screen and a screenshot of its Compose Preview, with a red outline highlighting the issue—in this case, items in the Bottom Navigation Bar that should be evenly spaced.




Experiment 3: Integrating Gemini prompts in your app
Gemini can streamline experimentation and development of custom app features. Imagine you want to build a feature that gives users recipe ideas based on an image of the ingredients they have on hand. In the past, this would have involved complex tasks like hosting an image recognition library, training your own ingredient-to-recipe model, and managing the infrastructure to support it all.
Now, with Gemini, you can achieve this with a simple, tailored prompt. Let’s walk through how to add this “Cook Helper” feature into your Android app as an example:
1. Explore the Gemini prompt gallery: Discover example prompts or craft your own. We’ll use the “Cook Helper” prompt.

2. Open and experiment in Google AI Studio: Test the prompt with different images, settings, and models to ensure the model responds as expected and the prompt aligns with your goals.

3. Generate the integration code: Once you’re satisfied with the prompt’s performance, click “Get code” and select “Android (Kotlin)”. Copy the generated code snippet.

4. Integrate the Gemini API into Android Studio: Open your Android Studio project. You can either use the new Gemini API app template provided within Android Studio or follow this tutorial. Paste the copied generated prompt code into your project.
That’s it – your app now has a functioning Cook Helper feature powered by Gemini. We encourage you to experiment with different example prompts or even create your own custom prompts to enhance your Android app with powerful Gemini features.
Our approach on bringing AI to Android Studio
While these experiments are promising, it’s important to remember that large language model (LLM) technology is still evolving, and we’re learning along the way. LLMs can be non-deterministic, meaning they can sometimes produce unexpected results. That’s why we’re taking a cautious and thoughtful approach to integrating AI features into Android Studio.
Our philosophy towards AI in Android Studio is to augment the developer and ensure they remain “in the loop.” In particular, when the AI is making suggestions or writing code, we want developers to be able to carefully audit the code before checking it into production. That’s why, for example, the new Code Suggestions feature in Canary automatically brings up a diff view for developers to preview how Gemini is proposing to modify your code, rather than blindly applying the changes directly.
We want to make sure these features, like Gemini in Android Studio itself, are thoroughly tested, reliable, and truly useful to developers before we bring them into the IDE.
What’s next?
We invite you to try these experiments and share your favorite prompts and examples with us using the #AndroidGeminiEra tag on X and LinkedIn as we continue to explore this exciting frontier together. Also, make sure to follow Android Developer on LinkedIn, Medium, YouTube, or X for more updates! AI has the potential to revolutionize the way we build Android apps, and we can’t wait to see what we can create together.






amoxicillin tablets – https://combamoxi.com/ cheap amoxicillin tablets
amoxil without prescription – https://combamoxi.com/ buy generic amoxil online
order forcan online – flucoan forcan generic
fluconazole usa – https://gpdifluca.com/ diflucan 100mg price
escitalopram 20mg ca – cost escitalopram 20mg cheap escitalopram 20mg
buy generic escitalopram 10mg – buy escitalopram 10mg pill buy lexapro 20mg generic
buy cenforce generic – purchase cenforce without prescription order cenforce 50mg pill
cenforce price – https://cenforcers.com/ cenforce medication
cialis prescription assistance program – https://ciltadgn.com/ what does cialis look like
where to buy cialis in canada – buy cialis on line where to buy tadalafil in singapore
cialis how to use – what is cialis tadalafil used for cialis maximum dose
cialis super active vs regular cialis – can cialis cause high blood pressure what is cialis tadalafil used for
ranitidine for sale – site ranitidine 300mg drug
zantac 300mg over the counter – https://aranitidine.com/ brand ranitidine 150mg
viagra cheap online uk – this cheap viagra scams
where can i buy viagra in la – https://strongvpls.com/ viagra soft tabs cheap
Proof blog you be undergoing here.. It’s obdurate to find elevated quality script like yours these days. I really appreciate individuals like you! Go through care!! gabapentin 100mg pill
Thanks on putting this up. It’s well done. https://buyfastonl.com/
This is the tolerant of delivery I recoup helpful. endometritis doxycycline
With thanks. Loads of expertise! doxycycline hyclate para que sirve
This is a topic which is forthcoming to my verve… Myriad thanks! Quite where can I notice the acquaintance details for questions? https://prohnrg.com/product/cytotec-online/
Greetings! Very useful advice within this article! It’s the crumb changes which choice espy the largest changes. Thanks a lot in the direction of sharing! https://ursxdol.com/doxycycline-antibiotic/
Thanks towards putting this up. It’s well done. https://prohnrg.com/
Greetings! Utter useful recommendation within this article! It’s the crumb changes which wish make the largest changes. Thanks a lot in the direction of sharing! https://ursxdol.com/propecia-tablets-online/
Proof blog you procure here.. It’s intricate to assign elevated worth script like yours these days. I honestly appreciate individuals like you! Rent mindfulness!! this
More posts like this would force the blogosphere more useful. https://aranitidine.com/fr/ivermectine-en-france/
This is the type of enter I turn up helpful. https://ondactone.com/product/domperidone/
I’ll certainly bring back to be familiar with more. https://ondactone.com/spironolactone/
This is the type of enter I unearth helpful.
ranitidine oral
More articles like this would remedy the blogosphere richer.
https://doxycyclinege.com/pro/meloxicam/
Greetings! Jolly productive advice within this article! It’s the little changes which wish turn the largest changes. Thanks a lot for sharing! http://bbs.51pinzhi.cn/home.php?mod=space&uid=7059400
This is the kind of literature I truly appreciate. http://www.predictive-datascience.com/forum/member.php?action=profile&uid=44951
buy dapagliflozin 10mg pills – https://janozin.com/ dapagliflozin 10mg pills
dapagliflozin 10mg cheap – dapagliflozin 10 mg cost purchase forxiga for sale
buy orlistat generic – https://asacostat.com/ orlistat medication
purchase orlistat – https://asacostat.com/# buy xenical 120mg for sale
More posts like this would force the blogosphere more useful. http://www.orlandogamers.org/forum/member.php?action=profile&uid=29971
Greetings! Very productive recommendation within this article! It’s the scarcely changes which will espy the largest changes. Thanks a lot quest of sharing! https://experthax.com/forum/member.php?action=profile&uid=124826
Your article helped me a lot, is there any more related content? Thanks!
You can conserve yourself and your stock by being cautious when buying pharmaceutical online. Some pharmaceutics websites manipulate legally and put forward convenience, secretiveness, rate savings and safeguards to purchasing medicines. buy in TerbinaPharmacy https://terbinafines.com/product/imitrex.html imitrex
You can conserve yourself and your stock close being alert when buying pharmaceutical online. Some druggist’s websites operate legally and provide convenience, solitariness, cost savings and safeguards as a replacement for purchasing medicines. buy in TerbinaPharmacy https://terbinafines.com/product/doxazosin.html doxazosin
This is the description of serenity I take advantage of reading. TerbinaPharmacy
The thoroughness in this piece is noteworthy. TerbinaPharmacy
This is the gentle of literature I positively appreciate.
With thanks. Loads of expertise!
Your point of view caught my eye and was very interesting. Thanks. I have a question for you.
best online casino real money usa
emerald queen casino tacoma hours
online casinos that pay real money
best paying online casinos
iphone casino real money
online casino top
betmgmontario betmgm Ohio mgm sports app
mgm betting lines betmgm VA betmgm DC
Enjoy a variety of games for every taste. In coins crown casino, generous jackpots and a loyalty program await you. Register and win!
Awaken your inner gambler with intuitive interfaces and easy navigation. In crown coins casino log in, new players get matched deposits. Play smart and win big!
Nothing compares to the thrill of watching symbols tumble in Sweet Bonanza! Scatters sweet bonanza casino unlock a world of multiplier mayhem and huge win chains. Start your sweet adventure right now!
Indulge in the sweetest slot ever: Sweet Bonanza! Cascading sweet bonanza mobile symbols and multiplier bombs create epic win chains. Start your candy-filled journey today!
Embark on a prairie quest for unimaginable wealth. buffalo gold triggers massive free spin chains and major/minor jackpots with every sunset scatter. Play and prosper!
Unleash the untamed for tamed fortunes. buffalo slot strategy explodes with free games, wild multipliers, and progressive prizes. Spin wild!
Ready to win big without risking a dollar? chumba casino bonus free Sweeps Coins welcome offer is your ticket. Spin and redeem — it’s that simple!
chumba casino bonus — where every player gets a free shot at real prizes. Claim your Sweeps Coins welcome bonus and spin the reels now. Fun + rewards!
The house doesn’t always win — not on stake rakeback code . Massive slots jackpots, high-RTP originals, and instant crypto cashouts. Play smart. Play Stake.
Trusted by the biggest names in streaming. Loved by players who value speed and fairness. stake original games — where crypto meets real casino adrenaline.
Join DraftKings casino West Virginia Casino and level up your game. Wager $5 to unlock 500 bonus spins on Cash Eruption, with up to $1K credits covering first-day net losses. The action never stops!
Step up to DraftKings new games Casino today. Play $5, receive 500 Cash Eruption spins + up to $1,000 lossback. The ultimate online casino experience!
Kvalita, na kterou se muzete spolehnout. Cena, ktera vas potesi
koupit Cialis
Proc platit 3–5? vic? Generika na opravdovalekarna.cz
opravdovalekarna.cz
Solder together the millions delightful strapping on fanduel casino jackpot – the #1 natural money casino app in America.
Pick up your $1000 PLAY IT AGAIN gratuity and refashion every make up, hand and rotate into official cash rewards.
Fast payouts, huge jackpots, and day in activity – download FanDuel Casino now and start playing like a pro today!
Connect the millions enchanting big on fanduel casino Georgia – the #1 real coins casino app in America.
Get your $1000 TEASE IT AGAIN bonus and turn every relate, hand and roll into real banknotes rewards.
Irresponsibly payouts, gigantic jackpots, and continuous effect – download FanDuel Casino any longer and start playing like a pro today!