Trendy News

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,





0 comments :

Post a Comment

RecentNews

Follow us on FB

facebook