Jump to content

Search the Community

Showing results for tags 'service'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Delphi Questions and Answers
    • Algorithms, Data Structures and Class Design
    • VCL
    • FMX
    • RTL and Delphi Object Pascal
    • Databases
    • Network, Cloud and Web
    • Windows API
    • Cross-platform
    • Delphi IDE and APIs
    • General Help
    • Delphi Third-Party
  • C++Builder Questions and Answers
    • General Help
  • General Discussions
    • Embarcadero Lounge
    • Tips / Blogs / Tutorials / Videos
    • Job Opportunities / Coder for Hire
    • I made this
  • Software Development
    • Project Planning and -Management
    • Software Testing and Quality Assurance
  • Community
    • Community Management

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Delphi-Version

Found 2 results

  1. I have used Delphi 12 for developing Android application and I'm trying to Service which needs to runs in the background to receive the frequent messages from Server using TCP sockets to displays the notifications. But, the service is deactivated / closed after the main process application is closed. Below, the code is mentioned the code to start the service : procedure TForm1.ButtonServiceStartClick(Sender: TObject); var ServiceIntent: JIntent; begin ServiceIntent := TJIntent.Create; ServiceIntent.setClassName(TAndroidHelper.Context, StringToJString('com.embarcadero.services.MyService')); TAndroidHelper.Context.startService(ServiceIntent); end; and also, I have added the following service information in AndroidManifest.template.xml : <service android:enabled="true" android:exported="false" android:label="MyService" android:process=":remote" android:name="com.embarcadero.services.MyService"> </service> Code in Service: function TDM.AndroidServiceStartCommand(const Sender: TObject; const Intent: JIntent; Flags, StartId: Integer): Integer; begin Result := TJService.JavaClass.START_STICKY; end; I have tried to use this Solution, but not able to compile. And tried to implement the Sleep in Android Start command / run the thread, still the android service is getting closed. Do, I need to mentioned the different flag for starting the service or do I need to add additional code to run the service all the time or can we restart the service once it's destroyed and how to handle the code in Destroy event?
  2. microtronx

    Android Service using local sqlite DB

    As in different old topics written, it is still not possible to have a android service with a tfdconnection or a tsqlconnection on it. The service is not starting any more, you use this. Here's a link: https://forums.embarcadero.com/thread.jspa?threadID=229761 But what can we do? Is there a known solution? I'm not able to find one. Have tried to create all components in service's code but still, i don't even get a log entry that means the service still can't be created and the app hangs on trying to start the service. Anone out there who can give some tips?
×