to write a back ground functionality in an activity, should I use a thread or service?
Answer / Simpal Chauhan
For background functionality in an Android activity, you can use either a Thread or a Service. The choice depends on your specific needs:
- A Thread is suitable for short-lived tasks that do not require persistence after the Activity stops (e.g., downloading data quickly). However, it will be killed if the Activity goes into the background.
- A Service provides more flexibility for long-running operations and can run even when the user switches to another app. Use a Service instead of a Thread if you want your task to continue running in the background.
| Is This Answer Correct ? | 0 Yes | 0 No |
Describe the activities of android?
Explain the steps in creating a bounded service through aidl.
What are the differences between a domain and a workgroup?
State the importance of xml- based layouts?
What are the tools placed in android sdk?
What is true about localstorage?
Why ttl (time to live) is required?
When dealing with multiple resources, which one takes precedence?
There is a kind of animation that using an xml file to define a sequence of pictures using?
Is android free for manufacturers?
How method is implemented in android studio?
What's android 7.0 called?