TelephonyManager.DataNetworkType Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Returns a constant indicating the radio technology (network type) currently in use on the device for data transmission.
public virtual Android.Telephony.NetworkType DataNetworkType { [Android.Runtime.Register("getDataNetworkType", "()I", "GetGetDataNetworkTypeHandler", ApiSince=24)] get; }
[<get: Android.Runtime.Register("getDataNetworkType", "()I", "GetGetDataNetworkTypeHandler", ApiSince=24)>]
member this.DataNetworkType : Android.Telephony.NetworkType
Property Value
the network type
- Attributes
Remarks
Returns a constant indicating the radio technology (network type) currently in use on the device for data transmission.
If this object has been created with #createForSubscriptionId
, applies to the given subId. Otherwise, applies to SubscriptionManager#getActiveDataSubscriptionId()
.
Note: Before SubscriptionManager#getActiveDataSubscriptionId()
was introduced in API level 30, it was applied to SubscriptionManager#getDefaultDataSubscriptionId()
which may be different now from SubscriptionManager#getActiveDataSubscriptionId()
, e.g. when opportunistic network is providing cellular internet connection to the user.
Requires Permission: android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE
or android.Manifest.permission#READ_BASIC_PHONE_STATE READ_BASIC_PHONE_STATE
or that the calling app has carrier privileges (see #hasCarrierPrivileges
).
Java documentation for android.telephony.TelephonyManager.getDataNetworkType()
.
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.