Class

# MobileApplication

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

## Description

The base class for mobile applications.

## Properties

<div class="rst-class">

table-centered_columns_3_and_4

</div>

| Name                                                           | Type                                                    | Read-Only | Shared |
|----------------------------------------------------------------|---------------------------------------------------------|-----------|--------|
| `AndroidContextHandle<mobileapplication.androidcontexthandle>` | `Ptr</api/data_types/additional_types/ptr>`             | ✓         |        |
| `BugVersion<mobileapplication.bugversion>`                     | `Integer</api/data_types/integer>`                      | ✓         |        |
| `BuildDateTime<mobileapplication.builddatetime>`               | `DateTime</api/data_types/datetime>`                    | ✓         |        |
| `CurrentLayout<mobileapplication.currentlayout>`               | `iOSLayout</api/ios/ioslayout>`                         | ✓         |        |
| `CurrentScreen<mobileapplication.currentscreen>`               | `MobileScreen</api/user_interface/mobile/mobilescreen>` |           |        |
| `DefaultiPadScreen<mobileapplication.defaultipadscreen>`       | `iOSLayout</api/ios/ioslayout>`                         | ✓         |        |
| `DefaultiPhoneScreen<mobileapplication.defaultiphonescreen>`   | `iOSLayout</api/ios/ioslayout>`                         | ✓         |        |
| `DefaultPhoneScreen<mobileapplication.defaultphonescreen>`     | `MobileScreen</api/user_interface/mobile/mobilescreen>` |           |        |
| `DefaultTabletScreen<mobileapplication.defaulttabletscreen>`   | `MobileScreen</api/user_interface/mobile/mobilescreen>` |           |        |
| `GoogleMapsAPIKey<mobileapplication.googlemapsapikey>`         | `String</api/data_types/string>`                        |           |        |
| `IconBadgeNumber<mobileapplication.iconbadgenumber>`           | `Integer</api/data_types/integer>`                      |           |        |
| `MajorVersion<mobileapplication.majorversion>`                 | `Integer</api/data_types/integer>`                      | ✓         |        |
| `MinorVersion<mobileapplication.minorversion>`                 | `Integer</api/data_types/integer>`                      | ✓         |        |
| `NonReleaseVersion<mobileapplication.nonreleaseversion>`       | `Integer</api/data_types/integer>`                      | ✓         |        |
| `StageCode<mobileapplication.stagecode>`                       | `Integer</api/data_types/integer>`                      | ✓         |        |
| `TintColor<mobileapplication.tintcolor>`                       | `ColorGroup</api/graphics/colorgroup>`                  |           |        |
| `Version<mobileapplication.version>`                           | `String</api/data_types/string>`                        | ✓         |        |

## Methods

<div class="rst-class">

table-centered_column_4

</div>

| Name                                                       | Parameters                                                                                                                                                                                                                                                                     | Returns | Shared |
|------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------|--------|
| `AddShortcut<mobileapplication.addshortcut>`               | identifier As `String</api/data_types/string>`, title As `String</api/data_types/string>`, subtitle As `String</api/data_types/string>` = "", iconName As `String</api/data_types/string>` = "", userInfo As `Dictionary</api/language/dictionary>` = `Nil</api/language/nil>` |         |        |
| `RemoveAllShortcuts<mobileapplication.removeallshortcuts>` |                                                                                                                                                                                                                                                                                |         |        |

## Events

<div class="rst-class">

table-centered_column_4

</div>

| Name                                                             | Parameters                                                                                                                                                                                 | Returns                            |
|------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------|
| `Activated<mobileapplication.activated>`                         |                                                                                                                                                                                            |                                    |
| `Closing<mobileapplication.closing>`                             |                                                                                                                                                                                            |                                    |
| `Deactivating<mobileapplication.deactivating>`                   |                                                                                                                                                                                            |                                    |
| `HandleBackgroundURL<mobileapplication.handlebackgroundurl>`     | identifier As `String</api/data_types/string>`                                                                                                                                             |                                    |
| `HandleShortcut<mobileapplication.handleshortcut>`               | identifier As `String</api/data_types/string>`, userInfo As `String</api/language/dictionary>`                                                                                             | `Boolean</api/data_types/boolean>` |
| `HandleURL<mobileapplication.handleurl>`                         | url As `String</api/data_types/string>`, identifier As `String</api/data_types/string>`, annotation As `String</api/data_types/string>`, openInPlace As `Boolean</api/data_types/boolean>` | `Boolean</api/data_types/boolean>` |
| `LaunchOptions<mobileapplication.launchoptions>`                 | launchOptions As `Ptr</api/data_types/additional_types/ptr>`                                                                                                                               | `Boolean</api/data_types/boolean>` |
| `LowMemoryWarning<mobileapplication.lowmemorywarning>`           |                                                                                                                                                                                            |                                    |
| `Opening<mobileapplication.opening>`                             |                                                                                                                                                                                            |                                    |
| `SignificantTimeChange<mobileapplication.significanttimechange>` |                                                                                                                                                                                            |                                    |
| `UnhandledException<mobileapplication.unhandledexception>`       | exc As `RuntimeException</api/exceptions/runtimeexception>`                                                                                                                                | `Boolean</api/data_types/boolean>` |

## Property descriptions

<div id="mobileapplication.androidcontexthandle">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

MobileApplication.AndroidContextHandle

**AndroidContextHandle** As `Ptr</api/data_types/additional_types/ptr>`

> Returns a `Ptr</api/data_types/additional_types/ptr>` that can be passed to libraries that require it.
>
> This property is read-only.
>
> <div class="important">
>
> <div class="title">
>
> Important
>
> </div>
>
> This property is supported for Android only.
>
> </div>

<div id="mobileapplication.bugversion">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

MobileApplication.BugVersion

**BugVersion** As `Integer</api/data_types/integer>`

> The version you increment when the release of your application is only to fix critical and unexpected bugs in the previous release.
>
> This property is read-only.
>
> This can only be set in the IDE, but you can read the value in your code.
>
> Typically version numbers are written as 1.2.3.4 (MajorVersion.MinorVersion.BugVersion.NonReleaseVersion).
>
> Puts all the individual versions together to create the full version:
>
> ``` xojo
> Var fullVersion As String
> fullVersion = app.MajorVersion.ToString + "." + app.MinorVersion.ToString + "." _
> + app.BugVersion.ToString + "." + app.NonReleaseVersion.ToString
> ```

<div id="mobileapplication.builddatetime">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

MobileApplication.BuildDateTime

**BuildDateTime** As `DateTime</api/data_types/datetime>`

> Contains the date and time when the application was built.
>
> This property is read-only.
>
> The following code gets the build date/time and displays it in a `Label</api/user_interface/mobile/mobilelabel>`.
>
> ``` xojo
> Var d As DateTime
> d = App.BuildDateTime
>
> Label1.Text = d.ToString
> ```

<div id="mobileapplication.currentlayout">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

MobileApplication.CurrentLayout

**CurrentLayout** As `iOSLayout</api/ios/ioslayout>`

> The currently displayed layout. You can use this property to access the current layout so that you can change its content.
>
> This property is read-only.
>
> The layout is typically the base (first) screen that was displayed in a phone app. It may also refer to a Split screen or a Tab screen.
>
> In most cases you will want to use the `MobileScreen<mobilescreen.show>` method to display a new screen over the initial screen. This retains the screen hierarchy and allows the back button to go back to the previous screen.
>
> There may be times when you need to replace the entire screen/layout and do not want the screen hierarchy. For example, you may have an initial login screen that is displayed but after the user successfully logs in and you want to replace that screen with another screen so that the back button does not return the user to the login screen.
>
> <div class="important">
>
> <div class="title">
>
> Important
>
> </div>
>
> This property is supported for iOS only.
>
> </div>
>
> You can directly change the layout content like this to swap in a new screen:
>
> ``` xojo
> Var myNewScreen As New MyScreen
> App.CurrentLayout.Content = myNewScreen
> ```
>
> Use the same technique to swap in a new `MobileScreen</api/user_interface/mobile/mobilescreen>`, `iOSLayout</api/ios/ioslayout>`, `iOSSplitView</api/ios/iossplitview>` or `iOSTabBar</api/ios/iostabbar>`. For example, this swaps in a new screen:
>
> ``` xojo
> Var s As New MySpecialScreen
> App.CurrentLayout.Content = s.Content
> ```

<div id="mobileapplication.currentscreen">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

MobileApplication.CurrentScreen

**CurrentScreen** As `MobileScreen</api/user_interface/mobile/mobilescreen>`

> The currently displayed screen. You can use this property to access the current screen so that you can change its content.
>
> The screen is typically the base (first) screen that was displayed in a phone app. It may also refer to a Split screen or a Tab screen.
>
> In most cases you will want to use the `MobileScreen<mobilescreen.show>` method to display a new screen over the initial screen. This retains the screen hierarchy and allows the back button to go back to the previous screen.
>
> There may be times when you need to replace the entire screen and do not want the screen hierarchy. For example, you may have an initial login screen that is displayed but after the user successfully logs in and you want to replace that screen with another screen so that the back button does not return the user to the login screen.
>
> <div class="important">
>
> <div class="title">
>
> Important
>
> </div>
>
> This property is supported for Android only.
>
> </div>
>
> You can directly change the current screen to swap in a new screen:
>
> ``` xojo
> Var myNewScreen As New MyScreen
> App.CurrentScreen = myNewScreen
> ```

<div id="mobileapplication.defaultipadscreen">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

MobileApplication.DefaultiPadScreen

**DefaultiPadScreen** As `iOSLayout</api/ios/ioslayout>`

> Set to the default screen to use when the app is launched on an iPad-sized device.
>
> This property is read-only.
>
> <div class="important">
>
> <div class="title">
>
> Important
>
> </div>
>
> This property is supported for iOS only.
>
> </div>
>
> If no DefaultiPadScreen is specified, the app will still run on an iPad but will use the DefaultiPhoneScreen, running it in "scaled" mode.
>
> One or both of DefaultiPhoneScreen and DefaultiPadScreen must be specified.
>
> By specifying separate screens for DefaultiPhoneScreen and DefaultiPadScreen, you can have completely different layouts for each type of device.

<div id="mobileapplication.defaultiphonescreen">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

MobileApplication.DefaultiPhoneScreen

**DefaultiPhoneScreen** As `iOSLayout</api/ios/ioslayout>`

> Set to the default screen to use when the app is launched on an iPhone-sized device.
>
> This property is read-only.
>
> <div class="important">
>
> <div class="title">
>
> Important
>
> </div>
>
> This property is supported for iOS only.
>
> </div>
>
> If you do not specify a DefaultiPhoneScreen, then the app will not run on iPhone-sized devices.
>
> One or both of DefaultiPhoneScreen and DefaultiPadScreen must be specified.
>
> By specifying separate screens for DefaultiPhoneScreen and DefaultiPadScreen, you can have completely different layouts for each type of device.

<div id="mobileapplication.defaultphonescreen">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

MobileApplication.DefaultPhoneScreen

**DefaultPhoneScreen** As `MobileScreen</api/user_interface/mobile/mobilescreen>`

> Set to the default screen to use when the app is launched on a phone-sized device.
>
> This property is read-only.
>
> <div class="important">
>
> <div class="title">
>
> Important
>
> </div>
>
> This property is supported for Android only.
>
> </div>
>
> By specifying separate screens for DefaultPhoneScreen and DefaultTabletScreen, you can have completely different layouts for each type of device.

<div id="mobileapplication.defaulttabletscreen">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

MobileApplication.DefaultTabletScreen

**DefaultTabletScreen** As `MobileScreen</api/user_interface/mobile/mobilescreen>`

> Set to the default screen to use when the app is launched on an tablet-sized device.
>
> This property is read-only.
>
> <div class="important">
>
> <div class="title">
>
> Important
>
> </div>
>
> This property is supported for Android only.
>
> </div>
>
> By specifying separate screens for DefaultPhoneScreen and DefaultTabletScreen, you can have completely different layouts for each type of device.

<div id="mobileapplication.googlemapsapikey">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

MobileApplication.GoogleMapsAPIKey

**GoogleMapsAPIKey** As `String</api/data_types/string>`

> The Google Maps API key from your Google Developer Account is required to display Google Maps in Android apps.
>
> For testing purposes during development, the key `demo_map_id` can be used.
>
> This is a **design-time-only** property.
>
> <div class="important">
>
> <div class="title">
>
> Important
>
> </div>
>
> This property is supported for Android only.
>
> </div>
>
> <div class="note">
>
> <div class="title">
>
> Note
>
> </div>
>
> The `demo_map_id` is not intended for use in production applications and cannot be used for features which require cloud configuration (such as Cloud-based maps styling).
>
> </div>

<div id="mobileapplication.iconbadgenumber">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

MobileApplication.IconBadgeNumber

**IconBadgeNumber** As `Integer</api/data_types/integer>`

> The number that appears in the badge on the application's icon.
>
> A badge will only appear if the value is greater than 0.
>
> <div class="important">
>
> <div class="title">
>
> Important
>
> </div>
>
> This property is supported for iOS only.
>
> </div>
>
> When building with Xojo 2021r3 and later versions, your app will be required to get permission to update the badge from the Notification Center.
>
> ``` xojo
> App.IconBadgeNumber = App.IconBadgeNumber + 1
> ```

<div id="mobileapplication.majorversion">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

MobileApplication.MajorVersion

**MajorVersion** As `Integer</api/data_types/integer>`

> The version to be incremented when the release includes many large new features.
>
> This property is read-only.
>
> This can only be set in the IDE, but you can read the value in your code.
>
> Typically version numbers are written as 1.2.3.4 (MajorVersion.MinorVersion.BugVersion.NonReleaseVersion).
>
> Puts all the individual versions together to create the full version:
>
> ``` xojo
> Var fullVersion As String
> fullVersion = App.MajorVersion.ToString + "." + App.MinorVersion.ToString + "." _
> + App.BugVersion.ToString + "." + App.NonReleaseVersion.ToString
> ```

<div id="mobileapplication.minorversion">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

MobileApplication.MinorVersion

**MinorVersion** As `Integer</api/data_types/integer>`

> The version you increment when the release is does not add any major features.
>
> This property is read-only.
>
> This can only be set in the IDE, but you can read the value in your code.
>
> Typically version numbers are written as 1.2.3.4 (MajorVersion.MinorVersion.BugVersion.NonReleaseVersion).
>
> Puts all the individual versions together to create the full version:
>
> ``` xojo
> Var fullVersion As String
> fullVersion = app.MajorVersion.ToString + "." + app.MinorVersion.ToString + "." _
> + app.BugVersion.ToString + "." + app.NonReleaseVersion.ToString.
> ```

<div id="mobileapplication.nonreleaseversion">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

MobileApplication.NonReleaseVersion

**NonReleaseVersion** As `Integer</api/data_types/integer>`

> The version you increment each time you build your project.
>
> This property is read-only.
>
> This can only be set in the IDE, but you can read the value in your code.
>
> Some platforms also refer to this as the build or revision number.
>
> Typically version numbers are written as 1.2.3.4 (MajorVersion.MinorVersion.BugVersion.NonReleaseVersion).
>
> If AutoIncrementVersionInformation is checked, the IDE increases NonReleaseVersion by one each time you build your project, but not when you run it.
>
> If your app is rejected by the Apple App Store for something minor, you can resolve it then increment this number to sufficiently distinguish it from the version you previously submitted.
>
> Puts all the individual versions together to create the full version:
>
> ``` xojo
> Var fullVersion As String
> fullVersion = app.MajorVersion.ToString + "." + app.MinorVersion.ToString + "." _
> + app.BugVersion.ToString + "." + app.NonReleaseVersion.ToString.
> ```
>
> <div class="note">
>
> <div class="title">
>
> Note
>
> </div>
>
> For Android applications submitted to the Google Play Store, the NonReleaseVersion must always be a higher value than it was the last time the application was submitted.
>
> </div>

<div id="mobileapplication.stagecode">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

MobileApplication.StageCode

**StageCode** As `Integer</api/data_types/integer>`

> Stage Code of the application, corresponding to the version information.
>
> This property is read-only.
>
> Use the four Application class constants to set/get the Stage. Stage can be set only in the IDE.
>
> | Value | Description |
> |-------|-------------|
> | 0     | Development |
> | 1     | Alpha       |
> | 2     | Beta        |
> | 3     | Final       |

<div id="mobileapplication.tintcolor">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

MobileApplication.TintColor

**TintColor** As `ColorGroup</api/graphics/colorgroup>`

> The default tint color for the controls in the application.
>
> <div class="important">
>
> <div class="title">
>
> Important
>
> </div>
>
> This property is supported for iOS only.
>
> </div>

<div id="mobileapplication.version">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

MobileApplication.Version

**Version** As `String</api/data_types/string>`

> The version of the application.
>
> This property is read-only.

## Method descriptions

<div id="mobileapplication.addshortcut">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

MobileApplication.AddShortcut

**AddShortcut**(identifier As `String</api/data_types/string>`, title As `String</api/data_types/string>`, subtitle As `String</api/data_types/string>` = "", iconName As `String</api/data_types/string>` = "", userInfo As `Dictionary</api/language/dictionary>` = `Nil</api/language/nil>`)

> Adds a shortcut to the app's shortcut menu.
>
> <div class="important">
>
> <div class="title">
>
> Important
>
> </div>
>
> This method is supported for iOS only.
>
> </div>
>
> The shortcut menu is accessed by the user performing a long-press on the application's icon.
>
> If you're going to add shortcuts via code, you should add all of your shortcuts in the `Opening<mobileapplication.opening>` event.
>
> Shortcuts can also be added using the Xojo IDE's visual editor. Click on iOS under Build Settings in the Navigator, choose the Advanced tab and then click on the Options button next to Shortcut Items in the Inspector.
>
> ``` xojo
> Var credentials As New Dictionary
> d.Value("username") = user.Name
> d.Value("passwordHash") = user.PasswordHash
> App.AddShortcut("userlogin", "Login", "Connect to your account", "person-badge", credentials)
> ```

<div id="mobileapplication.removeallshortcuts">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

MobileApplication.RemoveAllShortcuts

**RemoveAllShortcuts**

> Removes all shortcuts from the application's shortcut menu.
>
> <div class="important">
>
> <div class="title">
>
> Important
>
> </div>
>
> This method is supported for iOS only.
>
> </div>
>
> ``` xojo
> app.RemoveAllShortcuts
> ```

## Event descriptions

<div id="mobileapplication.activated">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

MobileApplication.Activated

**Activated**

> The app is now frontmost.

<div id="mobileapplication.closing">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

MobileApplication.Closing

**Closing**

> The app is being closed by the OS.
>
> The OS will close an app if the device is running low on memory. If can also occur if the user force quits the application.
>
> The idea that an app quits on a mobile device is not one the user should be aware of. This means that in the Closing event, your app should store in a file any information about its current state so that when the app is relaunched, in the `Opening<mobileapplication.opening>` event, you can restore the app to its previous state. Keep in mind that the amount of time the OS will give you to store your current state in the Closing event will be very limited.

<div id="mobileapplication.deactivating">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

MobileApplication.Deactivating

**Deactivating**

> The app is being sent to the background.

<div id="mobileapplication.handlebackgroundurl">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

MobileApplication.HandleBackgroundURL

**HandleBackgroundURL**(identifier As `String</api/data_types/string>`)

> Called when the app is passed a URL and is not in the foreground.
>
> <div class="important">
>
> <div class="title">
>
> Important
>
> </div>
>
> This event is supported for iOS only.
>
> </div>

<div id="mobileapplication.handleshortcut">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

MobileApplication.HandleShortcut

**HandleShortcut**(identifier As `String</api/data_types/string>`, userInfo As `String</api/language/dictionary>`) As `Boolean</api/data_types/boolean>`

> Called when the user has chosen an item from the app's shortcut menu.
>
> The shortcut menu is displayed when the user performs a long-press on the application's icon.
>
> <div class="important">
>
> <div class="title">
>
> Important
>
> </div>
>
> This event is supported for iOS only.
>
> </div>

<div id="mobileapplication.handleurl">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

MobileApplication.HandleURL

**HandleURL**(url As `String</api/data_types/string>`, identifier As `String</api/data_types/string>`, annotation As `String</api/data_types/string>`, openInPlace As `Boolean</api/data_types/boolean>`) As `Boolean</api/data_types/boolean>`

> Called when your app is passed a URL.
>
> To add a URL scheme to your app, click on iOS under Build Settings in the Navigator then click on the Advanced tab in the Inspector. Enable Custom URL Schemes then click the Options button to add one. The scheme is the portion of the URL before the colon. For example, to add a scheme called *feedback* using with *createcase* as the path, enter *feedback://createcase*.
>
> <div class="important">
>
> <div class="title">
>
> Important
>
> </div>
>
> This event is supported for iOS only.
>
> </div>

<div id="mobileapplication.launchoptions">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

MobileApplication.LaunchOptions

**LaunchOptions**(launchOptions As `Ptr</api/data_types/additional_types/ptr>`) As `Boolean</api/data_types/boolean>`

> Called when the app is launched.
>
> The *launchOptions* parameter points to a NSDictionary provided by iOS. Use Declares to read this information. More information on this NSDictionary can be found in Apple's [documentation](https://developer.apple.com/documentation/uikit/uiapplicationlaunchoptionskey?language=objc).
>
> If your app is being called to handle a `URL<mobileapplication.handleurl>`, a `background URL<mobileapplication.handlebackgroundurl>` or a `shortcut<mobileapplication.handleshortcut>`, implement those events instead.
>
> If you are implementing this event to handle something else, return `True</api/language/true>` if your app will handle the request and `False</api/language/false>` if it will not.
>
> <div class="important">
>
> <div class="title">
>
> Important
>
> </div>
>
> This event is supported for iOS only.
>
> </div>

<div id="mobileapplication.lowmemorywarning">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

MobileApplication.LowMemoryWarning

**LowMemoryWarning**

> Called when the OS reports a low-memory situation. Apps should attempt to free up objects and other resources when this event is raised. If the low-memory situation persists, the OS may kill your app.
>
> Your implementation of this method should free up as much memory as possible by purging cached data objects that can be recreated (or reloaded from disk) later. It is strongly recommended that you implement this method. If your app does not release enough memory during low-memory conditions, the system may terminate it outright.

<div id="mobileapplication.opening">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

MobileApplication.Opening

**Opening**

> Called when the app is first launched.

<div id="mobileapplication.significanttimechange">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

MobileApplication.SignificantTimeChange

**SignificantTimeChange**

> Called when the device's clock has made a significant time change.
>
> Significant time changes include each night at midnight, the change to/from Daylight Savings Time (in areas that recognize it), carrier updates and when the device moves from one time zone to another.

<div id="mobileapplication.unhandledexception">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

MobileApplication.UnhandledException

**UnhandledException**(exc As `RuntimeException</api/exceptions/runtimeexception>`) As `Boolean</api/data_types/boolean>`

> Called if the app had an exception and did not handle it. If the event is not implemented or the event handler returns `False</api/language/false>`, the application will terminate.
>
> <div class="note">
>
> <div class="title">
>
> Note
>
> </div>
>
> On Android, nothing that displays user interface (such as `MessageBox</api/user_interface/messagebox>`) is supported for this event.
>
> </div>
>
> <div class="important">
>
> <div class="title">
>
> Important
>
> </div>
>
> Android apps cannot continue after the UnhandledException event occurs. The app will always quit. Returning `True</api/language/true>` or `False</api/language/false>` from this event has no effect.
>
> </div>

## Notes

### Changing your app name via code at build time

You can change the iOS App Name using an IDE Script like this:

``` xojo
PropertyValue("App.iOSAppName") = "MyApp"
```

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

### Accepting files shared via other apps

To accept files shared with your app from other iOS apps, make sure you have defined a file type you wish to be able to receive. When the user shares a file with your app (via the Files app or the Sharing Panel), the `HandleURL<mobileapplication.handleurl>` event will fire with the file will be passed as a file URL.

## Compatibility

|                       |        |
|-----------------------|--------|
| **Project Types**     | Mobile |
| **Operating Systems** | All    |

<div class="seealso">

`Object</api/data_types/additional_types/object>` parent class; `iOSLayout</api/ios/ioslayout>`, `iOSSplitView</api/ios/iossplitview>`, `iOSTabBar</api/ios/iostabbar>`

</div>
