Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

What is the difference between activities and services?

Answer Posted / tisha

Activities and services are two fundamental components in Android, each serving distinct purposes within an Android application:

1. Activities:
- An Activity represents a single screen with a user interface. It is a visual component where users can interact and perform actions.
- Activities are typically used to present a UI to the user, receive input, and navigate to other activities.
- They have a user interface, visible to the user, and are generally associated with a screen.
- The activity lifecycle methods (onCreate, onStart, onResume, onPause, onStop, onDestroy) manage the behavior of an activity as it moves through different states.

2. Services:
- A Service is a background task that can perform long-running operations without a UI. It operates independently of any user interface.
- Services are often used to handle tasks that need to continue running even when the application is in the background or not actively interacting with the user.
- They don't have a user interface and run in the background.
- Services can run indefinitely and perform operations such as downloading files, playing music, or checking for updates.
- Common service lifecycle methods include onStartCommand, onBind, and onDestroy.

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what is the ui response time limit in android?

946


Give a brief idea about android application architecture?

882


Why do android apps update so often?

903


State the importance of having an emulator with the android environment?

909


What's the difference between android and iphone?

1050


How to update ui from a service in android?

926


Explain what is application context?

965


Which is the latest version of android os?

967


What is a marshmallow in android?

944


Which are location providers in android?

960


There are five different methods to store persistent data. They are: shared preferences. Internal storage. External storage. Network and __?

943


Described the different storage methods in android?

884


Please explain the difference between flag_activity_clear_task and flag_activity_clear_top?

1021


How to disable landscape mode in android?

1112


Describe the activities of android?

908