The Device blocks gather useful data from the device (Android / iOS, online / offline, time and date) as well as set the phone to vibrate.

Get Current Time and Date

At the moment, all the dates and times are in numerical format i.e. month = 1 rather than month = Jan. If you want to convert the numbers into names, we suggest you to add a Local DB component and a simple table like the ones shown below.

Add a Local DB component that maps the numerical month with the names
Because the minutes can be less than one digit and digital clocks always show two, there's an additional conditional block to account for the case when the minute is less than double digits

Get Mobile Operating System

Since Thunkable Cross Platform โœ• works on both Android and iOS from a single project, there may be times when you want to modify your user experience depending on their mobile operating system. To do so, you can use the block below:

To see how this might work in your app, take a look at the blocks below:

Get Online/Offline Status

There may be times you may want to design a different experience when a user is offline. To detect a user's connection, you can simply use the blocks below:

Set Device to Vibrate

Apps often work in the background and vibrating a device is a popular way of notifying a user of a certain event. To set your device to vibrate, you can use the block sample below:

Dismiss Keyboard

If you have a Text Input in your app, there may be situations when you want to dismiss the keyboard for the user. The block below will help with that: