Tobi Weißhaar
Tobi Weißhaar

Reputation: 1677

Android - Computations in background

First question: I know that in the Activities only view content should be implemented but is it usual to start an own service for each longer computation process?

Second question: And the communication with the service is really extensive in code. If you want to invoke a method on the service you have to realize the hole IPC-mechanism?? Or is it also possible to invoke methods on local services without using the AIDL-files?

Upvotes: 0

Views: 63

Answers (2)

Marcin Orlowski
Marcin Orlowski

Reputation: 75645

Depending on task you want to perform consider using AsyncTask or IntentService. Using regular Service should rather not suit your needs best here.

If you use regular Service you can easily pass your data or arguments or whatever in Intent. You do not need any IPC for this.

Upvotes: 1

Anis BEN NSIR
Anis BEN NSIR

Reputation: 2555

First question: you can start an AsynTask for longer computation process, service are generally used for action when application on background.

Second question: you can call any Method on your service, the use of idle make your services available for multiple applications, witch is not the case of a simple services, also, sample services runs on the same application process as your activities, witch is not the case of idle service.

Upvotes: 1

Related Questions