Android Tutorial

(avery) #1

By : Ketan Bhimani


362 

Using Android Networking APIs

Applications written with networking components are far more
dynamic and content rich than those that are not. Applications
leverage the network for a variety of reasons: to deliver fresh and
updated content, to enable social networking features of an
otherwise standalone application, to offload heavy processing to
high-powered servers, and to enable data storage beyond what the
user can achieve on the device.

Those accustomed to Java networking will find the java.net
package familiar. There are also some helpful Android utility classes
for various types of network operations and protocols. This chapter
focuses on Hypertext Transfer Protocol (HTTP), the most common
protocol for networked mobile applications.

Understanding Mobile Networking Fundamentals

Networking on the Android platform is standardized, using a
combination of powerful yet familiar technologies and libraries such
as java.net. Network implementation is generally straightforward,
but mobile application developers need to plan for less stable
connectivity than one might expect in a home or office network
setting— connectivity depends on the location of the users and
their devices. Users demand stable, responsive applications. This
means that you must take extra care when designing network-
enabled applications. Luckily, the Android SDK provides a number
of tools and classes for ensuring just that.
Free download pdf