Creating an Android App

This page describes how to develop multi-device applications that target the Android platform. See Android Mobile Application Development for topics that are not specific to the development phase, such as configuring your PC and Android devices to work with RAD Studio.

To create a multi-device app that supports Android:

Then select a multi-device application type in the Multi-Device Application wizard.

Component Restrictions for FireMonkey Android Apps

While you are designing your Android app in RAD Studio, you can only use components that are supported on Android devices. When Android is the active target platform of your project, unsupported components are grayed out on the Tool Palette.

Style Selector

StylesFormDes.png

At the top of the multi-device Form Designer is the style selector:

The style selector's drop-down menu lists all the styles that you can apply to the Master view.

Select the Android style from the style selector to see all the properties on the components according to the target platform.

View Selector

ViewsFormDes.png

At the top of the multi-device Form Designer is the view selector:

The view selector's drop-down menu lists all the available views, which show the different platforms, such as iOS, Android, Windows and macOS.

Use the Master form for a general design of your application. Then you can add new views to your project in order to customize your application for a specific device type. You can even create new customized views; see Adding a Customized View to the View Selector. The predefined Android device views are:

Note: For more information about the resolution of the predefined views see Display Specifications.

Note: Select the Android target platform to see all the available components for Android, otherwise they appear grayed out.

Add new views to your project in order to customize your application for a specific Android device type. All the views inherit the components and properties from the Master form. For more information see Form Designer.

If you want to customize some aspects of your application for all Android devices you can do it using the Master form, provided you do not want to propagate to the rest of platforms. Otherwise use the Code Editor, for example:

// You will see the changes applied at run-time. SpeedButton1.StyleLookup := priortoolbutton;

For more information:

Using Frameworks in Android Apps

FireMonkey

The FireMonkey framework is ideal for the Android target platform, and it supports other target platforms as well.

VCL (not available for Android)

The Visual Component Library (VCL) is available only on Windows (32-bit or 64-bit).

RTL

Some run-time library (RTL) units that provide basic functionality are common for every supported target platform (including Android), such as System.pas or System.SysUtils.pas.

A number of RTL units are Android-only (see Android API and Java Libraries). These units are prefixed with the Androidapi unit scope.

Android API and Java Libraries

The RTL contains a number of units that provide Delphi and C++ interfaces to the Android native API. These units are scoped with Androidapi and are typically located in the source\rtl\android\ directory of your RAD Studio installation. The FireMonkey framework relies on some of these units. You may also use them directly if you want.

You can also use parts of the Android API that are not mapped by the RTL, or use your own Java libraries in your project: