O'Reilly logo

Hello, Android, 4th Edition by Ed Burnette

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using Web Services

Android provides a full set of Java-standard networking APIs, such as the java.net.HttpURLConnection package, that you can use in your programs. The tricky part is to make the calls asynchronously so that your program’s user interface is responsive at all times.

Consider what would happen if you just make a blocking network call in the middle of your user interface code. Suddenly your application would not be able to respond to any events such as touches or button presses. It would appear hung to the user. Obviously, that’s something you want to avoid.

The java.util.concurrent package is perfect for this kind of work. First created by Doug Lea as a stand-alone library and later incorporated into Java 5, this package supports ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required