title: Android: How to detect if a device is WiFi or WiFi+Cellular
body: <p>Is there a way to check if the user is using a device (this applies primarily to tablets) with Cellular conection?. That is, the smartphones comes with built-in Wi‑Fi and Cellular (generally), but some tablets only comes with Wi-Fi. How I can know what type of device is running my application?</p>
  
  <p>I tried the following without results:</p>
  
  <pre><code>cell = ConnectivityManager.isNetworkTypeValid(ConnectivityManager.TYPE_MOBILE);
  wifi = ConnectivityManager.isNetworkTypeValid(ConnectivityManager.TYPE_WIFI);
  
  if (cell) tv_1.setText("The tablet has cellular");
     else tv_1.setText("The tablet does not have cellular");
  if (wifi) tv_2.setText("The tablet has wifi");
     else tv_2.setText("The tablet does not have wifi");
  </code></pre>
  
  <p>The problem is that both comparisons always return true, even if it's a tablet that has no cellular.</p>
  
  <p>I only need to know if the device has a SIM card slot (model with cellular) or it is a model that only has WiFi, is that possible?</p>
  
  <p>Thanks in advance.</p>