JavaImport for Android 3.2 Full Source
JavaImport for Android 3.2 Full Source | 459 kB
Converts Java .jar files, .class files and folders to Delphi/C++ Builder units for Android.
To convert .jar file, rename it to .zip file, unzip it in some folder and then apply javaimport to this folder.
Imported Android Toast API example:
type
JToastClass = interface(JObjectClass)
['{51734059-CDB1-45F0-815E-5AB1AD644097}']
{Property methods}
function _GetLENGTH_LONG: Integer;
function _GetLENGTH_SHORT: Integer;
{Methods}
function init(context: JContext): JToast; cdecl;
function makeText(context: JContext; text: JCharSequence; duration: Integer): JToast; cdecl; overload;
function makeText(context: JContext; resId: Integer; duration: Integer): JToast; cdecl; overload;
{Properties}
property LENGTH_LONG: Integer read _GetLENGTH_LONG;
property LENGTH_SHORT: Integer read _GetLENGTH_SHORT;
end;
JToastClass = interface(JObjectClass)
['{51734059-CDB1-45F0-815E-5AB1AD644097}']
{Property methods}
function _GetLENGTH_LONG: Integer;
function _GetLENGTH_SHORT: Integer;
{Methods}
function init(context: JContext): JToast; cdecl;
function makeText(context: JContext; text: JCharSequence; duration: Integer): JToast; cdecl; overload;
function makeText(context: JContext; resId: Integer; duration: Integer): JToast; cdecl; overload;
{Properties}
property LENGTH_LONG: Integer read _GetLENGTH_LONG;
property LENGTH_SHORT: Integer read _GetLENGTH_SHORT;
end;
[JavaSignature('android/widget/Toast')]
JToast = interface(JObject)
['{BA203A75-C35C-4CF5-9AF4-9DCCA2C0EBBB}']
{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;
JToast = interface(JObject)
['{BA203A75-C35C-4CF5-9AF4-9DCCA2C0EBBB}']
{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;
TJToast = class(TJavaGenericImport)
end;
const
TJToast_LENGTH_LONG = 1;
TJToast_LENGTH_SHORT = 0;
implementation
procedure RegisterTypes;
begin
TRegTypes.RegisterType('android.widget.Toast.JToast', TypeInfo(android.widget.Toast.JToast));
end;
initialization
RegisterTypes;
end.
end;
const
TJToast_LENGTH_LONG = 1;
TJToast_LENGTH_SHORT = 0;
implementation
procedure RegisterTypes;
begin
TRegTypes.RegisterType('android.widget.Toast.JToast', TypeInfo(android.widget.Toast.JToast));
end;
initialization
RegisterTypes;
end.
Version 3.2
- added postfix number to equal class names
- added postfix number to equal class names
[/b]
[b] Only for V.I.P
Warning! You are not allowed to view this text.