Using the Built-in Appmethod Java Libraries for Android
Go Up to Using Java Libraries in Your Appmethod Android Apps
The Appmethod installation includes a set of Java libraries that are required by FireMonkey as a whole or by certain components and platform services of FireMonkey. Appmethod also provides one or more Object Pascal units and C++ header files for each one of those Java libraries. You can include those Object Pascal or C++ files in your Appmethod applications to access the API of the underlying Java libraries.
The Appmethod installation also includes a classes.dex
file, which is the result of converting this set of Java libraries into a single Dalvik Executable file. Appmethod includes the classes.dex
file in your applications by default when you deploy your applications for the Android target platform. This file allows your Appmethod applications to interact with the Android API and the rest of the built-in Appmethod Java libraries at run time.
Contents
List of Built-in Appmethod Java Libraries for Android
The Appmethod installation includes the following Java libraries:
Library | Native Files | Description |
---|---|---|
|
API of the Android platform. | |
|
Set of libraries that provide a wide array of different features for Android programming. | |
|
Library that provides the core functionality required by the FireMonkey Application Platform on the Android platform. | |
|
SDK of the Google Mobile Ads service. | |
|
SDK of the Google Analytics service. | |
|
License Verification Library, a collection of helper classes to simplify adding licensing to an Android application. | |
|
API of the Google Play In-app Billing service. | |
|
API of the Google Play services. | |
|
SDK for hosting Android APK expansion files on the Google Play servers. | |
|
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 Appmethod applications to access the APIs of these Java libraries from your native code. You can find these files in the following paths within the Appmethod installation folder (C:\Program Files (x86)\Embarcadero\Studio\17.0
):
- Object Pascal 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:
- Adding Uses Permissions to your Android applications.
- Customizing the
AndroidManifest.xml
file of your Android application.
Check the official documentation of each third-party library for more information.
Disabling Unnecessary Built-in Appmethod Java Libraries to Decrease the Size of Your Application
By default, the classes.dex
file of any Android application created using Appmethod 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:
- On the Project Manager, expand the Libraries node within Target Platforms > Android.
- Right-click the Java library file that you do not want to include in the
classes.dex
file of your application. - Select Disable to disable the selected Java library file.
To enable a previously-disabled built-in library, repeat these steps but select Enable instead of Disable.
See Also
Samples
- FireMonkey Device Info sample