Android and iOS API

Full Access to Android and iOS API using Delphi FireMonkey

Description :  You will learn how to get full access to Android and iOS API in your application using Delphi FireMonkey.
Objective: Get full access to Android and iOS API in FireMonkey.
Presenter: Brian Long from Brian Long Consultancy & Training Services Ltd
Event: CodeRage 8 and Brian Long’s Blog.
Software Versions Supported: Delphi XE5 / XE6, Appmethod
Level: Intermediate
Source code: Source code from Accessing the iOS API session and Accessing the Android API session.  Also download full set of Android SDK Object Pascal interface files on Github.

There are thousands of components and libraries (both free, commercial and open source) available for Firemonkey.  However, there will be times you will need functionality for your application that are no readily available libraries and components for. For example, you may need additional functionality for the media player component that comes out of the box with Rad Studio XE5 and XE6.  Functionality such as streaming from a remote server (on-demand) or even streaming a live event. You may also want to access methods in the AudioRecord class in Android for audio capture, but unfortunately there are no out of the box solutions currently in Rad Studio.

Embarcadero has done and is continuing to do a great job with FireMonkey to make sure it has all the essential library necessary from iOS and Android APIs.  And given time, I am sure developers will get full access to these APIs out of the box.  In the meantime, there is another way to get access to these additional APIs in your application.

Brian Long from Brian Long Consultancy & Training Services Ltd did two very interesting presentations at Coderage 8 where he did an excellent job (for such a complex topic) explaining how to access the Android and iOS API directly.  These videos are based on Delphi XE5, but since then, Brian has written two extensive articles, explaining some of the topics he covered in these videos, and the necessary updates for Delphi XE6.  After watching the videos, read Brian Long’s “Creating a splash screen for Delphi XE6 Android apps” and “Launching activities and handling results in Delphi XE6 Android apps” articles.

To bring out full access to iOS and Android APIs, an Object Pascal interface file must be created.  This interface file is the bridge to connect the Object Pascal world to the JAVA and Objective C world.  There are currently three different automated solutions available for Android to help with this process. I am not aware of any for iOS as yet. The three automated tools are  Android2Delphi (paid version – bitcoins only), Java2pas (free & paid version) and JavaImport for Android (paid version only). has also gone ahead and used Java2pas against the entire set of android.jar files for Android 7, Android 8, Android 10, Android 12, Android 14, Android 15, Android 16, Android 17, and Android 19.  You can read his blog post on Full Android SDK Interface Files In Object Pascal For Firemonkey.

Accessing the iOS API by Brian Long from Long Consultancy & Training Services Ltd

Accessing the Android API by Brian Long from Long Consultancy & Training Services Ltd

Leave a Reply