Trendy News

Showing posts with label Android interview Questions. Show all posts
Showing posts with label Android interview Questions. Show all posts

What is activity lifecycle in Android ?

Components in each application some active and inactive
to maintain that there is life cycle process and states
which defines the componet's life cycle.Especially each
activity has the three states.

Three states of Activity lifecycle :

  • Active or running state
  • paused state
  • stopped state




























Active state:

In this state defines that the activity is in the foreground of the screen (means top of the stack)
and this activity has responsiblity to focus on user action.

Paused

The specific activity lost the user focus but still visible to the user the this
 state will be called.Also this state maintain the member information and
state to tell window manager.

Stopped :

This state denotes that the activity has completly terminated.
But still it can retains all the state and member information.

Anyway it will be no longer visible to the end user as well and it
will be killed by the system when the memory is required to process
other state.






What is activity lifecycle in Android ?


What is activity lifecycle in Android ?

Components in each application some active and inactive
to maintain that there is life cycle process and states
which defines the componet's life cycle.Especially each
activity has the three states.

Three states of Activity lifecycle :

  • Active or running state
  • paused state
  • stopped state




























Active state:

In this state defines that the activity is in the foreground of the screen (means top of the stack)
and this activity has responsiblity to focus on user action.

Paused

The specific activity lost the user focus but still visible to the user the this
 state will be called.Also this state maintain the member information and
state to tell window manager.

Stopped :

This state denotes that the activity has completly terminated.
But still it can retains all the state and member information.

Anyway it will be no longer visible to the end user as well and it
will be killed by the system when the memory is required to process
other state.








What is Process and Thread in Android ? oR
What is the difference between Thread and process in android ?

The Multi-Thread tasking is allowed in Android and to support the spawn
 threads for all the process running using threads.
  • Process :
     The process is any component that runs and controlled in the manifest file.
Each component has the attribute called "Activity", "Services", "receiver,"provider" this can specify
the process for each component.

    Some components share the process across other while other component
not using that process.Also we can set that components from different application
can run using the same process.

    Each application has the process attribute to set the default
value to apply for all components in the application.

    Initially all the components object created(means instantiated)
of main thread for particular process and each system calls for the
specified component dispatch from that thread.

   For Each instance created in main for that there is no sperate
thread created for each instances.Similarly,also methods response and
reports for specific user action run in the main thread for the process.
It means that there is no block or long operation for each component.
  • Thread:
      The same way followed here to create the thread as compare to
java. Ofcoure android uses java as the primary coding standards.
But the difference here is android provide the number of api to
manage and schedule the thread like, Looper for running a thread,Handler
for process,HandlerThread for setup a thread,




What is Process and Thread in Android ? oR What is the difference between Thread and process in android ?


What is Process and Thread in Android ? oR
What is the difference between Thread and process in android ?

The Multi-Thread tasking is allowed in Android and to support the spawn
 threads for all the process running using threads.
  • Process :
     The process is any component that runs and controlled in the manifest file.
Each component has the attribute called "Activity", "Services", "receiver,"provider" this can specify
the process for each component.

    Some components share the process across other while other component
not using that process.Also we can set that components from different application
can run using the same process.

    Each application has the process attribute to set the default
value to apply for all components in the application.

    Initially all the components object created(means instantiated)
of main thread for particular process and each system calls for the
specified component dispatch from that thread.

   For Each instance created in main for that there is no sperate
thread created for each instances.Similarly,also methods response and
reports for specific user action run in the main thread for the process.
It means that there is no block or long operation for each component.
  • Thread:
      The same way followed here to create the thread as compare to
java. Ofcoure android uses java as the primary coding standards.
But the difference here is android provide the number of api to
manage and schedule the thread like, Looper for running a thread,Handler
for process,HandlerThread for setup a thread,





RecentNews

Follow us on FB

facebook