# Device Blocks

## Overview

Device blocks allow you to access device-specific capabilities, such as sensors, camera functionalities, or location services. By utilizing device blocks, you can create apps that leverage the unique features of the device, enhancing user experiences by incorporating functionalities tailored to the device's capabilities.

## Vibrate

This block causes the device to vibrate.

<div align="left"><img src="/files/-MUiCz3ysOQJDqbgj7r0" alt="" width="188"></div>

## Current Time and Date

This block returns the current time or date in numerical format (e.g. January is returned as month = 1).&#x20;

<div align="left"><figure><img src="/files/SuRGIMQSqVIKMGov8E5Y" alt="" width="178"><figcaption></figcaption></figure></div>

If you want to convert the numbers into words, we suggest adding a [local table data source ](/getting-started/data-sources/data-sources-3.md)and simple tables like the ones below.

<div align="left"><figure><img src="/files/1zIQcXxelnvGzt4Rka5w" alt="" width="375"><figcaption></figcaption></figure></div>

![](/files/bwvPP1CeQpsrfAf1aWyd)

## Get Seconds since 1970

This block measures seconds since 00:00:00 UTC on 1 January 1970. This timestamp is also known as Unix time or Epoch time. You can learn more about its use in computer programming here: [Unix time Wikipedia page](https://en.wikipedia.org/wiki/Unix_time).

<div align="left"><img src="/files/-MUiDjFq8zzFsnDbrgQo" alt="" width="375"></div>

## Device is Online?

This block checks the device's online/offline status. This is helpful if you want to provide a different experience depending on whether the user is online or not. This block returns true or false.

<div align="left"><img src="/files/iJ1PLbleYXoNxrocdeGt" alt="" width="563"></div>

## Get Screen Height or Width

This block returns the height or width of the screen running the app in pixels.

<div align="left"><img src="/files/-MUiEaqZJzbm5C50j9Od" alt="" width="375"></div>

## Platform is \[X]?

This block gets the device's mobile operating system. This is helpful if you want to modify the user experience depending on the user's mobile operating system. This block returns true or false.

<div align="left"><img src="/files/-MUiFEQPaJpnvK0hkxwf" alt="" width="375"></div>

## Dismiss Keyboard

This block allows you to dismiss the device keyboard for the user.&#x20;

<div align="left"><img src="/files/aprwtNFgyqhkUi6PNGrG" alt="" width="375"></div>

## Keep Screen Awake

Some devices automatically go to sleep if there is no user activity in an app for a certain period. The "set keep screen awake to" block keeps the screen awake even if the user is not actively interacting with the app. This block can be set to true or false.

<div align="left"><img src="/files/-MUiFn7as9ECKEa8lr7H" alt="" width="375"></div>

## Is Device Color Scheme?

Having dark and light modes available is a popular choice for apps and device operating systems. This block detects whether the user's device is set to a light or dark color theme. You can then use blocks to change the color scheme of components in your app to match the user's preferences. This block returns true or false.

<div align="left"><img src="/files/-MUiGW9TSrNdzC8IIf0B" alt="" width="375"></div>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.thunkable.com/blocks/blocks/device.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
