Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use of The Method #1

Open
halilhanbadem opened this issue Feb 1, 2019 · 0 comments
Open

Use of The Method #1

halilhanbadem opened this issue Feb 1, 2019 · 0 comments

Comments

@halilhanbadem
Copy link
Owner

halilhanbadem commented Feb 1, 2019

unit Unit1;

interface

uses
System.SysUtils,
System.Classes,
System.Android.Service,
AndroidApi.JNI.GraphicsContentViewText,
Androidapi.JNI.Os, AndroidServiceMethod;

type
TDM = class(TAndroidService)
procedure AndroidServiceCreate(Sender: TObject);
function AndroidServiceStartCommand(const Sender: TObject;
const Intent: JIntent; Flags, StartId: Integer): Integer;
private
{ Private declarations }
public
{ Public declarations }
end;

var
DM: TDM;

implementation

{%CLASSGROUP 'FMX.Controls.TControl'}

{$R *.dfm}

procedure TDM.Notification_Push;
begin
///---> Code....
end;

procedure TDM.AndroidServiceCreate(Sender: TObject);
begin
AndroidServiceMethod.ServiceLoop(Notification_Push)
end;

function TDM.AndroidServiceStartCommand(const Sender: TObject;
const Intent: JIntent; Flags, StartId: Integer): Integer;
begin
Result := TJService.JavaClass.START_STICKY;
end;

end.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant