Khởi chạy tối ưu hóa và tải quảng cáo (Thử nghiệm)
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.
Starting from Google Mobile Ads (GMA) SDK version 21.0.0, you can enable
optimized SDK initialization and ad loading to improve the overall
responsiveness of ads and help prevent "Application Not Responding"
(ANR) errors on your app.
This guide outlines the changes you need to make to enable these optimizations.
There are two optimization flags available: OPTIMIZE_INITIALIZATION and
OPTIMIZE_AD_LOADING. Once they're turned on, the initialization and ad
loading tasks that require extended processing time are offloaded to
background threads.
Follow the instructions below to add the corresponding <meta-data> tags in
your app's AndroidManifest.xml file and turn on the flags. Note that you can
turn on one or both options in the same app.
Optimize Google Mobile Ads SDK initialization
The best way to optimize initialization is to call
MobileAds.initialize()
on a background thread, as described in the
Get Started guide.
If you are already doing so, you don't need to enable this flag.
If you must call the method on the main thread, enabling the flag below will
move some of the initialization tasks to the background thread.
[[["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: 2024-05-30 UTC."],[[["Starting with Google Mobile Ads SDK version 21.0.0, new optimization features enhance ad responsiveness and reduce \"Application Not Responding\" errors."],["Two optimization flags, `OPTIMIZE_INITIALIZATION` and `OPTIMIZE_AD_LOADING`, offload time-consuming tasks to background threads."],["You can enable either or both flags in your app's `AndroidManifest.xml` to optimize SDK initialization and ad loading."],["The `OPTIMIZE_INITIALIZATION` flag is most effective when `MobileAds.initialize()` is called on the main thread; otherwise, background initialization is already recommended."],["The `OPTIMIZE_AD_LOADING` flag enhances ad loading for all ad formats by shifting processing to background threads."]]],[]]