با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
Gemini تکمیل خودکار کد با قابلیت هوش مصنوعی را در اندروید استودیو ارائه میکند که در حین تایپ به صورت متنی خاکستری مورب ظاهر میشود. این ویژگی در زمان شما صرفه جویی می کند و به شما امکان می دهد پروژه های کدنویسی را سریعتر با پیشنهاد عملکردهای کامل تکمیل کنید. هنگامی که تکمیل کد هوش مصنوعی فعال است، Gemini ممکن است اطلاعات اضافی را از پایگاه کد شما مانند قطعات اطراف کد، انواع فایلها و سایر اطلاعات ضروری برای ارائه زمینه به LLM و ارائه پیشنهادات مرتبطتر ارسال کند.
برای استفاده از تکمیل کد هوش مصنوعی، مراحل زیر را دنبال کنید:
با انتخاب استفاده از همه ویژگیهای Gemini در تنظیمات Gemini، اشتراکگذاری زمینه را فعال کنید. تکمیل کد هوش مصنوعی زمانی کار می کند که Gemini بتواند از پایگاه کد شما به متن دسترسی داشته باشد.
یک فایل را باز کنید و شروع به تایپ کنید. پیشنهادها فقط زمانی فعال می شوند که مکان نما در انتهای یک خط یا هر جای یک خط خالی باشد.
برای پذیرش پیشنهاد، Tab و برای پاک کردن پیشنهاد، Esc را فشار دهید.
به خاطر داشته باشید که سیستم همیشه تکمیل کد ایجاد نمی کند. این امکان وجود دارد که مدل اطلاعات کافی برای ایجاد یک پاسخ با اطمینان بالا را نداشته باشد.
میتوانید در هر زمان با کلیک کردن روی نماد Gemini در پایین Studio IDE، تکمیل کد هوش مصنوعی را روشن و خاموش کنید. و روی Enable AI code completion کلیک کنید.
محتوا و نمونه کدها در این صفحه مشمول پروانههای توصیفشده در پروانه محتوا هستند. جاوا و OpenJDK علامتهای تجاری یا علامتهای تجاری ثبتشده Oracle و/یا وابستههای آن هستند.
تاریخ آخرین بهروزرسانی 2025-07-31 بهوقت ساعت هماهنگ جهانی.
[[["درک آسان","easyToUnderstand","thumb-up"],["مشکلم را برطرف کرد","solvedMyProblem","thumb-up"],["غیره","otherUp","thumb-up"]],[["اطلاعاتی که نیاز دارم وجود ندارد","missingTheInformationINeed","thumb-down"],["بیشازحد پیچیده/ مراحل بسیار زیاد","tooComplicatedTooManySteps","thumb-down"],["قدیمی","outOfDate","thumb-down"],["مشکل ترجمه","translationIssue","thumb-down"],["مشکل کد / نمونهها","samplesCodeIssue","thumb-down"],["غیره","otherDown","thumb-down"]],["تاریخ آخرین بهروزرسانی 2025-07-31 بهوقت ساعت هماهنگ جهانی."],[],[],null,["# Accelerate coding with AI code completion\n\nGemini offers AI-enabled autocompletion of code in Android Studio that appears\nas gray italicized text as you type. This feature saves you time and lets you\ncomplete coding projects faster by suggesting full functions. When AI code\ncompletion is enabled, Gemini might send additional information from your\ncodebase such as surrounding pieces of your code, file types, and other\nnecessary information to provide context to the LLM and provide more relevant\nsuggestions.\n\nTo use AI code completion, follow these steps:\n\n1. Enable context sharing by selecting **Use all Gemini features** in the [Gemini settings](/studio/gemini/configure-gemini). AI code completion only works when Gemini can access context from your codebase.\n2. Open a file and start typing. Suggestions only trigger when the cursor is at the end of a line or anywhere on a blank line.\n3. Press \u003ckbd\u003eTab\u003c/kbd\u003e to accept a suggestion and \u003ckbd\u003eEsc\u003c/kbd\u003e to clear a suggestion.\n\nKeep in mind that the system won't always generate code completions. It's\npossible that the model doesn't have enough information to generate a response\nwith high confidence.\n\nYou can toggle AI code completion on and off at any time by clicking the Gemini\nicon at the bottom of the Studio IDE\n\nand clicking **Enable AI code completion**."]]