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

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:
  [JavaSignature('android/widget/Toast')]
JToast = interface(JObject)
['{0B64412E-EB8B-46ED-A692-79F3CFE6F159}']
{Methods}
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;
end;

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

Exit mobile version