Get access to over 100 FireMonkey cross platform samples for Android, IOS, OSX, Windows, and Linux!


Utility To Create Delphi XE5 Firemonkey Interfaces For Android APIs

| Delphi 11 10 XE8 XE7 XE Seattle Berlin Tokyo Rio Firemonkey Delphi Android Delphi IOS

Delphi XE5 Firemonkey Java Class Import Android | Delphi 11 10 XE8 XE7 XE Seattle Berlin Tokyo Rio Firemonkey Delphi Android Delphi IOSErik Salaj over at Winsoft has a utility that will create an interface for an Android Java class file. This tool is similar to the tool that will create an interface for an entire JAR file except that it just does one Java class file at a time. It is a commercial utility but there is a free trial available so you can see if it is going to work for your use before you purchase. It comes with two Android APIs imported already as examples and those APIs are the Toast API and the BatteryManager API. I’d like to see it come with some more documentaiton on how exactly to use the tool but other then that if you need to import Java classes from Android for use in your Delphi XE5 Firemonkey app this might do the trick for you. Here is some sample code that the utility generated from the Android Toast API:
JToast = interface(JObject)
procedure cancel; cdecl;
function getDuration: Integer; cdecl;
function getGravity: Integer; cdecl;
function getHorizontalMargin: Single; cdecl;
function getVerticalMargin: Single; cdecl;
function getView: JView; cdecl;
function getXOffset: Integer; cdecl;
function getYOffset: Integer; cdecl;
procedure setDuration(duration: Integer); cdecl;
procedure setGravity(gravity: Integer; xOffset: Integer; yOffset: Integer); cdecl;
procedure setMargin(horizontalMargin: Single; verticalMargin: Single); cdecl;
procedure setText(resId: Integer); cdecl; overload;
procedure setText(s: JCharSequence); cdecl; overload;
procedure setView(view: JView); cdecl;
procedure show; cdecl;

Head over and check out the trial version of the Java class importer utility.

Have Delphi Firemonkey questions? Ask and get answers on StackOverflow.

Related posts

AutoBlogAI: FireMonkey Client To Leverage LLMs And Generative AI For Blogging


Unleashing Creativity With Song Writer AI: A Deep Dive


How To Build Stable Diffusion Text To Image Prompts


FireMonkey 10.4.2 Features Updated iOS 14, Android 11, And macOS 11 Support Plus Hundreds Of Fixes

Sign up for our Newsletter and
stay informed

Leave a Reply