top of page

Mobile Sleep

The Mobile Sleep plugin is specifically designed to implement native power management features in both Android and iOS, for games built using Construct 3 and Construct 2.


The Mobile Sleep plugin is essential for games that require the mobile device to always use its highest performance, benefiting intense games that require the most resources.


The Mobile Sleep plugin allows the device to keep the device awake or dimmed, and other features.

PlayFab API v2.png

Introduction

Step 1.png

The Construct Master Collection supports the full and easy integration of native mobile Android SDKs and iOS SDKs for both Construct 3 and Construct 2.


Please click here to learn more about Mobile.

Features


The Mobile Sleep plugin is specifically designed to implement native power management features in both Android and iOS, for games built using Construct 3 and Construct 2.


The Mobile Sleep plugin is essential for games that require the mobile device to always use its highest performance, benefiting intense games that require the most resources.


The Mobile Sleep plugin allows the device to keep the device awake or dimmed, and other features.


Here are some of the native features of the mobile plugin:

  • Android Power Management

  • iOS Power Management

  • Lock awake application

  • Lock dim application

  • Release lock awake or dim

  • Release pause sleep

  • Prevent device from dimming while application is active.

  • Prevent device from sleeping while application is active.

  • Allow device to use maximum performance for application.

  • Prevent device from using power saving features slowing the application.

For more information about native mobile or Android and iOS features, please click here to learn the introductory lessons to Mobile.


Platform Integration


Here are some of the platforms that are natively supported:

  • Android

  • iOS

  • Native Android

  • Native iOS


Build Support


Here are some of the supported build options:


Editor Features


Here are some of the features in the Construct editor:

  • Construct 3

  • Construct 2

Introduction
Features

How to use?

It is easy to use the Mobile Sleep plugin, you will only need to follow the steps below.

1. The first step is to add the Mobile Sleep object into the project.


Instructions
Documentation

Documentation

There is currently nothing to show, we will add more in the future.



Performance Optimization


The Mobile Sleep plugin has the capability to force the device to use all of its resources to run the application or game application, preventing any slowdowns from power saving features from mobile device manufacturers for hybrid applications, which Construct 3 and Construct 2 export to with Cordova. This will in turn significantly improve and maintain overall performance for mobile game applications made in Construct 3 and Construct 2, preventing lag spikes and sudden slowdowns.



There are many ways to handle the power management features. For the simplest implementation, you can either activate lock awake app on start of the game application, or you can dynamically activate or deactivate the lock awake app. For example, you can choose to only activate lock awake app during gameplay, but deactivate when in the main menu.

ACEs

Actions, Conditions & Expressions

Actions

The following action groups:

  • General

General

  • Lock Awake App - Lock the App to an awake state when idle. This is useful during in-game.

  • Lock Dim App - Lock the App to a dimmed state when idle. This is important to at least keep the phone awake.

  • Release Lock - Release any app state lock if Locked Awake or Locked Dimmed. To avoid unnecessary battery drain.

  • Release Pause Sleep - By default, the wake lock is auto-released when paused (Phone is off or the app is minimized). It will reacquire the wake-lock upon app resume. To disable, set to "False".

    • Toggle - Set either "True" or "False".

Conditions

The following condition groups:

  • Lock Awake

  • Lock Dimmed

  • Lock Release

  • Override Pause Sleep