使用 5G 增强应用
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
有时,对 Android 应用进行更改只需采取一些小步骤,有时则需要您彻底改变思维方式。5G 并非小事一桩。
- 增量体验
- 与 4G 体验完全相同,但由于 5G 的带宽更高且延迟时间更短,因此体验自然更好。通常仅限 Wi-Fi 体验。
- 变革性体验
- 一种全新体验,完全依赖于 5G 的优势(带宽和延迟时间),以及能够检测连接是否不计流量。
5G 不仅仅是速度更快、延迟更短。这为您的应用开辟了新的可能性。本主题介绍了一些可用于改进用户体验的方法。
如需直接向应用添加 5G 功能,请参阅向应用添加 5G 功能。
如需详细了解开发适用于 5G 的应用的最佳实践,请参阅 GSMA 的 5G 应用开发者的最佳实践。
将室内用例转变为室外用例
在 5G 之前,视频聊天需要用户确认其他所有人都是通过 Wi-Fi 连接,或者愿意支付高昂且画质较差的流式传输的数据流量费用。借助不限流量的 5G 网络,您可以随时随地与他人进行视频通话,对方也能随时接听您的来电。
借助 5G,用户无需再提前规划下载内容,而是可以根据需要随时下载所需内容。您可以通过提供鼓励用户下载整张专辑的界面,或显示节目每集的播放列表,来鼓励用户进行这种心态转变。
5G 还让用户在未连接到 Wi-Fi 的情况下参与实时多人游戏。无需再确保每个人都能与家庭网络建立强大的连接;借助 5G 网络,您现在可以随时随地畅玩游戏。您甚至可以考虑添加通常仅适用于游戏笔记本电脑或台式机的功能,例如游戏内语音和视频聊天。
将以照片为中心的用户体验转变为以视频为中心或以 AR 为中心的用户体验
在 5G 之前,大多数应用的视觉体验都以照片或短视频片段为中心。随着 5G 功能的加入,您的应用可以通过向应用添加增强现实功能(例如使用地图引导用户时),将用户体验转变为更加沉浸式的体验。
您可以使用额外的带宽,将照片替换为视频,从而提升用户体验。考虑为视频轮播界面提供始终立即开始播放的预提取视频。
有效地预提取
对于 3G 和 4G,最佳实践限制了用户当前正在使用的缓冲内容的数量。5G 消除了这一限制,让您能够利用对用户体验历程的了解,预加载您知道用户可能需要的大量内容,从而为他们提供帮助。
例如,您可以提供新的基元,让用户指定约束条件(我最近听过的 50 首歌曲、这个城市最热门的 10 首歌曲等),然后根据这些约束条件选择性地下载内容,而无需用户自行组合自己的合集(例如播放列表、专辑或套装)并明确下载。
将小众用例转变为主流用例
在没有 5G 的情况下,很少有用户会在线播放或观看在线播放的内容。随着 5G 的推出,这种小众用例可能会成为主流用例。具体而言,Android 11 增加了对低延迟视频编解码器的支持。应用可以使用新 API 为特定编解码器检查和配置低延迟播放。这有助于为 5G 设备提供出色的用户体验。
如需了解如何为用户提供特定于用例的性能提升,请参阅 [使用网络切片](/develop/connectivity/5g/use-network-slicing)。
在用户连接到 5G 网络时显示相关信息
在 Android 11 及更高版本中,具有 android.Manifest.permission.READ_PHONE_STATE
权限的应用可以通过 PhoneStateListener.onDisplayInfoChanged()
请求更新电话显示信息,其中包括用于营销和品牌塑造的无线接入技术信息。
这款新 API 提供了适用于不同运营商的各种 5G 图标显示解决方案。支持的技术包括:
- LTE
- 采用载波聚合技术的 LTE (LTE+)
- 高级专业版 LTE (5Ge)
- NR (5G)
- 毫米波移动网络频段上的 NR (5G+ 和 5G UW)
本页面上的内容和代码示例受内容许可部分所述许可的限制。Java 和 OpenJDK 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-27。
[null,null,["最后更新时间 (UTC):2025-07-27。"],[],[],null,["# Enhance your apps with 5G\n\nSometimes changes to an Android app are little steps, and sometimes they\nrequire you to completely change the way you think. 5G is not a little step.\n\n**Incremental experience**\n: An experience that's identical to the 4G experience but just happens to be\n naturally better because of the higher bandwidth and lower latency of 5G.\n Often just the Wi-Fi experience.\n\n**Transformative experience**\n: An experience that's new and entirely dependent on the benefits of 5G\n (bandwidth and latency) and on being able to detect the unmetered nature of\n the connection.\n\n5G is about more than just faster speeds and lower latency. It opens the door to\nnew possibilities in your apps. This topic goes over some of the ways that you\ncan transform your user experience.\n\nTo jump right into adding 5G capabilities to your apps, see [Add 5G capabilities\nto your app](/about/versions/11/features/5g).\n\nTo learn more about best practices for developing 5G-ready apps, see [Best\nPractices for 5G App\nDevelopers](https://www.gsma.com/get-involved/working-groups/gsma_resources/idg-15-v1-0-best-practices-for-5g-app-developers)\nfrom GSMA.\n\nTurn indoor use cases into outdoor use cases\n--------------------------------------------\n\nBefore 5G, video chat required users to confirm that everyone else was on Wi-Fi\nor was okay with paying for the data costs of an expensive and low-quality\nstream. With unmetered 5G, you can just video call people and expect your call\nto always be accepted, no matter where people are.\n\nWith 5G, your users can stop planning downloads ahead of a trip, instead\ndownloading what they need, when they need it. You can encourage that mental\nshift by exposing a UI that encourages users to download entire albums or by\nshowing playlists of every episode of a show.\n\n5G also opens up opportunities to engage in real-time, multiplayer games when\nnot tethered to Wi-Fi. No more requirement to ensure everyone has a strong\nconnection to their home network; with 5G gaming anytime, anywhere is now\npossible. You could even consider adding capabilities that are normally reserved\nfor gaming laptops or desktop computers, like in-game voice and video chat.\n\nTurn photo-centric UX into video-centric or AR-centric UX\n---------------------------------------------------------\n\nUntil 5G, most apps' visual experience was centered around photos or short\nvideo clips. With the addition of 5G capabilities, your app can shift the user\nexperience to be more immersive by adding [augmented\nreality](https://developers.google.com/ar/develop/java/quickstart) capabilities\nto your app, such as when using maps to guide users.\n\nYou can use the additional bandwidth to make the user experience more appealing\nby replacing photos with videos. Consider providing video carousels with\npre-fetched videos that always start instantly.\n\nPrefetch helpfully\n------------------\n\nWith 3G and 4G, best practices limited you to relatively small amounts of\nbuffering of content that the user is currently consuming. 5G removes that\nlimitation, enabling you to use your understanding of the user journey to help\nthem by prefetching whole chunks of content you know they're likely to want.\n\nFor example, instead of requiring your users to assemble their own collections\n(like playlists, albums, or sets) and explicitly download them, you can offer\nnew primitives that let users specify the constraints (last 50 songs I've\nlistened to, 10 most popular songs in this city, and so on) and then download\nthem opportunistically.\n\nTurn niche use cases into mainstream use cases\n----------------------------------------------\n\nWithout 5G, few users streamed or consumed streams. With the introduction of 5G,\nthis niche use case can become a mainstream use case. Android 11, specifically,\nadds support for low-latency video codecs. Apps can use the new APIs to\n[check](https://developer.android.com/reference/android/media/MediaCodecInfo.CodecCapabilities#isFeatureSupported(java.lang.String))\nand\n[configure](https://developer.android.com/reference/android/media/MediaCodec.html#PARAMETER_KEY_LOW_LATENCY)\nlow-latency playback for a specific codec. This helps provide 5G devices with a\ncompelling user experience.\n\nTo learn about offering your users a use-case-specific performance boost, see\n\\[Use network slicing(/develop/connectivity/5g/use-network-slicing).\n\nTell your users when they're on 5G\n----------------------------------\n\nOn Android 11 and higher, apps with\n[`android.Manifest.permission.READ_PHONE_STATE`](/reference/android/Manifest.permission#READ_PHONE_STATE)\npermission can request telephony display information updates through\n[`PhoneStateListener.onDisplayInfoChanged()`](/reference/android/telephony/PhoneStateListener#onDisplayInfoChanged(android.telephony.TelephonyDisplayInfo)).\nThis includes radio access technology information for marketing and branding\npurposes.\n\nVarious 5G icon display solutions for different carriers are provided by this\nnew API. The supported technologies include the following:\n\n- LTE\n- LTE with carrier aggregation (LTE+)\n- Advanced pro LTE (5Ge)\n- NR (5G)\n- NR on millimeter-wave cellular bands (5G+ and 5G UW)"]]