How to Quickly Generate Compose UI Code using Gemini

13/11/2024 — Mirzamehdi Karimov Compose UI
How to Quickly Generate Compose UI Code using Gemini

Jetpack Compose makes it easy to build UI, but writing each screen from scratch can still take time. Gemini, can help you make this process faster and easier by generating Compose code from a simple description.

Open Gemini – Use Android Studio > Gemini or go to the Gemini website (the website is often faster).

Use This Prompt – Paste the following text into Gemini:

Act as an Android app developer. For the description provided, 
use Jetpack Compose to build the screen so that the Compose Preview 
is as close to this description as possible. 
Also make sure to include imports and use Material3. 
Only give code part without any extra text or description neither at start or end, 
your response should contain only code without any explanation.
Description: "YOUR UI SCREEN/COMPONET DESCRIPTION"

Add Your Description – Replace "YOUR UI SCREEN/COMPONENT DESCRIPTION" with what you want the UI to look like.

Or if you have screen image you can also replace "for the text provided" with "for the image provided".


Share this post.
Build Faster Android & iOS Apps

Build and Launch Faster with KAppMaker

KAppMaker is a Kotlin Multiplatform boilerplate with essential features like authentication, in-app purchases, push notifications, local storage, network and more.