Detects if the current device is a Nintendo game device.
@return detection of Nintendo
777948
public boolean detectNintendo() {

        if ((userAgent.indexOf(deviceNintendo) != -1)
            || (userAgent.indexOf(deviceWii) != -1)
            || (userAgent.indexOf(deviceNintendoDs) != -1)) {
            return true;
        }
        return false;
    }
347222
function isRecognisedBluetoothDevice(name) {
    if (!name) return false;
    var devs = recognisedBluetoothDevices();
    for (var i=0;i<devs.length;i++)
      if (name.substr(0, devs[i].length) == devs[i])
        return true;
    return false;
  }
248133
function DetectTierOtherPhones()
   {
      if ($this->initCompleted == $this->true ||
          $this->isTierGenericMobile == $this->true)
         return $this->isTierGenericMobile;

      //Exclude devices in the other 2 categories 
      if (($this->DetectMobileLong() == $this->true)
		&& ($this->DetectTierIphone() == $this->false)
		&& ($this->DetectTierRichCss() == $this->false))
           return $this->true;
      else
         return $this->false; 
   }
475001
function DetectSmartphone()
   {
      //Exclude duplicates from TierIphone
      if (($this->DetectTierIphone() == $this->true)
		|| ($this->DetectS60OssBrowser() == $this->true)
		|| ($this->DetectSymbianOS() == $this->true) 
		|| ($this->DetectWindowsMobile() == $this->true)
		|| ($this->DetectBlackBerry() == $this->true)
		|| ($this->DetectMeegoPhone() == $this->true)
		|| ($this->DetectPalmWebOS() == $this->true))
         return $this->true; 
      else
         return $this->false; 
   }
303099
public boolean detectBlackBerryTouch() {

        if (detectBlackBerry()
            && ((userAgent.indexOf(deviceBBStorm) != -1)
                || (userAgent.indexOf(deviceBBTorch) != -1)
                || (userAgent.indexOf(deviceBBBoldTouch) != -1)
                || (userAgent.indexOf(deviceBBCurveTouch) != -1))) {
            return true;
        }
        return false;
    }
87171
def detectMaemoTablet(self):
        
        if UAgentInfo.maemo in self.__userAgent:
            return True

        return UAgentInfo.linux in self.__userAgent \
            and UAgentInfo.deviceTablet in self.__userAgent \
            and not self.detectWebOSTablet() \
            and not self.detectAndroid()
418590
function () {
        if (isWin) {
            var devices = findBlinkSticks();

            return devices.length > 0 ? devices[0] : null;
        } else {
            var device = usb.findByIds(VENDOR_ID, PRODUCT_ID);
            if (device) return new BlinkStick(device);
        }
    }
821540
function DetectIphone()
   {
      if ($this->initCompleted == $this->true ||
          $this->isIphone == $this->true)
         return $this->isIphone;
      
      if (stripos($this->useragent, $this->deviceIphone) > -1)
      {
         //The iPad and iPod Touch say they're an iPhone. So let's disambiguate.
         if ($this->DetectIpad() == $this->true ||
             $this->DetectIpod() == $this->true)
            return $this->false;
         //Yay! It's an iPhone!
         else
            return $this->true; 
      }
      else
         return $this->false; 
   }
154065
public static function get_user_device_type() {
        $device = self::get_device_type();
        $switched = get_user_preferences('switchdevice'.$device, false);
        if ($switched != false) {
            return $switched;
        }
        return $device;
    }
1182679
function DetectWindowsMobile()
   {
      if ($this->DetectWindowsPhone() == $this->true)
         return $this->false;
      
      //Most devices use 'Windows CE', but some report 'iemobile' 
      //  and some older ones report as 'PIE' for Pocket IE. 
      if (stripos($this->useragent, $this->deviceWinMob) > -1 ||
          stripos($this->useragent, $this->deviceIeMob) > -1 ||
          stripos($this->useragent, $this->enginePie) > -1)
         return $this->true; 
      //Test for Windows Mobile PPC but not old Macintosh PowerPC.
	  if (stripos($this->useragent, $this->devicePpc) > -1
		  && !(stripos($this->useragent, $this->deviceMacPpc) > 1))
         return $this->true; 
      //Test for certain Windwos Mobile-based HTC devices.
      if (stripos($this->useragent, $this->manuHtc) > -1 &&
          stripos($this->useragent, $this->deviceWindows) > -1)
         return $this->true; 
      if ($this->DetectWapWml() == $this->true &&
          stripos($this->useragent, $this->deviceWindows) > -1) 
         return $this->true; 
      else
         return $this->false; 
   }
1287418
protected static Boolean isEmulator() {
        try {
            return Build.FINGERPRINT.startsWith("generic")
                || Build.FINGERPRINT.startsWith("unknown")
                || Build.MODEL.contains("google_sdk")
                || Build.MODEL.contains("Emulator")
                || Build.MODEL.contains("Android SDK built for x86")
                || Build.MANUFACTURER.contains("Genymotion")
                || (Build.BRAND.startsWith("generic") && Build.DEVICE.startsWith("generic"))
                || "google_sdk".equals(Build.PRODUCT);
        } catch (Exception e) {
            Log.e(TAG, "Error checking whether application is running in an emulator.", e);
            return null;
        }
    }
1299393
function DetectIos()
   {
      if (($this->DetectIphoneOrIpod() == $this->true) ||
        ($this->DetectIpad() == $this->true))
         return $this->true; 
      else
         return $this->false;
   }
148230
function DetectBlackBerry()
   {
       if ((stripos($this->useragent, $this->deviceBB) > -1) ||
          (stripos($this->httpaccept, $this->vndRIM) > -1))
         return $this->true;
      if ($this->DetectBlackBerry10Phone() == $this->true) 
         return $this->true;       
       else
         return $this->false; 
   }
176462
function DetectMeegoPhone()
   {
      if ((stripos($this->useragent, $this->deviceMeego) > -1)
			&& (stripos($this->useragent, $this->mobi) > -1))
         return $this->true; 
      else
         return $this->false; 
   }
844492
function DetectSonyPlaystation()
   {
      if (stripos($this->useragent, $this->devicePlaystation) > -1)
         return $this->true; 
      else
         return $this->false; 
   }
1369362
def is_device(self):
		

		if self in {type(self).DEVICE_ADDED, type(self).DEVICE_REMOVED}:
			return True
		else:
			return False
490288
private function checkDeviceType()
    {
        // The 'deviceType' parameter must have been defined.
        if (!isset($this->deviceType)) {
            throw new PushwooshException('The \'deviceType\' property is not set !');
        }

        // The 'deviceType' must be valid
        switch ($this->deviceType) {
            // 1 - iOS
            case 1:
                break;

            // 2 - BlackBerry
            case 2:
                break;

            // 3 - Android
            case 3:
                break;

            // 4 - Nokia ASHA
            case 4:
                break;

            // 5 - Windows Phone
            case 5:
                break;

            // 6 - Error (not documented in the Pushwoosh documentation)
            case 6:
                throw new PushwooshException('The \'deviceType\' value \'' . $this->deviceType . '\' is invalid !');
                break;

            // 7 - Mac OS X
            case 7:
                break;

            // 8 - Windows 8
            case 8:
                break;

            // 9 - Amazon
            case 9:
                break;

            // 10 - Safari
            case 10:
                break;

            // Invalid device type value
            default:
                throw new PushwooshException('The \'deviceType\' value \'' . $this->deviceType . '\' is invalid !');
                break;
        }
    }