UserSensor
  public
  
  
  
  class
  UserSensor
  
    extends Object
  
  
  
  
  
  
| java.lang.Object | |
| ↳ | com.google.android.things.userdriver.sensor.UserSensor | 
A user-defined sensor backed by a UserSensorDriver.
 Use UserSensor.Builder to create user sensors, and registerSensor(UserSensor) to register them.
Summary
Nested classes | |
|---|---|
        
        
        
        
        class | 
      
        UserSensor.Builder
        Builder to allow for flexible   | 
    
Public methods | |
|---|---|
        
        
        
        final
        
        UserSensorDriver
     | 
  
    
      
      getDriver()
      
      
        Returns the sensor driver.  | 
  
        
        
        
        final
        
        int
     | 
  
    
      
      getMaxDelay()
      
      
        Returns the sensor max delay between readings.  | 
  
        
        
        
        final
        
        float
     | 
  
    
      
      getMaxRange()
      
      
        Returns the sensor maximum reading range.  | 
  
        
        
        
        final
        
        int
     | 
  
    
      
      getMinDelay()
      
      
        Returns the sensor min delay between readings.  | 
  
        
        
        
        final
        
        String
     | 
  
    
      
      getName()
      
      
        Returns the sensor name.  | 
  
        
        
        
        final
        
        float
     | 
  
    
      
      getPower()
      
      
        Returns the sensor power consumption while enabled.  | 
  
        
        
        
        final
        
        int
     | 
  
    
      
      getReportingMode()
      
      
        Returns the sensor reporting mode.  | 
  
        
        
        
        final
        
        float
     | 
  
    
      
      getResolution()
      
      
        Returns the sensor minimum detectable resolution.  | 
  
        
        
        
        final
        
        String
     | 
  
    
      
      getStringType()
      
      
        Returns the sensor type string.  | 
  
        
        
        
        final
        
        int
     | 
  
    
      
      getType()
      
      
        Returns the sensor type.  | 
  
        
        
        
        final
        
        UUID
     | 
  
    
      
      getUuid()
      
      
        Returns the sensor UUID.  | 
  
        
        
        
        final
        
        String
     | 
  
    
      
      getVendor()
      
      
        Returns the sensor driver vendor name.  | 
  
        
        
        
        final
        
        int
     | 
  
    
      
      getVersion()
      
      
        Returns the sensor driver version.  | 
  
Inherited methods | |
|---|---|
  
    
  
    java.lang.Object
  
 | |
Public methods
getDriver
UserSensorDriver getDriver ()
Returns the sensor driver.
| Returns | |
|---|---|
UserSensorDriver | 
        controlling UserSensorDriver | 
      
See also:
getMaxDelay
int getMaxDelay ()
Returns the sensor max delay between readings.
| Returns | |
|---|---|
int | 
        max delay in microseconds | 
See also:
getMaxRange
float getMaxRange ()
Returns the sensor maximum reading range.
| Returns | |
|---|---|
float | 
        maximum sensor range in the sensor's reporting units | 
See also:
getMinDelay
int getMinDelay ()
Returns the sensor min delay between readings.
| Returns | |
|---|---|
int | 
        min delay in microseconds | 
See also:
getPower
float getPower ()
Returns the sensor power consumption while enabled.
| Returns | |
|---|---|
float | 
        power consumption in milliAmps | 
See also:
getReportingMode
int getReportingMode ()
Returns the sensor reporting mode.
| Returns | |
|---|---|
int | 
        android.hardware.Sensor.REPORTING_MODE_* constant | 
      
getResolution
float getResolution ()
Returns the sensor minimum detectable resolution.
| Returns | |
|---|---|
float | 
        resolution in the sensor's reporting units | 
See also:
getStringType
String getStringType ()
Returns the sensor type string.
| Returns | |
|---|---|
String | 
        sensor type as a string | 
getType
int getType ()
Returns the sensor type.
| Returns | |
|---|---|
int | 
        android.hardware.Sensor type | 
      
getUuid
UUID getUuid ()
Returns the sensor UUID.
| Returns | |
|---|---|
UUID | 
        sensor UUID, or 0 if not set | 
See also:
getVendor
String getVendor ()
Returns the sensor driver vendor name.
| Returns | |
|---|---|
String | 
        vendor name | 
See also:
getVersion
int getVersion ()
Returns the sensor driver version.
| Returns | |
|---|---|
int | 
        version number | 
See also:
Interfaces
Classes
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.