Stay organized with collections
Save and categorize content based on your preferences.
Builder
class Builder
Summary
Public constructors
Public methods
setInterval
fun setInterval(interval: Int): PeriodicAdvertisingParameters.Builder!
Set advertising interval for periodic advertising, in 1.25ms unit. Valid values are from 80 (100ms) to 65519 (81.89875s). Value from range [interval, interval+20ms] will be picked as the actual value.
Exceptions |
java.lang.IllegalArgumentException |
If the interval is invalid. |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# PeriodicAdvertisingParameters.Builder\n\nAdded in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nBuilder\n=======\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/bluetooth/le/PeriodicAdvertisingParameters.Builder \"View this page in Java\") \n\n```\nclass Builder\n```\n\n|---|-----------------------------------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||\n| ↳ | [android.bluetooth.le.PeriodicAdvertisingParameters.Builder](#) |\n\nSummary\n-------\n\n| Public constructors ||\n|----------------------------------|---|\n| [Builder](#Builder())`()` \u003cbr /\u003e |\n\n| Public methods ||\n|--------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [PeriodicAdvertisingParameters](/reference/kotlin/android/bluetooth/le/PeriodicAdvertisingParameters)! | [build](#build())`()` Build the [AdvertisingSetParameters](/reference/kotlin/android/bluetooth/le/AdvertisingSetParameters) object. |\n| [PeriodicAdvertisingParameters.Builder](#)! | [setIncludeTxPower](#setIncludeTxPower(kotlin.Boolean))`(`includeTxPower:` `[Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)`)` Whether the transmission power level should be included in the periodic packet. |\n| [PeriodicAdvertisingParameters.Builder](#)! | [setInterval](#setInterval(kotlin.Int))`(`interval:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Set advertising interval for periodic advertising, in 1. |\n\nPublic constructors\n-------------------\n\n### Builder\n\nAdded in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nBuilder()\n```\n\nPublic methods\n--------------\n\n### build\n\nAdded in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun build(): PeriodicAdvertisingParameters!\n```\n\nBuild the [AdvertisingSetParameters](/reference/kotlin/android/bluetooth/le/AdvertisingSetParameters) object. \n\n### setIncludeTxPower\n\nAdded in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun setIncludeTxPower(includeTxPower: Boolean): PeriodicAdvertisingParameters.Builder!\n```\n\nWhether the transmission power level should be included in the periodic packet. \n\n### setInterval\n\nAdded in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun setInterval(interval: Int): PeriodicAdvertisingParameters.Builder!\n```\n\nSet advertising interval for periodic advertising, in 1.25ms unit. Valid values are from 80 (100ms) to 65519 (81.89875s). Value from range \\[interval, interval+20ms\\] will be picked as the actual value.\n\n| Exceptions ||\n|--------------------------------------|-----------------------------|\n| `java.lang.IllegalArgumentException` | If the interval is invalid. |"]]