Show: Delphi C++
Display Preferences

Using the Built-in RAD Studio Java Libraries for Android

From RAD Studio
Jump to: navigation, search

Go Up to Using Java Libraries in Your RAD Studio Android Apps


The RAD Studio installation includes a set of Java libraries that are required by FireMonkey as a whole or by certain components and platform services of FireMonkey. RAD Studio also provides one or more Delphi units and C++ header files for each one of those Java libraries. You can include those Delphi or C++ files in your RAD Studio applications to access the API of the underlying Java libraries.

The RAD Studio installation also includes a classes.dex file, which is the result of converting this set of Java libraries into a single Dalvik Executable file. RAD Studio includes the classes.dex file in your applications by default when you deploy your applications for the Android target platform. This file allows your RAD Studio applications to interact with the Android API and the rest of the built-in RAD Studio Java libraries at run time.

List of Built-in RAD Studio Java Libraries for Android

The RAD Studio installation includes the following Java libraries:

Library Native Files Description

Android API

Androidapi.JNI.App
Androidapi.JNI.Dalvik
Androidapi.JNI.GraphicsContentViewText
Androidapi.JNI.Hardware
Androidapi.JNI.InputMethodService
Androidapi.JNI.Java.Security
Androidapi.JNI.JavaTypes
Androidapi.JNI.Location
Androidapi.JNI.Media
Androidapi.JNI.Net
Androidapi.JNI.OpenGL
Androidapi.JNI.Os
Androidapi.JNI.Provider
Androidapi.JNI.Telephony
Androidapi.JNI.Util
Androidapi.JNI.VideoView
Androidapi.JNI.Webkit
Androidapi.JNI.Widget

API of the Android platform.

Android Support

Androidapi.JNI.Support

Set of libraries that provide a wide array of different features for Android programming.

FireMonkey

Androidapi.JNI.Embarcadero

Library that provides the core functionality required by the FireMonkey Application Platform on the Android platform.

Google Mobile Ads

Androidapi.JNI.AdMob

SDK of the Google Mobile Ads service.

Google Analytics

Androidapi.JNI.Analytics

SDK of the Google Analytics service.

Google Play Application Licensing

Androidapi.JNI.Licensing

License Verification Library, a collection of helper classes to simplify adding licensing to an Android application.

Google Play In-app Billing

Androidapi.JNI.InAppBilling

API of the Google Play In-app Billing service.

Google Play Services

Androidapi.JNI.PlayServices

API of the Google Play services.

APK Expansion

Androidapi.JNI.ApkExpansion

SDK for hosting Android APK expansion files on the Google Play servers.

Cloud Messaging

Androidapi.JNI.PlayServices.GCM

SDK of the Google Cloud Messaging service.

The FireMonkey Java library is an Embarcadero library. The APK Expansion and Cloud Messaging Java libraries are third-party libraries that include modifications by Embarcadero. The rest of the Java libraries listed in the table above are unmodified third-party libraries.

The files in the Native Files column are the files that you can include in your RAD Studio applications to access the APIs of these Java libraries from your native code. You can find these files in the following paths within the RAD Studio installation folder (C:\Program Files (x86)\Embarcadero\Studio\19.0):

  • Delphi units: source\rtl\android (.pas file extension)
  • C++ header files: include\android\rtl (.hpp file extension)

Some of the features of the third-party Java libraries may require:

Check the official documentation of each third-party library for more information.

Disabling Unnecessary Built-in RAD Studio Java Libraries to Decrease the Size of Your Application

By default, the classes.dex file of any Android application created using RAD Studio includes all the Java libraries listed in the table above. While this ensures that your application always works, it also increases the size of your application package.

If you know for sure that your application does not use some of these built-in Java libraries, such as those for advertising or analytics, you can remove those unnecessary libraries from your project so that they are not included in your application package anymore. You can always add them back later if you need them as your application provides new features.

To remove a built-in Java library from your project:

  1. On the Project Manager, expand the Libraries node within Target Platforms > Android.
  2. Right-click the Java library file that you do not want to include in the classes.dex file of your application.
  3. Select Disable to disable the selected Java library file.
    ProjectManagerAndroidLibrariesDisable.png

To enable a previously-disabled built-in library, repeat these steps but select Enable instead of Disable.

See Also

Samples

Personal tools
RAD Studio 10.2 Tokyo
In other languages
Previous Versions
Assistance