Hi,
I Add new infos in Readme.txt,
About Package, Components and LCL and NDK libs(.so) dependency on laz4android1.1-41139 IDE cross compiler...
1. Package creation: just LCLBase is permitted! not "LCL"!
- You will nedd LCLBase Required Package for register procedure.
- yes, other No GUI stuff is permitted.
2. Component creation
2.1. If you will use custom icon then you will need two files: the first to compoment(s) code
and the second for Register procedure code.
example:
2.1.1. File 1 - "foo.pas" - component code - here no LCL dependency at all!
unit foo;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils;
type
TFoo = class(TComponent)
private
{ Private declarations }
protected
{ Protected declarations }
public
{ Public declarations }
published
{ Published declarations }
end;
implementation
end.
2.1.2. File 2 - "regtfoo.pas" - register code - here you will need LCLBase for LResources unit
unit regtfoo;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, LResources{ here is the LCLBase dependency!};
Procedure Register;
implementation
Procedure Register;
begin
{$I tfoo_icon.lrs} //you custom icon
RegisterComponents('Android Bridges',[TFoo);
end;
initialization
end.
3. NDK libs (.so) dependency on laz4android1.1-41139 IDE cross compiler
3.1. You will need two files: the first to NDK *.so lib interface and the second for you component/unit code.
Example:
3.1.1. File 1 - "And_log_h.pas" the header interface file
unit And_log_h;
{$mode delphi}
interface
const libname='liblog.so';
ANDROID_LOG_UNKNOWN=0;
ANDROID_LOG_DEFAULT=1;
ANDROID_LOG_VERBOSE=2;
ANDROID_LOG_DEBUG=3;
ANDROID_LOG_INFO=4;
ANDROID_LOG_WARN=5;
ANDROID_LOG_ERROR=6;
ANDROID_LOG_FATAL=7;
ANDROID_LOG_SILENT=8;
type
android_LogPriority=integer;
function __android_log_write(prio:longint; tag,text: pchar):longint; cdecl; external libname name '__android_log_write';
function LOGI(prio:longint;tag,text:pchar):longint; cdecl; varargs; external libname name '__android_log_print';
implementation
end.
3.1.2. File 2 - "And_log.pas" component/unit code
unit And_log;
interface
uses
And_log_h; // <-- here is the link to NDK lib
procedure log(msg: pchar);
implementation
procedure log(msg: pchar);
begin
__android_log_write(ANDROID_LOG_FATAL,'crap',msg);
end;
end.
Thank you.