จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
โฆษณา
ไลบรารีรหัสโฆษณาจะกำหนดอินเทอร์เฟซเพื่อโต้ตอบกับผู้ให้บริการโฆษณาระดับระบบในอุปกรณ์ที่ใช้แอปของคุณ อินเทอร์เฟซนี้ช่วยให้แอปได้รับค่ารหัสโฆษณาที่สอดคล้องกัน
อัปเดตล่าสุด |
รุ่นที่เสถียร |
รุ่นที่อาจได้รับการเผยแพร่ |
รุ่นเบต้า |
เวอร์ชันอัลฟ่า |
8 มีนาคม 2023 |
- |
- |
- |
1.0.0-alpha05 |
การประกาศทรัพยากร Dependency
หากต้องการเพิ่มการพึ่งพา Google Ads คุณต้องเพิ่มที่เก็บ Google Maven ลงในโปรเจ็กต์ อ่านข้อมูลเพิ่มเติมในที่เก็บ Maven ของ Google
เพิ่มการอ้างอิงสำหรับอาร์ติแฟกต์ที่คุณต้องการในไฟล์ build.gradle
สำหรับแอปหรือโมดูล
ดึงดูด
dependencies {
implementation 'androidx.ads:ads-identifier:1.0.0-alpha05'
// Optional - add if you're using Guava to handle
// return values of type ListenableFuture.
implementation 'com.google.guava:guava:28.0-android'
}
Kotlin
dependencies {
implementation("androidx.ads:ads-identifier:1.0.0-alpha05")
// Optional - add if you're using Guava to handle
// return values of type ListenableFuture.
implementation("com.google.guava:guava:28.0-android")
}
ดูข้อมูลเพิ่มเติมเกี่ยวกับการพึ่งพาได้ที่เพิ่มการพึ่งพิงบิวด์
ความคิดเห็น
ความคิดเห็นของคุณช่วยปรับปรุง Jetpack ได้ โปรดแจ้งให้เราทราบหากพบปัญหาใหม่หรือมีแนวคิดในการปรับปรุงคลังนี้ โปรดดูปัญหาที่มีอยู่ในคลังนี้ก่อนสร้างปัญหาใหม่ คุณสามารถเพิ่มการโหวตให้กับปัญหาที่มีอยู่ได้โดยคลิกปุ่มดาว
สร้างปัญหาใหม่
ดูข้อมูลเพิ่มเติมได้ที่เอกสารประกอบของเครื่องมือติดตามปัญหา
เวอร์ชัน 1.0.0
เวอร์ชัน 1.0.0-alpha05
8 มีนาคม 2023
androidx.ads:ads-identifier:1.0.0-alpha05
, androidx.ads:ads-identifier-common:1.0.0-alpha05
และ androidx.ads:ads-identifier-provider:1.0.0-alpha05
เผยแพร่แล้ว เวอร์ชัน 1.0.0-alpha05 มีการคอมมิตเหล่านี้
การเปลี่ยนแปลง API
เวอร์ชัน 1.0.0-alpha04
22 มกราคม 2020
androidx.ads:ads-identifier:1.0.0-alpha04
, androidx.ads:ads-identifier-common:1.0.0-alpha04
และ androidx.ads:ads-identifier-provider:1.0.0-alpha04
เผยแพร่แล้ว เวอร์ชัน 1.0.0-alpha04 มีการคอมมิตเหล่านี้
ฟีเจอร์ใหม่
การเปลี่ยนแปลง API
- ตอนนี้
AdvertisingIdInfo.getId()
จะแสดงรหัสโฆษณาจาก AdvertisingIdProvider
โดยตรง ดังนั้นรหัสจึงอยู่ในรูปแบบใดก็ได้
เวอร์ชัน 1.0.0-alpha03
20 พฤศจิกายน 2019
androidx.ads:ads-identifier:1.0.0-alpha03
และ androidx.ads:ads-identifier-common:1.0.0-alpha03
เผยแพร่แล้ว เวอร์ชัน 1.0.0-alpha03 มีการคอมมิตเหล่านี้
แก้ไขข้อบกพร่อง
- นำการพึ่งพาภาษาโปรแกรม Java 8 ออก ตอนนี้ไลบรารีนี้กำหนดเป้าหมายเป็นภาษาโปรแกรม Java 7 แล้ว
เวอร์ชัน 1.0.0-alpha02
18 กันยายน 2019
androidx.ads:ads-identifier:1.0.0-alpha02
และ androidx.ads:ads-identifier-common:1.0.0-alpha02
เผยแพร่แล้ว เวอร์ชัน 1.0.0-alpha02 มีการคอมมิตเหล่านี้
การเปลี่ยนแปลง API
- เปลี่ยนประเภทผลลัพธ์ของ
AdvertisingIdUtils.getAdvertisingIdProviderServices()
จาก List<ResolveInfo>
เป็น List<ServiceInfo>
แก้ไขข้อบกพร่อง
- เปลี่ยนข้อความ
AdvertisingIdNotAvailableException
ให้อ่านได้ถูกต้องมากขึ้นเป็น "ไม่มีผู้ให้บริการรหัสโฆษณา AndroidX ที่เข้ากันได้"
เวอร์ชัน 1.0.0-alpha01
7 สิงหาคม 2019
androidx.ads:ads-identifier:1.0.0-alpha01
,
androidx.ads:ads-identifier-common:1.0.0-alpha01
และ
androidx.ads:ads-identifier-provider:1.0.0-alpha01
เผยแพร่แล้ว ดูการคอมมิตที่รวมอยู่ในเวอร์ชันนี้ได้ที่นี่
ตัวอย่างเนื้อหาและโค้ดในหน้าเว็บนี้ขึ้นอยู่กับใบอนุญาตที่อธิบายไว้ในใบอนุญาตการใช้เนื้อหา Java และ OpenJDK เป็นเครื่องหมายการค้าหรือเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-27 UTC
[[["เข้าใจง่าย","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-27 UTC"],[],[],null,["# Ads\n===\n\n[User Guide](/training/articles/ad-id) \nAPI Reference \n[androidx.ads.identifier](/reference/androidx/ads/identifier/package-summary) \n[androidx.ads.identifier.provider](/reference/androidx/ads/identifier/provider/package-summary) \nThe Advertising ID library defines an interface to interact with system-level ad providers across the devices running your app. This interface allows your app to receive consistent advertising ID values. \n\n| Latest Update | Stable Release | Release Candidate | Beta Release | Alpha Release |\n|---------------|----------------|-------------------|--------------|---------------------------------------------------------------|\n| March 8, 2023 | - | - | - | [1.0.0-alpha05](/jetpack/androidx/releases/ads#1.0.0-alpha05) |\n\nDeclaring dependencies\n----------------------\n\nTo add a dependency on Ads, you must add the Google Maven repository to your\nproject. Read [Google's Maven repository](/studio/build/dependencies#google-maven)\nfor more information.\n\nAdd the dependencies for the artifacts you need in the `build.gradle` file for\nyour app or module: \n\n### Groovy\n\n```groovy\ndependencies {\n implementation 'androidx.ads:ads-identifier:1.0.0-alpha05'\n\n // Optional - add if you're using Guava to handle\n // return values of type ListenableFuture.\n implementation 'com.google.guava:guava:28.0-android'\n}\n```\n\n### Kotlin\n\n```kotlin\ndependencies {\n implementation(\"androidx.ads:ads-identifier:1.0.0-alpha05\")\n\n // Optional - add if you're using Guava to handle\n // return values of type ListenableFuture.\n implementation(\"com.google.guava:guava:28.0-android\")\n}\n```\n\nFor more information about dependencies, see [Add build dependencies](/studio/build/dependencies).\n\nFeedback\n--------\n\nYour feedback helps make Jetpack better. Let us know if you discover new issues or have\nideas for improving this library. Please take a look at the\n[existing issues](https://issuetracker.google.com/issues?q=componentid:807287%20status:open)\nin this library before you create a new one. You can add your vote to an existing issue by\nclicking the star button.\n\n[Create a new issue](https://issuetracker.google.com/issues/new?component=807287&template=1390045)\n\nSee the [Issue Tracker documentation](https://developers.google.com/issue-tracker)\nfor more information.\n\nVersion 1.0.0\n-------------\n\n### Version 1.0.0-alpha05\n\nMarch 8, 2023\n\n`androidx.ads:ads-identifier:1.0.0-alpha05`, `androidx.ads:ads-identifier-common:1.0.0-alpha05`, and `androidx.ads:ads-identifier-provider:1.0.0-alpha05` are released. [Version 1.0.0-alpha05 contains these commits.](https://android.googlesource.com/platform/frameworks/support/+log/0a3d894e8fe0217f1312fb163a89ad51bf15794e..ad9ba647b7548818fc9d4796a03a3b5510166fb3/ads)\n\n**API Changes**\n\n- Deprecated `androidx.ads:ads-identifier` \\& `androidx.ads:ads-identifier-provider`. Please migrate to the [Advertising ID API that's available as part of Google Play Services](https://developers.google.com/android/reference/com/google/android/gms/ads/identifier/AdvertisingIdClient) instead. ([I57791](https://android-review.googlesource.com/#/q/I57791965848891725f98e373d10708e1e525f334))\n\n### Version 1.0.0-alpha04\n\nJanuary 22, 2020\n\n`androidx.ads:ads-identifier:1.0.0-alpha04`, `androidx.ads:ads-identifier-common:1.0.0-alpha04`, and `androidx.ads:ads-identifier-provider:1.0.0-alpha04` are released. [Version 1.0.0-alpha04 contains these commits](https://android.googlesource.com/platform/frameworks/support/+log/73974afa0b122e423606439e6d8e249da523534e..0a3d894e8fe0217f1312fb163a89ad51bf15794e/ads).\n\n**New features**\n\n- Performance improvements.\n\n**API changes**\n\n- `AdvertisingIdInfo.getId()` now returns the Advertising ID from `AdvertisingIdProvider` directly, so the ID could be any format now.\n\n### Version 1.0.0-alpha03\n\nNovember 20, 2019\n\n`androidx.ads:ads-identifier:1.0.0-alpha03` and `androidx.ads:ads-identifier-common:1.0.0-alpha03` are released. [Version 1.0.0-alpha03 contains these commits](https://android.googlesource.com/platform/frameworks/support/+log/561afade39b67853e2b54301e6b0cd16d19ce0a7..73974afa0b122e423606439e6d8e249da523534e/ads).\n\n**Bug fixes**\n\n- Removed dependency on the Java 8 programming language. This library now targets the Java 7 programming language.\n\n### Version 1.0.0-alpha02\n\nSeptember 18, 2019\n\n`androidx.ads:ads-identifier:1.0.0-alpha02` and `androidx.ads:ads-identifier-common:1.0.0-alpha02` are released. [Version 1.0.0-alpha02 contains these commits](https://android.googlesource.com/platform/frameworks/support/+log/886c5f552be88f0d404fbae205244e074a75bb03..561afade39b67853e2b54301e6b0cd16d19ce0a7/ads).\n\n**API changes**\n\n- Changed the return type of `AdvertisingIdUtils.getAdvertisingIdProviderServices()` from `List\u003cResolveInfo\u003e` to `List\u003cServiceInfo\u003e`\n\n**Bug fixes**\n\n- Changed the `AdvertisingIdNotAvailableException` message to more accurately read \"No compatible AndroidX Advertising ID Provider available.\"\n\n### Version 1.0.0-alpha01\n\nAugust 7, 2019\n\n`androidx.ads:ads-identifier:1.0.0-alpha01`,\n`androidx.ads:ads-identifier-common:1.0.0-alpha01`, and\n`androidx.ads:ads-identifier-provider:1.0.0-alpha01` are released. The commits\nincluded in this version can be found\n[here](https://android.googlesource.com/platform/frameworks/support/+log/b2b23e833fc78420c0e1212c35ff1fbf9b327eaf..886c5f552be88f0d404fbae205244e074a75bb03/ads)."]]