Home > Back-end >  C builder how to start the Delphi writing service?
C builder how to start the Delphi writing service?

Time:10-31

Suppose using Delphi to do a service called "MsgService
"Builder to do application is called "Msg"

When start the service, need to pass some parameters to the service,

A. how setClass correctly? , B1 and B2 start way is correct?

 
_di_JIntent intent;
_di_JContext context;
_di_Jlang_Class jclass;
The context=SharedActivityContext () - & gt; GetApplicationContext ();
Jclass=SharedActivityContext () - & gt; GetClass ();
Intent=TJIntent: : JavaClass - & gt; init();
Intent - & gt; SetClass (context, jclass);//A
Intent - & gt; PutExtra (TAndroidHelper: : StringToJString (" UserID "), the UserID);
Intent - & gt; PutExtra (TAndroidHelper: : StringToJString (" Session "), TAndroidHelper: : StringToJString (Session));
Intent - & gt; PutExtra (TAndroidHelper: : StringToJString (" AppServer "), TAndroidHelper: : StringToJString (AppServer));
Intent - & gt; PutExtra (TAndroidHelper: : StringToJString (" AppUDPPort "), AppUDPPort);
Intent - & gt; PutExtra (TAndroidHelper: : StringToJString (" AppTCPPort "), AppTCPPort);
//TAndroidHelper: : Activity - & gt; StartService (intent);//B1
Bool ok=SharedActivityContext () - & gt; StartService (intent);//B2
If (ok)
MemoMsg - & gt; Lines - & gt; Add (" start the service success ");
The else
MemoMsg - & gt; Lines - & gt; Add (" start the service failure ");

CodePudding user response:

Personal feeling, how to understand Delphi right start Delphi writing service, and then translated into CB code?

CodePudding user response:

"Service" is the concept of the Windows operating system, has nothing to do with language, how to start a service, offered by Windows API operation is good, why care about service is written in what tools?

CodePudding user response:

refer to the second floor the frog studio reply:
"service" is the concept of the Windows operating system, has nothing to do with language, how to start a service, offered by Windows API operation is good, why care about service is written in what tools?

He the android,

CodePudding user response:

reference ooolinux reply: 3/f
Quote: refer to the second floor the frog studio reply:

"Service" is the concept of the Windows operating system, has nothing to do with language, how to start a service, offered by Windows API operation is good, why care about service is written in what tools?

He the android
then use the android API operation, what is the relationship between language?

CodePudding user response:

reference 4 floor frog studio response:
Quote: refer to the third floor ooolinux response:

Quote: refer to the second floor the frog studio reply:

"Service" is the concept of the Windows operating system, has nothing to do with language, how to start a service, offered by Windows API operation is good, why care about service is written in what tools?

He the android
then use the android API operation, what is the relationship between language?

Delphi libraries do to its packing, not directly call the android API,
  • Related