使用 5G 技術強化應用程式
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
有時您只需採取一些小步驟就能變更 Android 應用程式,但有時您可能需要徹底改變思考方式。5G 並非小事。
- 逐步改善使用體驗
- 與 4G 相同的體驗,但由於 5G 的頻寬較高且延遲時間較短,因此自然會提供更好的體驗。通常只會影響 Wi-Fi 連線體驗。
- 轉型體驗
- 全新體驗,完全依賴 5G 的優勢 (頻寬和延遲時間),以及能夠偵測無限量連線的特性。
5G 不只是速度更快、延遲時間更短而已,這項功能可為應用程式帶來更多可能性。本主題將介紹幾種可改變使用者體驗的方式。
如要直接開始為應用程式新增 5G 功能,請參閱「為應用程式新增 5G 功能」。
如要進一步瞭解開發 5G 應用程式的最佳做法,請參閱 GSMA 的「5G 應用程式開發人員最佳做法」。
將室內用途轉換為室外用途
在 5G 時代來臨之前,使用者必須確認其他人是否使用 Wi-Fi 進行視訊通話,或是願意支付昂貴且品質不佳的串流數據費用。有了無限上網 5G 服務,無論對方身在何處,你都能隨時撥打視訊通話,對方也能隨時接聽。
有了 5G,使用者就不必在出門前就預先下載內容,而是可在需要時下載所需內容。您可以透過提供鼓勵使用者下載整張專輯的 UI,或是顯示節目每集的播放清單,來鼓勵使用者改變心態。
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+)
- Advanced pro LTE (5Ge)
- NR (5G)
- 毫米波行動網路頻帶的 NR (5G+ 和 5G UW)
這個頁面中的內容和程式碼範例均受《內容授權》中的授權所規範。Java 與 OpenJDK 是 Oracle 和/或其關係企業的商標或註冊商標。
上次更新時間:2025-07-27 (世界標準時間)。
[null,null,["上次更新時間: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)"]]