AdMob trong Ứng dụng Android tức thì
Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Ứng dụng Android tức thì cho phép các ứng dụng Android chạy ngay lập tức mà không cần cài đặt. Hướng dẫn này dành cho những nhà xuất bản muốn kiếm tiền từ một Ứng dụng tức thì Android thông qua AdMob.
Điều kiện tiên quyết
- Sử dụng Android Studio 3.0 Canary 1 trở lên
- SDK phát triển ứng dụng tức thì
- Nền tảng SDK Android O
- Nhắm đến API Android cấp 14 trở lên
Nhập SDK quảng cáo trên thiết bị di động
Ứng dụng tức thì Android cần được cấu trúc thành các mô-đun có thể định địa chỉ bằng URL và có kích thước dưới 4 MB. Để đảm bảo tuân thủ hạn chế về kích thước này, bạn nên sử dụng SDK Lite quảng cáo trên thiết bị di động của Google thay vì phiên bản tiêu chuẩn.
Bạn có thể xem thêm thông tin về SDK Lite, bao gồm cả các điểm hạn chế của SDK này trong hướng dẫn về SDK Lite.
Các ứng dụng có thể nhập SDK Lite quảng cáo trên thiết bị di động của Google bằng một phần phụ thuộc gradle. Mở tệp build.gradle ở cấp ứng dụng cho ứng dụng của bạn rồi tìm mục "dependencies" (phần phụ thuộc).
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'com.google.android.gms:play-services-ads-lite:24.5.0'
...
}
Thêm dòng in đậm ở trên để hướng dẫn gradle tải phiên bản mới nhất của Mobile Ads Lite SDK. Sau khi hoàn tất, hãy lưu tệp và thực hiện đồng bộ hoá Gradle.
SDK Lite được phân phối trong Kho lưu trữ của Google, vì vậy, bạn có thể thấy thông báo của Android Studio yêu cầu bạn cài đặt SDK này. Nếu có, bạn chỉ cần đồng ý tải xuống và Android Studio sẽ lo phần còn lại.
Các bước tiếp theo
Bước tiếp theo để hiển thị quảng cáo AdMob và kiếm tiền là Khởi chạy SDK Quảng cáo trên thiết bị di động
và Chọn định dạng quảng cáo.
Tính năng dàn xếp của Google không được hỗ trợ chính thức khi kiếm tiền từ Ứng dụng Android tức thì bằng AdMob. Ứng dụng tức thì yêu cầu tất cả nội dung trên web được hiển thị phải được tải qua các kết nối bảo mật. Quảng cáo của AdMob đáp ứng yêu cầu này, nhưng quảng cáo của các mạng quảng cáo bên thứ ba thì có thể không. Do đó, bạn nên tạo một đơn vị quảng cáo mới không sử dụng tính năng dàn xếp khi kiếm tiền từ Ứng dụng Android tức thì bằng AdMob.
Trừ phi có lưu ý khác, nội dung của trang này được cấp phép theo Giấy phép ghi nhận tác giả 4.0 của Creative Commons và các mẫu mã lập trình được cấp phép theo Giấy phép Apache 2.0. Để biết thông tin chi tiết, vui lòng tham khảo Chính sách trang web của Google Developers. Java là nhãn hiệu đã đăng ký của Oracle và/hoặc các đơn vị liên kết với Oracle.
Cập nhật lần gần đây nhất: 2025-09-05 UTC.
[[["Dễ hiểu","easyToUnderstand","thumb-up"],["Giúp tôi giải quyết được vấn đề","solvedMyProblem","thumb-up"],["Khác","otherUp","thumb-up"]],[["Thiếu thông tin tôi cần","missingTheInformationINeed","thumb-down"],["Quá phức tạp/quá nhiều bước","tooComplicatedTooManySteps","thumb-down"],["Đã lỗi thời","outOfDate","thumb-down"],["Vấn đề về bản dịch","translationIssue","thumb-down"],["Vấn đề về mẫu/mã","samplesCodeIssue","thumb-down"],["Khác","otherDown","thumb-down"]],["Cập nhật lần gần đây nhất: 2025-09-05 UTC."],[[["\u003cp\u003eAndroid Instant Apps allow Android apps to run instantly without installation, and this guide focuses on monetizing them with AdMob.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers need to use Android Studio 3.0 Canary 1 or higher, Instant Apps Development SDK, Android SDK Platform O, and target Android API level 14 or higher as prerequisites.\u003c/p\u003e\n"],["\u003cp\u003eIt's recommended to integrate the Google Mobile Ads Lite SDK for optimal size management within Instant Apps, and instructions for adding it via Gradle are provided.\u003c/p\u003e\n"],["\u003cp\u003eMediation with third-party ad networks isn't officially supported in Instant Apps due to security requirements for web content.\u003c/p\u003e\n"]]],["Android Instant Apps run without installation, and this guide focuses on monetizing them with AdMob. Publishers must use Android Studio 3.0+, the Instant Apps Development SDK, and target API level 14+. Due to size constraints (under 4MB), the Google Mobile Ads Lite SDK is recommended, imported via Gradle dependency in the `build.gradle` file. Initialize the Mobile Ads SDK and choose an ad format to display ads. Google mediation is not supported in instant apps.\n"],null,["[Android Instant Apps](//developer.android.com/topic/instant-apps/)\nenables Android apps to run instantly, without requiring\ninstallation. This guide is intended for publishers who want to monetize an\nAndroid Instant App with AdMob.\n\nPrerequisites\n\n- Use Android Studio 3.0 Canary 1 or higher\n- Instant Apps Development SDK\n- Android SDK Platform O\n- Target Android API level 14 or higher\n\nImport the Mobile Ads SDK\n\nAndroid instant apps need to be structured into URL-addressable modules that\nare under 4MB in size. To help stay within this size constraint, it is\nrecommended to use the Google Mobile Ads Lite SDK over the standard version.\nMore information on the Lite SDK, including its limitations, can be found in\nthe [Lite SDK guide](/admob/android/lite-sdk).\n\nApps can import the Google Mobile Ads Lite SDK with a gradle dependency. Open\nthe app-level build.gradle file for your app, and look for a \"dependencies\"\nsection. \n\n dependencies {\n implementation fileTree(dir: 'libs', include: ['*.jar'])\n implementation 'androidx.appcompat:appcompat:1.2.0'\n implementation 'com.google.android.gms:play-services-ads-lite:24.5.0'\n ...\n }\n\nAdd the line in bold above, which instructs gradle to pull in the latest\nversion of the Mobile Ads Lite SDK. Once that's done, save the file and perform\na Gradle sync.\n\nThe Lite SDK is distributed as part of the Google Repository, so you may see a\nmessage from Android Studio asking you to install it. If so, just agree to the\ndownload, and Android Studio will take care of the rest.\n\nNext steps\n\nThe next steps to displaying AdMob ads and earning revenue is to [Initialize\nMobile Ads SDK](/admob/android/quick-start#initialize_mobile_ads)\nand to [Choose an ad format](/admob/android/quick-start#choose_an_ad_format).\n\nMediation in Instant Apps\n\nGoogle mediation is not officially supported when monetizing Android Instant\napps with AdMob. Instant apps require all web content displayed to be loaded\nover secure connections. Ads from AdMob meet this requirement, but ads from\nthird party ad networks may not. Therefore, we recommended you create a new ad\nunit that does not use mediation when monetizing an Android Instant app with\nAdMob."]]