class RMQDevice

Public Class Methods

display() click to toggle source
# File lib/project/ruby_motion_query/rmq_device.rb, line 30
def display
  @display ||= RMQ.app.context.getSystemService(RMQ.app.context.WINDOW_SERVICE).defaultDisplay
end
dpi() click to toggle source
# File lib/project/ruby_motion_query/rmq_device.rb, line 42
def dpi
  #TODO
end
height() click to toggle source
# File lib/project/ruby_motion_query/rmq_device.rb, line 38
def height
  @height ||= display.height
end
os_code_name() click to toggle source
# File lib/project/ruby_motion_query/rmq_device.rb, line 18
def os_code_name
  @os_code_name ||= Android::Os::Build::VERSION.new.CODENAME
end
os_version() click to toggle source
# File lib/project/ruby_motion_query/rmq_device.rb, line 14
def os_version
  @os_version ||= Android::Os::Build::VERSION.new.RELEASE.to_f
end
sdk_at_least?(version) click to toggle source
# File lib/project/ruby_motion_query/rmq_device.rb, line 26
def sdk_at_least?(version)
  version.to_i <= sdk_version
end
sdk_version() click to toggle source
# File lib/project/ruby_motion_query/rmq_device.rb, line 22
def sdk_version
  @sdk_version ||= Android::Os::Build::VERSION.new.SDK_INT
end
unique_id() click to toggle source
# File lib/project/ruby_motion_query/rmq_device.rb, line 46
def unique_id
  # This is no simple task... and can sometimes be nil based on device implementation
  # This does seem, however, to be the best answer for now.
  Android::Provider::Settings::Secure.getString(find.app.getContentResolver, "android_id")
end
width() click to toggle source
# File lib/project/ruby_motion_query/rmq_device.rb, line 34
def width
  @width ||= display.width
end