# Utilities

We describe other functions provided by Monaca.

| Method/Property                             | Description                                |
| ------------------------------------------- | ------------------------------------------ |
| [monaca.getDeviceId()](#monaca-getdeviceid) | Get the unique device ID                   |
| [monaca.baseUrl](#monaca-baseurl)           | Get absolute URL to www folder.            |
| [monaca.isAndroid](#monaca-isandroid)       | Check whether the device is Android or not |
| [monaca.isIOS](#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!");
}
```
