简体   繁体   English

Google Nearby Connections - 定时广告

[英]Google Nearby Connections - Timed Advertising

我正在使用 google Nearby 连接使用 Star 策略创建 P2P 网络,我想知道是否可以将广告设备设置为在 5 分钟后停止广告。

You could set up a thread, with a timer.您可以设置一个带有计时器的线程。 If the timer reaches 0, and you are advertising, then call the corresponding stopAdvertising() method.如果计时器达到 0,并且您正在做广告,则调用相应的stopAdvertising()方法。

Besides this, keep in mind that the user should be aware when the device is advertising via an icon or a special screen.除此之外,请记住,当设备通过图标或特殊屏幕进行广告时,用户应该知道。 This is stated in this video (they talk about nearby messages, rather than connections, but the best practices still apply).这在此视频中有所说明(他们谈论的是附近的消息,而不是连接,但最佳实践仍然适用)。

What I mean, is that it would be odd to have the user waiting for 5 minutes in the same screen while advertising.我的意思是,让用户在做广告时在同一屏幕上等待 5 分钟会很奇怪。 Most likely he quits before the 5 minute window has passed, at which point you must also stop advertising.他很可能在 5 分钟窗口过去之前退出,此时您也必须停止广告。 If you think in your application the user might stay in the advertising screen for over 5 minutes, then use the counter in a thread.如果您认为在您的应用程序中用户可能会在广告屏幕上停留超过 5 分钟,那么请在线程中使用计数器。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在特定设备上使用 Google Nearby Connections 发送文件时出现问题 - Problem sending file using Google Nearby Connections on specific device Google附近的连接是否支持非Android端点? - Does Google Nearby Connections support non-Android endpoints? Unity Android获取Google Play广告ID - Unity Android Get Google Play Advertising ID AppLovinSdk:[DataCollector] 无法收集 Google 广告 ID - AppLovinSdk: [DataCollector] Could not collect Google Advertising ID Android 附近的连接无法连接到设备。 总是返回 8011 - Android Nearby Connections cannot connect to device. Always returns 8011 附近的连接:为什么“下载”文件夹中的有效负载文件为空? - Nearby Connections: Why is the payload file from the Downloads folder null? android搜索附近的公交车站google api - android search nearby bus stop google api 如何访问已使用附近连接 API 和 android 11 传输的文件,因为文件存储在附近的范围存储中? - How to access file that has been transferred using Nearby Connections API with android 11, as file is stored in Nearby's scoped storage? 未为接受连接设置“超时时间”时,接受超时异常 - Accept timed out exception when not set “timeout time” for accept connections 尝试将Google附近消息API集成到Android项目中 - Trying to integration Google Nearby Message API in android project
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM