Author: Tang Qian

To come from

It will be three years since 5G will be commercially available in 2021. With iterations of Android 10/11, iPhone12 and iOS14, the biggest group of mobile cellular networks is finally beginning to dream of reality, although 5G itself is not as visible for “mobile” users as 3G->4G. At this stage, the breakthrough of this generation is not only for mobile phone users. From 2019 to today, the phrase “delay” and “bandwidth” is still looking for new business scenarios and tracks.

As the code rolls in, App developers bring their historical baggage to welcome the arrival of new technology and new hardware. Here we are going to talk about the “traditional” pit in mobile application development after 5G.

The status quo

Changing world never stops changing. The following status quo is only available as of the update time.

Reality # 1: Just because a user sees a 5G icon on their phone doesn’t mean they’re using 5G

When a user sees the NR/5G mark, it does not necessarily mean that the current user is using 5G-NR as the “developer” thinks.

For the end user’s sense of motion, when 5G/5G+/NR appears on the signal bar, it is considered that 5G has arrived. But in context, the display of this icon hides a number of technical boundary issues:

  1. Is NR+NSA 5G? Do you want to distinguish BETWEEN SA and NSA?
  2. Is there a real need for frequent status updates due to insufficient coverage or power considerations?

In this kind of problem, communication gods, operators, equipment manufacturers and business masters have all considered the combination of perlocations. Overall, in 5G related communication facilities, if your mobile phone supports NR, if your network is 5G-SA network mode, no problem to display 5G. For NSA, the possible types are as follows:

Based on the above possibilities, whether the terminal displays 5G or not, the current domestic configuration is based on the customized needs of major operators, and the current 5G icon display strategy is mainly promoted as “D+A” scheme:

  • In the idle state (no data service, for example, standby), plan D is used.
  • Plan A is used in the connected state (when data services are used, such as watching videos, chatting on wechat, downloading files in the standby background, etc.).

The specific logic of the solution is described as follows:

If you dig a little deeper, what norms and standards is this based on? Summary in a word: 3GPP standard reference + government regulations based on the operator landing corresponding configuration file, terminal device read configuration display. If you are interested, please refer to this article to explain the details of the current configuration of domestic carriers: “5G Icon Display Strategy” [2]

Status 2: Android developers do not directly access the status of 5G_NSA

Based on status 1, we know that it’s a bit complicated for users to see 5G tags, but as application developers, we don’t really care about the complexity, as long as our code changes with the user interface. But the bad news is that we don’t have access to real permutations yet…

Since 2018, alipay network terminal team has been tracking the adaptation support related to NewRadio in AOSP warehouse. When the earliest Huawei mobile phone in China supported 5G air port, Android-9 itself has a 5g-related network type state -TelephonyManager#NETWORK_TYPE_NR, but with a series of changes to this enumeration, it can be seen that Google’s internal adaptation of 5G network types has not been clear until now. For example:

NETWORK_TYPE_NR refers to NR_SA. If it’s NR_NSA, sorry, TelephoneManger will tell you it’s LTE.

Android.googlesource.com/platform/fr…

@@-2802 7 +2802 11 @@ /** Current network is LTE_CA {@hide} */ @unsupportedAPPUSage public static final int NETWORK_TYPE_LTE_CA = TelephonyProtoEnums.NETWORK_TYPE_LTE_CA; // = 19. /** Current network is NR(New Radio) 5G. */ /** * Current network is NR (New Radio) 5G. * This will only be returned for 5G SA. * For 5G NSA, the network type will be {@link #NETWORK_TYPE_LTE}. */Copy the code

What is NETWORK_TYPE_NR? Swing TelephonyManger. GetNetworkClass () interface

At the end of 2018, we proposed an issue to Google in AOSP Group about NETWORK_TYPE_NR not adapting to the network type classification interface. Public static final int NETWORK_CLASS_5_G = 4, such as Android_10_r38 reference [3].

However, in later versions, this type classification has been removed, such as Android_10_r47 reference [4].

Even for master in March 2020, the hidden method was removed.

Based on similar changes, it means that when an Android device is released, TelephonManger refers to the network type classification of NETWORK_TYPE_NR in the actual release branch, which may be 4G, UNKNOWN or 5G in the system.

Status Quo 2 The above analysis, for developers:

  • The user sees 5G, but your code doesn’t;
  • You have the NR label of SA, NETWORK_TYPE_NR, but you reflect the classification of the system, which tells you that there are probably three answers.

Status 3: iOS14 support for 5G logos is good, but…

Due to early 5G support and high fragmentation of Android, various kinds of discomfort are inevitable. IOS has been supporting 5G since iOS14 and devices have been supporting it directly on iPhone12. These two constants are added to the system:

CORETELEPHONY_EXTERN nsstrings * const CTRadioAccessTechnologyNRNSA API_AVAILABLE (ios) (14.0) API_UNAVAILABLE (macos); CORETELEPHONY_EXTERN nsstrings * const CTRadioAccessTechnologyNR API_AVAILABLE (ios) (14.0) API_UNAVAILABLE (macos);

IOS14 can distinguish BETWEEN NSA and SA 5G by adapting Reachability. Awesome!

But why don’t you try it on iOS14.2? Some flashback scenes were found in the grayscale process. It is speculated that some constants provided by the runtime do not exist in the device. 14.3 No problem so far!

Influence settlement method

User side mobile 5G trend

There is no doubt that 5G will penetrate into the user ecosystem even if it takes a few more years. According to the radar of Alipay network technology, the deployment speed of SA network in China has accelerated significantly in the first ten days of January 2021. Currently, it has reached a “high” PV ratio of 5‰, while it only hovered at 1‰ in the same period last month.

If you’re asking me about the NSA’s share, read this carefully:

Suggestions and solutions

The network service cannot provide consistent user perception

At the level of product design, the above situation of the underlying system of mobile App and user devices should be fully considered. When “5Gxxx function” needs to be done, the consistency of users’ cognition of 5G status and our service should be ensured. Avoid the “why am I on 5G but XXX doesn’t work” question.

In the near future, perhaps, the app ecosystem will not have such a vision.

Closing complexity of the basic network framework

Business development needs to be aware of these differences, but a better design would be to provide interface masking at the network base SDK level, avoiding direct use of system interfaces or even reflection calls to hidden interfaces.

The above adaptation currently stays in the pure system interface packaging type. For “I want to be able to identify Android NSA”, there are various gods on the Internet to provide packaging for various hidden interfaces provided by different manufacturers. If there really is a strong need for this in the future, we may need to do something similar. We also welcome your valuable suggestions and excellent solutions.

Continue to observe

Back to the beginning of the article, the 5G industry’s real attention to the network should not be limited to the development of mobile App itself, but also need to continue to pay attention to the new access architecture and application scenarios behind the new technology. But as carriers push forward, are we really ready for the first apps? Welcome to discuss all kinds of practical pain behind 5G lofty, mine clearing, first let users happy, with no sense.

Reference resources

[1] zhuanlan.zhihu.com/p/111538019… [2] mp.weixin.qq.com/s/CHtnNU4pF… [3] aosp.opersys.com/xref/androi… [4] aosp.opersys.com/xref/androi… [5] android.googlesource.com/platform/fr…

Follow us every week for 3 mobile technology practices & dry goods for you to think about!