0

Embarcadero dokwiki Android service

I have found the next instruction on Embarcadero dokwiki site about Android services:

Include the unit in the uses clause of the implementation. This allows you to use all the methos defined on the service data module.

implementation

uses
  MyLocalService; //Key sensitive

{$R *.fmx}

Is it mean that I can to reach all variable and methods from the host application? I do not understand clearly. If the service contain a public variable I can to read it from the host application?

Remy Lebeau
  • 555,201
  • 31
  • 458
  • 770
Lionking
  • 89
  • 1
  • 13

1 Answers1

0

No. The MyLocalservice reference is just for compilation so that the references in the code, (eg. where the service is started) resolves and compiles and links. The service will run independently of the host (like it's it's own exe), so you can't share anything between them at runtime. Communication between host and service is achieved in a few different ways, but the most common is through notifications from the service that the host will intercept. You will find examples of this on EMBT's websites and in the skill-sprints on youtube.

Freddie Bell
  • 2,186
  • 24
  • 43