How is your experience with the OutSystems Community?
thermal-guard
Mobile icon

Thermal Guard

Stable version 1.0.0 (Compatible with OutSystems 11)
Uploaded
 on 18 Nov (7 hours ago)
 by 
0.0
 (0 ratings)
thermal-guard

Thermal Guard

Details
ThermalGuard is an OutSystems 11 mobile plugin that provides access to the device's native thermal status information on Android devices. The component uses the Android PowerManager API to retrieve the current thermal condition reported by the operating system. It allows applications to check thermal API availability and identify the device's thermal state, ranging from normal conditions to critical thermal conditions. ThermalGuard provides simple OutSystems Client Actions to retrieve the thermal status and its corresponding numeric code, enabling applications to adapt processing workloads and respond to thermal conditions.
Read more

ThermalGuard – Device Thermal State Plugin

Overview

ThermalGuard is an OutSystems 11 mobile plugin that provides access to the device's native thermal status information on Android devices.

The component uses the Android PowerManager API to retrieve the current thermal status reported by the operating system. It allows OutSystems applications to check thermal API availability and identify the device's current thermal condition through a readable status name and its corresponding numeric code.

ThermalGuard provides a simple interface through OutSystems Client Actions, allowing developers to integrate device thermal-status information into their mobile applications without writing custom native Android code.

Important: ThermalGuard reports the thermal status provided by the Android operating system. It does not measure the device's actual temperature in degrees Celsius.

Features

  • Check whether the Android thermal status API is supported on the device.

  • Retrieve the current device thermal status.

  • Obtain both the readable thermal status name and its numeric code.

  • Identify different thermal conditions, from normal operation to critical thermal states.

  • Provide simple OutSystems Client Actions for accessing native Android functionality.

  • Return success indicators and descriptive error messages.

  • No additional runtime permissions are required.

Available Client Actions

1. CheckThermalStateAvailability

Checks whether the device supports the Android thermal status API.

Outputs:

  • IsAvailable – Indicates whether the thermal status API is supported on the device.

  • ErrorMessage – Provides error information when the API is unavailable or the availability check fails.

The Android thermal status API requires Android 10 (API level 29) or later.

2. GetCurrentThermalState

Retrieves the current thermal status reported by the Android operating system using the native PowerManager API.

Outputs:

  • ThermalState – Readable name of the current thermal status.

  • ThermalStateCode – Numeric code representing the current thermal status.

  • IsSuccess – Indicates whether the thermal status was retrieved successfully.

  • ErrorMessage – Provides error information when the thermal status cannot be retrieved.

Thermal Status Reference

ThermalGuard supports the standard Android thermal status values:

CodeThermal StateDescription
0NONENo thermal throttling reported.
1LIGHTLight thermal throttling.
2MODERATEModerate thermal throttling.
3SEVERESevere thermal throttling.
4CRITICALCritical thermal condition.
5EMERGENCYEmergency thermal condition.
6SHUTDOWNShutdown is required due to the thermal condition.

These values are retrieved from the Android operating system and are not calculated by the component.

Basic Usage

A typical implementation can follow this flow:

  1. Call CheckThermalStateAvailability to verify whether the device supports the thermal status API.

  2. Check the IsAvailable output.

  3. If available, call GetCurrentThermalState.

  4. Read ThermalState and ThermalStateCode.

  5. Use the returned status to determine appropriate application behavior.

Example:

Availability Check

IsAvailable = True

Current Thermal Status

ThermalState = NONE

ThermalStateCode = 0

IsSuccess = True

Potential Use Cases

ThermalGuard can help developers build applications that respond to the device's thermal condition.

Examples include:

  • Adaptive Workloads: Reduce resource-intensive processing when the operating system reports elevated thermal status.

  • Mobile Performance Optimization: Adapt application behavior based on the current thermal condition.

  • Background Processing: Adjust the intensity of background operations when thermal stress is reported.

  • Media Applications: Consider adapting resource-intensive media processing based on device thermal status.

  • Device Diagnostics: Display the current thermal condition as part of a device diagnostics interface.

  • Monitoring Dashboards: Present thermal status information within mobile monitoring applications.

The consuming application is responsible for implementing any workload adjustments or business logic based on the returned status.

Platform Requirements

  • OutSystems 11.

  • Mobile / Phone applications.

  • Android 10 (API level 29) or later.

  • Cordova-based mobile application.

Platform Support: Android only.

Devices running Android versions earlier than Android 10 are not supported because the required native thermal status API is unavailable.

Technical Implementation

ThermalGuard uses the native Android PowerManager API:

PowerManager.getCurrentThermalStatus()

The component implements a lightweight Cordova bridge that exposes this native functionality through JavaScript and makes it accessible to OutSystems Client Actions.

No external thermal-sensor library or third-party native SDK is required.

Important Notes

  • ThermalGuard retrieves the thermal status reported by the Android operating system; it does not return an actual temperature measurement in Celsius.

  • IsAvailable = True indicates that the required Android API is supported, not that the device is currently experiencing thermal stress.

  • Thermal status values depend on the device, Android implementation, and current operating conditions.

  • The component retrieves the current status when GetCurrentThermalState is called. It does not provide continuous thermal-state monitoring or listener events in this version.

  • Applications should handle unsupported Android versions and API errors gracefully.

  • The component exposes the native thermal status; application-specific workload management and response logic should be implemented by the consuming application.

Demo Application

A dedicated demo application, ThermalGuard, is provided to demonstrate the plugin's functionality.

The demo allows developers to:

  • Check thermal status API availability.

  • Retrieve the current device thermal status.

  • View the readable thermal state.

  • View the corresponding numeric status code.

  • Observe successful responses and error information.

License

ThermalGuard is distributed under the MIT License.

Release notes (1.0.0)
License (1.0.0)
Reviews (0)
Team
Other assets in this category