# Utilities

We describe other functions provided by Monaca.

| Method/Property                                                             | Description                                |
| --------------------------------------------------------------------------- | ------------------------------------------ |
| [monaca.getDeviceId()](/reference/monaca_api/utility.md#monaca-getdeviceid) | Get the unique device ID                   |
| [monaca.baseUrl](/reference/monaca_api/utility.md#monaca-baseurl)           | Get absolute URL to www folder.            |
| [monaca.isAndroid](/reference/monaca_api/utility.md#monaca-isandroid)       | Check whether the device is Android or not |
| [monaca.isIOS](/reference/monaca_api/utility.md#monaca-isios)               | Check the device is iOS or not             |

## monaca.getDeviceId()

Get the unique device ID which has been created randomly.

{% hint style="info" %}
Monaca framework automatically creates a unique device ID at the first time app launch.
{% endhint %}

```bash
monaca.getDeviceId(callback)
```

**Parameter**

| Parameter  | Type     | Description                                                |
| ---------- | -------- | ---------------------------------------------------------- |
| `callback` | Function | A callback function where device ID is the first parameter |

**Return Value**

* None

**Example**

```javascript
monaca.getDeviceId(function(id){
   console.log('Device ID: ' + id);
});
```

## monaca.baseUrl

Get an absolute URL to `www` folder.

```bash
monaca.baseUrl
```

**Return Value**

| Type   | Description                     |
| ------ | ------------------------------- |
| String | The absolute URL of application |

**Example**

```javascript
window.onload = function()
{
   alert(monaca.baseUrl);
}
```

## monaca.isAndroid

Check whether the device is an Android device or not.

```bash
monaca.isAndroid
```

**Return Value**

| Type    | Description                                                 |
| ------- | ----------------------------------------------------------- |
| boolean | The device is Android device if the return value is *true*. |

**Example**

```javascript
if(monaca.isAndroid === true){
  alert("Android!");
}
```

## monaca.isIOS

Check whether the device is an iOS device or not .

```bash
monaca.isIOS
```

**Return Value**

| Type      | Description                                             |
| --------- | ------------------------------------------------------- |
| `boolean` | The device is iOS device if the return value is *true*. |

**Example**

```javascript
if(monaca.isIOS === true){
  alert("iOS!");
}
```


---

# 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://en.docs.monaca.io/reference/monaca_api/utility.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.
