"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: