Quick Links: Download Gideros Studio | Gideros Documentation | Gideros Development Center | Gideros community chat | DONATE
System plugin (iOS) — Gideros Forum

System plugin (iOS)

JaviJavi Member
edited December 2012 in Plugins
Today I made a small plugin to access some system functions. Feel free to use it if you need it.

http://neptalium.com/download/gideros_system_ios.zip

To install it just include "System.mm" in your project.

Example of use:
if application:getDeviceInfo() == "iOS" then
  require "system"
 
  -- Misc functions
  print("Name: " ..                          system.name())
  print("Model: " ..                         system.model())
  print("System name: " ..                   system.systemName())
  print("System version: " ..                system.systemVersion())
  print("Has retina display: " ..            tostring(system.hasRetinaDisplay()))
  print("Has FPU (Floating Point Unit): " .. tostring(system.hasFPU()))
  print("Is multitasking supported: " ..     tostring(system.isMultitaskingSupported()))
  print("CPU byte order (endian): " ..       system.byteOrder())
  print("Number of CPUs: " ..                system.numCPUs())
  print("CPU frequency (Hz): " ..            system.cpuFrequency())
  print("Bus frequency (Hz): " ..            system.busFrequency())
  print("Physical memory (bytes): " ..       system.physicalMemory())
  print("User memory (bytes): " ..           system.userMemory())
  print("Free memory (bytes): " ..           system.freeMemory())
  print("Total disk space (bytes): " ..      system.totalDiskSpace())
  print("Free disk space (bytes): " ..       system.freeDiskSpace())
 
  -- Battery state and level
  print("Battery monitoring enabled: " .. tostring(system.isBatteryMonitoringEnabled()))
  system.enableBatteryMonitoring()
  print("Battery state (unplugged, charging, full or unknown): " .. system.batteryState())
  print("Battery level (0 - 1): " .. system.batteryLevel())
  system.disableBatteryMonitoring()
 
  -- Proximity sensor
  system.enableProximityMonitoring()
  if system.isProximityMonitoringEnabled() then
    print("Proximity sensor state (on, off): " .. tostring(system.proximityState()))
  else
    print("Proximity sensor not supported!")
  end
  system.disableProximityMonitoring()
end
+1 -1 (+5 / -0 )Share on Facebook

Comments

Sign In or Register to comment.