title: What is alternative to ConnectivityManager.TYPE_WIFI deprecated in Android P API 28?
body: <p><a href="https://developer.android.com/reference/android/net/ConnectivityManager#TYPE_WIFI" rel="noreferrer">ConnectivityManager.TYPE_WIFI</a> is deprecated in Android P API 28. Also, <a href="https://developer.android.com/reference/android/net/NetworkInfo#getType()" rel="noreferrer">NetworkInfo#getType</a> and <a href="https://developer.android.com/reference/android/net/ConnectivityManager#TYPE_MOBILE" rel="noreferrer">ConnectivityManager.TYPE_MOBILE</a>'s are also deprecated.</p>
  
  <p>So, what are the alternatives for them? I understood that the we've to use the method from <strong>NetworkCapabilities</strong> class. However I'm not able to merge all the things in one place like how to do getType() in NetworkCapabilities class and how to add the WIFI and cellular data checks on it? </p>
  
  <p>Please assist.</p>