Android Processes, Threads Slidenerd Style

Learn Android From null to stackoverflow, processes, threads, handlers, asynctask, xml parsing
4.5 (236 ratings) Instead of using a simple lifetime average, Udemy calculates a
course's star rating by considering a number of different factors
such as the number of ratings, the age of ratings, and the
likelihood of fraudulent ratings.
11,980 students enrolled
Free
Start Learning Now
  • Lectures 30
  • Contents Video: 4.5 hours
  • Skill Level Intermediate Level
  • Languages English
  • Includes Lifetime access
    30 day money back guarantee!
    Available on iOS and Android
    Certificate of Completion
Wishlisted Wishlist

How taking a course works

Discover

Find online courses made by experts from around the world.

Learn

Take your courses with you and learn anywhere, anytime.

Master

Learn and practice real-world skills and achieve your goals.

About This Course

Published 3/2015 English

Course Description

The 3 primary ways of running an operation in the background in Android is using Threads, Handlers and Services. Though Threads and Handlers are primitive and involve boilerplate code, a more sophisticated way to manage background processing such as loading of images, performing complex computations, downloading Network data is with the help of an AsyncTask, This course covers the following items

  1. Processes in android, their architecture, operation
  2. Threads in android and why you can't use them
  3. Handlers and how they are superior to threads
  4. AsyncTask and how its clean and modular
  5. Handling AsyncTask lifecycle based on activity or fragment destruction
  6. XML Parsing APIs
  7. DOM API and a BlogReader app based on this API

What are the requirements?

  • Programming Basics
  • Object Oriented Java
  • Android Basics: Activities, Intents and Fragments

What am I going to get from this course?

  • Use Threads, Handlers and AsycnTask effectively in your apps
  • Build Full asynchronous apps that enhance User Experience
  • Perform network operations, download files such as images and videos in your app
  • Perform XML parsing with DOM

What is the target audience?

  • This course is best suited for you if you are looking towards learning multi-threading techniques in Android using Threads, Handlers and AsycnTask
  • This course is probably NOT meant for you if you are not familiar with the basics of Android such as Activities, Fragments, Intents etc.

What you get with this course?

Not for you? No problem.
30 day money back guarantee.

Forever yours.
Lifetime access.

Learn on the go.
Desktop, iOS and Android.

Get rewarded.
Certificate of completion.

Curriculum

Section 1: Processes In Android
07:50

This Android Tutorial video talks about processes, threads and services in Android starting with processes. What is a process, how is a process launched? How is a process determined as a candidate for termination on low memory conditions, What are the 5 levels of process importance in Android and why should you use a Service instead of a thread to do background task are some of the issues discussed in this video

05:12

This Android Tutorial video talks about the App Sandbox in Android. At the time of installation, each app is assigned a unique app user ID and can share data with other processes and apps that have the same user ID. This information can be set in the Manifest.xml using the android:shareUserId attribute.Thus interprocess communication in Android takes place

14:32

This Android Tutorial video creates 2 apps that exchange data with each other with the help of a file. Both apps have the same sharedUserId and both run on different processes.

Section 2: Threads
07:32

This Android Tutorial video talks about multithreading in Android, it discusses how Activities, Services and Broadcast receivers post messages on the main thread's queue which is handled one by one by the Looper in an asynchronous fashion whereas the ContentProvider sends synchronous messages to the Looper

10:54

This Android Tutorial video shows the architecture of threads within a process in Android and shows the usage of methods such as runOnUiThread, View.post, View.postDelayed and Process.setThreadPriority

04:51

This Android Tutorial video shows an example of multithreading in Android by taking a simple app that downloads images from the Internet. In this video we simply discuss the setup to create that simple app. The real functionality begins from the next video

10:44

This Android Tutorial video shows an example of multithreading in Android by taking a simple app that downloads images from the Internet. In this video we use InputStream and HttpURLConnection to establish connection through our URL object which attempts to read images data from a particular URL

10:29

This Android Tutorial video shows an example of multithreading in Android by taking a simple app that downloads images from the Internet. In this video we play around with Uri and File along with Environment.getExternalStoragePublicDirectory() to get the perfect file name generated automatically for each image.

10:55

This Android Tutorial video shows an example of multithreading in Android by taking a simple app that downloads images from the Internet. We finally use the FileOutputStream to write data to the SD card with the proper images but guess what the app is not user friendly, It would be better with a ProgressBar, dont you think?

07:52

This Android Tutorial video talks about how to display a progress bar for a short interval of time to indicate some action being performed in the background Thread. The issue with progress bars is that their state cannot be saved once the screen is rotated resulting in the destruction of the Activity.

Section 3: Handlers
09:17

This Android Handler Tutorial video talks about thread, looper and handlers in android and their architecture. How can you use handlers to send Runnable or Message objects to the thread associated with the handler.

07:55

This Android Tutorial video demonstrates a simple example of a background thread sending messages containing progress of execution of a long running task to the Main Thread where the ProgressBar is updated by the Main thread with the help of the handleMessage callback. A Message object is created by the handler which is sent to the message queue of the Main thread

05:07

This Android Tutorial video shows another example of Handlers in Android inside a sample app called DownloadImages where handler instances are used to post Runnable messages to the main thread of the activity so that the main thread can update the progress bar appropriately to indicate the status of image download

06:45

This Android Tutorial video shows an example of Looper in Android. Looper is associated with a thread when you call Looper.prepare() and when you invoke Looper.loop() you process messages from the message queue of that thread. Main Thread can send Runnable or Message objects to background thread once the background thread has an associated Looper

12:21

This Android Tutorial video talks about AsyncTask in Android, how to use it, when to use asycntask, lifecycle of asynctask in the form of onPreExecute, doInBackground, publishProgress, onProgressUpdate and onPostExecute methods, Generic arguments to asynctask covering Params, Progress and Result.

17:06

This Android Tutorial shows an example of AsyncTask where a ListView is populated with items in the background thread supported by the doInBackground method. The onPreExecute and onPostExecute take care of displaying and hiding a progress bar that belongs to the Activity enabled through the requestWindowFeature method. The publishProgress and onProgressUpdate attempt to update the progressbar

18:39

This Android Tutorial video shows how to create the Download Images App as an example of using AsyncTask and then proceeds to show how Activity lifecycle affects AsyncTask since it is not capable of updating the new instance of the Activity once the old instance has been destroyed

06:38

This Android Tutorial video shows how to handle asynctask rotation in android, by locking the orientation of the Activity inside onPreExecute and releasing it inside onPostExecute so that the Activity cannot rotate while the user is running the background task or the status of the AsyncTask is RUNNING

07:48

This Android Tutorial video begins dealing with AsyncTask capable of Handling Activity Rotation by creating Fragment that dont destroy themselves when the screen is rotated with the help of the setRetainInstance set to true and demonstrates the effect on the lifecycle of Fragments when setRetainInstance is used

10:11

This Android Tutorial shows how to manage an AsyncTask inside a retained Fragment by notifying the Task of the changing Activity instances on rotation through the onAttach and onDetach callbacks

11:40

This Android Tutorial video shows how to handle asynctask rotation with some final pieces put together inside the MainActivity and completes the Rotation friendly AsyncTask thereby...

04:39

This Android Tutorial For Beginners video talks about XML parsing in Android and discusses the various approaches behind them using DOM API, SAX Parser and StAX parser.

05:54

This Android Tutorial video talks about XML DOM Parsing and how it works in Android. It discusses about the DocumentBuilderFactory and DocumentBuilder Singleton classes and their methods newInstance() to initialize the parsing of XML in Java

07:34

This Android Tutorial video talks about the interfaces, Element, Node, Attr and discusses methods such as getAttributes(), getNodeName(), getElementsByTagName() and NodeTypes such as ELEMENT_NODE, TEXT_NODE, DOCUMENT_NODE and also discusses the limitations of DOM based parsing approach

Section 4: Get Practical With BlogReader App
12:06

This Android Tutorial video shows an example of XML dom parsing to read rss feeds from Techcrunch using the DocumentBuilderFactory, DocumentBuilder, Document, Element, Node classes and interfaces

07:07

This Android Tutorial video shows an example of XML dom parsing to read rss feeds from Techcrunch using the DocumentBuilderFactory, DocumentBuilder, Document, Element, Node classes and interfaces

10:51

This Android Tutorial video shows an example of XML dom parsing to read rss feeds from Techcrunch using the DocumentBuilderFactory, DocumentBuilder, Document, Element, Node classes and interfaces

09:08

This Android Tutorial video shows an example of XML dom parsing to read rss feeds from Techcrunch using the DocumentBuilderFactory, DocumentBuilder, Document, Element, Node classes and interfaces

09:17

This Android Tutorial video shows an example of XML dom parsing to read rss feeds from Techcrunch using the DocumentBuilderFactory, DocumentBuilder, Document, Element, Node classes and interfaces

10:03

This Android Tutorial video shows an example of XML dom parsing to read rss feeds from Techcrunch using the DocumentBuilderFactory, DocumentBuilder, Document, Element, Node classes and interfaces

Students Who Viewed This Course Also Viewed

  • Loading
  • Loading
  • Loading

Instructor Biography

Vivek Ramesh, Founder of slidenerd

Once upon a time, my teacher asked me to write a program to check if the input is leap year. I went to my teacher and asked him "Sir, can you please explain why you wrote if(i%4==0)?". He told me to get lost saying "I ll never learn programming" 

Are you like me whose teacher writes code and never explains why? You have finally come to the right instructor on Udemy who teaches you now just how to code but also why

I have taught 90000+ people so far on my channel slidenerd which is rated as one of the topmost sources in the world to learn Android or IOS and other aspects of mobile development and general programming by several online blogs and forums. I have made several hundred videos on YouTube over the years and many of them are at the top of the search results on YouTube and Google.

I have real world teaching experience and a degree in IT Engineering. with more than 10 years of coding experience. I have won several coding challenges in the meantime. What do you say? we learn the how, what, why behind everything together?

Ready to start learning?
Start Learning Now