קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
Gemini ב-Android Studio מצויד באופן ייחודי כדי לעזור לכם להפוך את החזון שלכם לגבי ממשק המשתמש של אפליקציית Android למציאות, באמצעות Jetpack Compose ובהתאם לשיטות המומלצות של Android.
בדף הזה מתוארים השלבים הכלליים ליצירת ממשק משתמש לאפליקציה באמצעות Gemini. למידע נוסף על צירוף תמונה ורעיונות נוספים לשימוש בתכונה, אפשר לעיין במאמר צירוף תמונה לשאילתה.
כדי ליצור ממשק משתמש באמצעות Gemini, פועלים לפי השלבים הכלליים הבאים:
יוצרים מוקאפ של ממשק המשתמש של האפליקציה הרצויה. מומלץ להשתמש בפריים או בעיצוב בסיסי. אפשר לייצא PNG מכלי עיצוב או אפילו להשתמש בתמונה מצוירת.
כדי לצרף את התמונה לשאילתה, לוחצים על צירוף קובץ תמונה.
בשדה הצ'אט, מבקשים מ-Gemini ליצור את קוד ממשק המשתמש, לדוגמה: "תצור קוד Jetpack Compose לתמונה שסיפקתי". כששולחים את השאילתה ואת התמונה, Gemini מציע קוד ליצירת ממשק המשתמש המוצע. בדרך כלל, Gemini מספק גם את הקוד של תצוגה מקדימה של Compose, כך שאחרי הייבוא לפרויקט אפשר לראות במהירות את ממשק המשתמש. אם זה לא קורה, אפשר לבקש מ-Gemini ליצור תצוגות מקדימות של Compose.
אחרי שמייבאים את הקוד ורואים את התצוגה המקדימה של Compose בחלונית התצוגה המקדימה, אפשר לשפר את ממשק המשתמש על ידי לחיצה ישירות על התצוגה המקדימה ובקשה מ-Gemini לשנות אותה.
דוגמאות התוכן והקוד שבדף הזה כפופות לרישיונות המפורטים בקטע רישיון לתוכן. Java ו-OpenJDK הם סימנים מסחריים או סימנים מסחריים רשומים של חברת Oracle ו/או של השותפים העצמאיים שלה.
עדכון אחרון: 2025-07-31 (שעון UTC).
[null,null,["עדכון אחרון: 2025-07-31 (שעון UTC)."],[],[],null,["# Generate UI with image attachments\n\n| **Preview:** Enable image attachment through [Studio Labs](/studio/gemini/attach-image).\n| **Note:** Image attachment is currently available in Gemini's no-cost tier.\n\nGemini in Android Studio is uniquely equipped to help you make your Android app\nUI vision a reality, using Jetpack Compose and following Android best practices.\nThis page describes the general steps to creating an app UI with Gemini. For\nmore information about image attachment and other ideas for how to use the\nfeature, see [Attach an image to your query](/studio/gemini/attach-image).\n\nTo generate a UI with Gemini, follow these general steps:\n\n1. Create a mockup of the app UI that you want. A wireframe or basic design\n works best. You can export a PNG from a design tool or even use a hand drawn\n image.\n\n2. Attach the image to your query by clicking **Attach image file**\n .\n\n3. In the chat field, ask Gemini to generate the UI code, for example \"Generate\n Jetpack Compose code for the image provided.\" When you submit the query and\n image, Gemini suggests code to create the proposed UI. Gemini usually\n provides the code for the\n [Compose preview](/develop/ui/compose/tooling/previews) too, so you can\n quickly visualize the UI once you import the into your project---if it doesn't,\n ask it to\n [generate Compose the previews](/studio/gemini/generate-compose-previews).\n\n4. Once you import the code and can see the Compose preview in the preview\n panel, you can iterate on the UI by clicking directly on the preview and\n [asking Gemini to transform it](/studio/gemini/transform-ui)."]]