There are three main ways that you can send a notification to the user:

Toasts

A toast is a subtle, usually temporary, pop-up notification to let the user know that something is happening or has just happened.

These are useful to show when you are performing asynchronous actions such as loading or saving data.

You show one using showToast().

Confirmations

Analogous to the window.confirm() function in web browser JavaScript. The popup is modal.

It is useful when you need to get a yes/no answer back from the user, e.g. “Are you sure you want to delete this item?”.

You show one using confirm().

Alerts

Analogous to the window.alert() function in web browser JavaScript. The popup is modal.

It is useful when you forcefully let the user know that something has happened.

You show one using alert().