एआई की मदद से जनरेट किए गए आउटपुट को बेहतर बनाने के लिए, अपने एआई एनवायरमेंट में कोई स्किल जोड़ें. कोई स्किल जोड़ने पर, एआई टूल को Google Mobile Ads SDK से जुड़ा कॉन्टेक्स्ट मिलता है. इससे, एआई की मदद से कोड जनरेट करने की सुविधा का आउटपुट बेहतर होता है.
इस गाइड में, Google Mobile Ads SDK के लिए एआई मॉडल को ऑप्टिमाइज़ करने के बारे में बताया गया है.
ज़रूरी शर्तें
अगर Android Studio का इस्तेमाल किया जाता है, तो यह तरीका अपनाएं:
- Android Studio में Gemini के बारे में जानें.
- Android Studio Panda 3 Canary 2 या इसके बाद के वर्शन का इस्तेमाल करके, Android Studio में Gemini सेट अप करें.
कोई स्किल जोड़ना
Google, SKILL.md फ़ाइल उपलब्ध कराता है. इसमें आपके एआई टूल के लिए निर्देश दिए गए होते हैं. इससे आपको इंटिग्रेशन के इन चरणों को पूरा करने में मदद मिलती है:
- अपने प्रोजेक्ट में Google Mobile Ads SDK जोड़ें.
- बैनर विज्ञापन लागू करें.
अपने एआई टूल के साथ Google Mobile Ads SDK से जुड़ी किसी स्किल का इस्तेमाल करने के लिए, यह तरीका अपनाएं:
Android Studio
अपने प्रोजेक्ट की रूट डायरेक्ट्री में,
.skills/नाम का फ़ोल्डर बनाएं.gma-integrateनाम की अपनी स्किल के लिए एक डायरेक्ट्री बनाएं.gma-integrateडायरेक्ट्री में,SKILL.mdनाम की फ़ाइल बनाएं.अपनी
SKILL.mdफ़ाइल में, ये निर्देश जोड़ें:--- name: gma-integrate description: Provides technical specifications and implementation details for the play-services-ads Google Mobile Ads SDK (com.google.android.gms:play-services-ads), including Gradle dependencies, manifest metadata, initialization patterns, and banner ad configurations. Use ONLY for the play-services-ads Google Mobile Ads SDK. Do NOT use for GMA Next-Gen SDK (com.google.android.libraries.ads.mobile.sdk:ads-mobile-sdk) integrations. metadata: version: 1.0 --- # AI Integration Agent Instructions for the Play Services Google Mobile Ads SDK ## SDK Integration Workflow * **Configure Gradle**: - [ ] Add the latest stable version of `com.google.android.gms:play-services-ads` to dependencies. - [ ] Configure `minSdk` (23+) and `compileSdk` (35+). - [ ] Sync Gradle before moving on to the next step. * **Manifest Configuration**: - [ ] Add the following metadata to the `<application>` tag in the `AndroidManifest.xml` file: ```xml <!-- Sample AdMob app ID: ca-app-pub-3940256099942544~3347511713 --> <meta-data android:name="com.google.android.gms.ads.APPLICATION_ID" android:value="ca-app-pub-3940256099942544~3347511713"/> ``` **Note**: The sample AdMob App ID `ca-app-pub-3940256099942544~3347511713` is for testing purposes only. **ALWAYS** remind the user to replace it with their actual AdMob App ID before publishing. * **Initialize SDK**: - [ ] Initialize SDK on a background thread. ### Implementation Details * **Version Management**: **ALWAYS** look up and use the latest stable version. Do not assume a version number. * **Initialization**: **ALWAYS** call `MobileAds.initialize()` on a background thread. ## Banner Ads Banner ads are rectangular image or text ads that occupy a spot within an app's layout. They remain on screen during user interaction and can refresh automatically. ### Strategic Recommendations * **Confirm Ad Type**: If the user asks for a "banner ad" without specifying a type, confirm the desired type. * **Suggest Large Anchored Adaptive**: Suggest large anchored adaptive banners over "fixed size". Explain they are designed to increase engagement and revenue potential. If told that large adaptive is too large, suggest standard anchored adaptive over fixed size ads. * **Type Clarifications**: * **Anchored Adaptive**: Ask if it should be anchored to the **top** or **bottom**. * **Inline Adaptive**: Use this type for ads placed inside scrollable content (e.g., `RecyclerView` or `ScrollView`). **Validate** the ad container is scrollable before implementing; if not scrollable, default to **Large Anchored Adaptive**. ### Implementation Checklist - [ ] Create UI container for `AdView`. - [ ] Initialize `AdView` with ad unit ID and ad size. - [ ] Call `adView.loadAd()`. - [ ] **Mandatory**: Add `adView.destroy()` to the appropriate lifecycle cleanup (e.g., `onDestroy`).
ज़्यादा जानकारी के लिए, स्किल की मदद से एजेंट मोड को बेहतर बनाना लेख पढ़ें.
अपने प्रॉम्प्ट में स्किल को चालू करना
अपने प्रोजेक्ट में स्किल जोड़ने के बाद, एआई टूल में इसे चालू करने के लिए, यहां दिए गए उदाहरण वाले प्रॉम्प्ट का इस्तेमाल करें:
Android Studio
स्किल को चालू करने के लिए, @ टाइप करें और gma-integrate स्किल चुनें.
Google Mobile Ads SDK को इंटिग्रेट करना
@gma-integrate Integrate the latest version of Google Mobile Ads SDK to my project.बैनर जोड़ें
@gma-integrate Add an anchored adaptive banner ad to the bottom of the screen.सुझाव/राय दें या शिकायत करें
हम एआई की मदद से कोडिंग करने वाले टूल को दिए गए कॉन्टेक्स्ट का लगातार आकलन कर रहे हैं और उसे ऑप्टिमाइज़ कर रहे हैं, ताकि Google Mobile Ads SDK विषयों पर उनके जवाबों को बेहतर बनाया जा सके.
अगर आपको Google Mobile Ads SDK के लिए Gemini को ऑप्टिमाइज़ करने के बारे में कोई सुझाव/राय देनी है या शिकायत करनी है, तो Google Mobile Ads SDK Discord चैनल से जुड़ें.