Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

Chapter 10 Client-Server Applications

CHAPTER 10
CLIENT-SERVER APPLICATIONS

Smart phones and tablets are amazing devices, capable of most things that a typical personal computer is capable of. But like personal computers in the modern world, they are limited without access to a network. With the proliferation of software as a service (SaaS), cloud computing, and email, it’s getting harder and harder to be productive with a stand-alone device. John Gage, cofounder of SUN Microsystems, said it best: “The network is the computer.” The same can be said for mobile devices.

Some view mobile devices as a source of entertainment, and they certainly are, but I concentrate on development of information-providing applications, many using a network or the Internet as a source. Mobile devices make convenient client-side devices for client-server applications. Developing client-server applications for the mobile device is no more difficult than developing for personal computers. In fact, the java.net package works nicely on Android devices. The example application we will build sends a text string to a server and receives the text string back with an added confirmation. As you probably assume, you can build both the client side and the server side on the same Eclipse platform. However, you will probably want to run the server-side application on another machine with another IP address on the same local area network. If you have written any client-server applications, you are likely familiar with IP addresses and port numbers; this application uses port 8888, an arbitrary choice. You can use just about any port number you want; just stay away from the numbers zero through 1023. Because port numbers are 16-bit values, there are 65,536 choices. However, they are broken into the groups shown here:


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial