Reputation: 45
Im creating an offline chatbot and was wondering if it would be good practice to use a Bound Service or a Singleton for the parsing/response Engine?
Upvotes: 0
Views: 558
Reputation: 77904
Service and Singleton are two different concepts.
We use Singleton
is a pattern to initiate and use one instance only.
Service is a component for longer-running operation that runs in background.
Bound Service
:
A bound service is the server in a client-server interface. Service that binds several applications or Activities.
Im creating an offline chatbot ..
If you think to develop Program talks to other application, bear in mind that on Android, one process cannot normally access the memory of another process. I offer you to use AIDL (Android Interface Definition Language)
Upvotes: 2