Asynchronous Tasks with Android Anthony Dahanne, Ing Jr identi.ca/twitter blog : Android Montreal, le 01/09/2010.

Slides:



Advertisements
Similar presentations
October 27, 2008 DCIA P2P and Video Conference Robert Levitan, CEO Can You Afford NOT to Use The Cloud?
Advertisements

13/04/2015Client-server Programming1 Block 6: Threads 1 Jin Sa.
Developing for Windows 8/WinRT Session 4 Fundamentals Kevin Stumpf.
USING ANDROID WITH THE INTERNET. Slide 2 Network Prerequisites The following must be included so as to allow the device to connect to the network The.
Lec 06 AsyncTask Local Services IntentService Broadcast Receivers.
Threads, AsyncTasks & Handlers.  Android implements Java threads & concurrency classes  Conceptual view  Parallel computations running in a process.
Cosc 4730 Brief return Sockets And HttpClient And AsyncTask.
02/02/2004CSCI 315 Operating Systems Design1 Threads Notice: The slides for this lecture have been largely based on those accompanying the textbook Operating.
HTTP and Threads. Download some code I’ve created an Android Project which gives examples of everything covered in this lecture. Download code here.here.
Networking Nasrullah. Input stream Most clients will use input streams that read data from the file system (FileInputStream), the network (getInputStream()/getInputStream()),
UI Design Patterns & Best Practices Mike Wolfson July 22, 2010.
CS378 - Mobile Computing Web - WebView and Web Services.
Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved Concurrency in Android with.
Software Architecture of Android Yaodong Bi, Ph.D. Department of Computing Sciences University of Scranton.
 The ability to develop step by step procedures for solving problems  She uses algorithmic thinking by setting up her charts.
Networking: Part 2 (Accessing the Internet). The UI Thread When an application is launched, the system creates a “main” UI thread responsible for handling.
Networking Android Club Networking AsyncTask HttpUrlConnection JSON Parser.
CS378 - Mobile Computing Web - WebView and Web Services.
HTTP and Threads. Getting Data from the Web Believe it or not, Android apps are able to pull data from the web. Developers can download bitmaps and text.
Photo Album by User
CS 346 – Chapter 4 Threads –How they differ from processes –Definition, purpose Threads of the same process share: code, data, open files –Types –Support.
Building Twitter App Rohit Ghatol. About Me Rohit Ghatol 2.Project 3.Certified Scrum Master 4.Author “Beginning.
Working in the Background Radan Ganchev Astea Solutions.
Introduction to Socket Programming in Android Jules White Bradley Dept. of Electrical and Computer Engineering Virginia Tech
MAKANI ANDROID APPLICATION Prepared by: Asma’ Hamayel Alaa Shaheen.
Robotics. What is a robot? Have you seen a robot? Where? – In a photo? – Video? – In real life?
CS378 - Mobile Computing Responsiveness. An App Idea From Nifty Assignments Draw a picture use randomness Pick an equation at random Operators in the.
ALAA M. ALSALEHI SOFTWARE ENGINEER AT IUG Multithreading in Android.
Introduction to Server-Side Web Development Introduction to Server-Side Web Development Session II: Introduction to Server-Side Web Development with Servlets.
Asynchronous Web Services Writing Asynchronous Web Services SoftUni Team Technical Trainers Software University
Mobile Programming Midterm Review
Android Threads. Threads Android will show an “ANR” error if a View does not return from handling an event within 5 seconds Or, if some code running in.
네트워크 전송 1/2 UNIT 29 로봇 SW 콘텐츠 교육원 조용수. 학습 목표 Android Network 통신 2.
Mobile Development. Name: Saurabh Software Developer.
Recap of Part 1 Terminology Windows FormsAndroidMVP FormActivityView? ControlViewView? ?ServiceModel? Activities Views / ViewGroups Intents Services.
Message Framework Topic subscribe for javascript/flex client.
Conway’s Game Of Live 1 Fall 2014 CS7020: Game Design and Development.
Introduction to Multimedia. What is Multimedia? Derived from the word “Multi” and “Media” Multi Many, Multiple, Media Tools that is used to represent.
Lecture 6: Process and Threads Topics: Process, Threads, Worker Thread, Async Task Date: Mar 1, 2016.
Nivo 300 ASP.NET MVC 4 Danijel Malik Artifis Danijel Malik s.p.
Android intro Building UI #1: interactions. AndroidManifest.xml permissions 2.
NCCUCS 軟體工程概論 Lecture 5: Ajax, Mashups April 29, 2014.
Return to Home! Go To Next Slide! Return to Home! Go To Next Slide!
Today Threading, Cont. Multi-core processing. Java Never Ends! Winter 2016CMPE212 - Prof. McLeod1.
Slide 1 Insert your own content.. Slide 2 Insert your own content.
HUJI Post PC Workshop 5 Files, Threading, and Web Services Sasha Goldshtein
USING ANDROID WITH THE INTERNET. Slide 2 Lecture Summary Getting network permissions Working with the HTTP protocol Sending HTTP requests Getting results.
Developing Android Services. Objectives Creating a service that runs in background Performing long-running tasks in a separate thread Performing repeated.
Google Glass Developing for Glass & Alfresco.
UI Design Patterns & Best Practices
Asynchronous Task (AsyncTask) in Android
Reactive Android Development
WebView and Web Services
CS240: Advanced Programming Concepts
Web Service Testing …in another way Software Quality Assurance
Chapter 4: Threads.
Chapter 4: Multithreaded Programming
Creating Windows Store Apps Using Visual Basic
Android Programming Lecture 8
CS371m - Mobile Computing Responsiveness.
Slide 1 Insert your own content.. Slide 1 Insert your own content.
Slide 1 Insert your own content.. Slide 1 Insert your own content.
Slide 1 Insert your own content.. Slide 1 Insert your own content.
Mobile Computing With Android ACST 4550 Android Database Storage
Android Topics Asynchronous Callsbacks
Android Developer Fundamentals V2
Threads, Handlers, and AsyncTasks
THE ANDROID TEXTBOOK APP
Android Threads Dimitar Ivanov Mobile Applications with Android
Name of Chapter Area of Chapter
Presentation transcript:

Asynchronous Tasks with Android Anthony Dahanne, Ing Jr identi.ca/twitter blog : Android Montreal, le 01/09/2010

Content Why should I care about multi threading ? What are the options ? AsyncTasks to the rescue ! AsyncTask API : the lifecycle AsyncTask API : real life example (demo) Q&A

Why should I care about threading ? Remote calls (Http) Intense computing (media manipulation) One thread = Frustrated user !

Why should I care about threading ? Remote calls (Http) Intense computing (media manipulation) Many threads = Happy user

What are the options ? Or you can try THE REAL THING ! Handler based API : Activity.runOnUiThread(Runnable) View.post(Runnable) View.postDelayed(Runnable, long) And.... Handler ! (android.os.Handler)

AsyncTasks to the rescue ! Asynctask API : Something doInBackground(String... params) { return null; } protected void onPreExecute() { } protected void onPostExecute(Something b) { } protected void onProgressUpdate(Ty... values) { } The best way to round kick your threads !

Asynchronous Tasks : the lifecycle

AsyncTask : real life example

The end ! Q&A !

References AsyncTasksDemo G2Android, the Gallery2 client for Android Painless threading, by Romain Guy Multithreading For Performance, by Gilles Debunne Photos : Slide 5 : Slide 6 : Video : Slide 9 :