Running Java on Your Phone

The last stop on your whirlwind tour of Java is the nearest Google Android cell phone. Every single program that runs on Android has been programmed with Java. These mobile programs, which extend the functionality of the phones, are called apps. One of the most popular apps is a game called Angry Birds, shown in Figure 3.7.

Figure 3.7. Angry Birds and all other Android apps were created with the Java language.

Image

You can learn more about this game, if you’re not already familiar with it, by visiting www.angrybirds.com. (But don’t do it! The game will obliterate any hope you had of being productive for the rest of the day, week, or even month—depending on how much you hate fortified pigs.)

Android ends the trip around Java because it’s becoming an incredibly popular place for the language to be used. After you learn Java, you can apply your skills developing your own apps using the Android Software Development Kit (SDK), a free programming toolkit that runs on Windows, MacOS, and Linux.

More than 250,000 apps have been created for Android phones and other devices that run the mobile operating system. You learn more about it in Hour 24, “Writing Android Apps.”

Summary

Now that the hour-long vacation is over, it’s time to put away your luggage and get ready for a return to actual Java programming.

During the next 21 hours, you will master the basic building blocks of the Java language, learn how to create your own objects to accomplish tasks in object-oriented programming, design graphical user interfaces, and much more.

Unless you’ve stopped reading this book to play Angry Birds.

Q&A

Q. Why are Java applets no longer popular?

A. When the Java language was introduced in the mid-’90s, most people were learning the language to write applets. Java was the only way to create interactive programs that ran in a web browser.

Over the years, alternatives emerged. Macromedia Flash, Microsoft Silverlight, and the new web publishing HTML5 standard all offer ways to put programs on web pages.

Applets were hampered by poor loading time and slow support for new versions of Java by browser developers. A Java plug-in was introduced that could run the current version of Java in browsers, but by that time Java had outgrown its origins and was a sophisticated general-purpose programming language.

Q. What’s a Chris Steak House, and why does Ruth have one?

A. Ruth’s Chris Steak House, the chain of more than 120 upscale steak restaurants across the United States and a handful of other countries, has an odd two-first-name name that reveals its humble origins and the stubborn streak of its founder.

The chain was founded in 1965 as a solitary New Orleans restaurant owned by Ruth Fertel, a single mother of two sons. Fertel saw a classified ad offering a restaurant for sale and took out a $22,000 home mortgage to buy it (equivalent to around $150,000 in present dollars).

She reached a deal to keep the name Chris Steak House with original owner Chris Matulich, but later had to relocate after a kitchen fire.

Fertel’s contract did not permit her to use the Chris Steak House name anywhere but the original location, so she renamed it Ruth’s Chris Steak House. Though she had no restaurant or culinary expertise, the business was so successful that she began offering it as a franchise within 12 years. She disregarded several suggestions over the years to change the name to broaden its appeal.

“I’ve always hated the name,” she once told a reporter for Fortune magazine, “but we’ve always managed to work around it.”

Fertel, who died in 2002, was born on Feb. 5, 1927—the same day that Matulich opened the steakhouse.

Workshop

If your mind hasn’t taken a vacation by this point, test your knowledge of this hour with the following questions.

Quiz

1. How did object-oriented programming get its name?

A. Programs are considered to be a group of objects working together.

B. People often object because it’s hard to master.

C. Its parents named it.

2. Which of the following isn’t a part of Java’s security?

A. Web programs cannot run programs on the user’s computer.

B. The identity of a program’s author is always verified.

C. Java windows are labeled as Java windows.

3. What is a program’s capability to handle more than one task called?

A. Schizophrenia

B. Multiculturalism

C. Multithreading

Answers

1. A. It’s also abbreviated as OOP.

2. B. Programmers can use digital signatures and an identity-verification company such as VeriSign in Java, but it isn’t required.

3. C. This also is called multitasking, but the term multithreading is used in conjunction with Java because a separately running part of a program is called a thread.

Activities

Before unpacking your luggage, you can explore the topics of this hour more fully with the following activities:

• Use the Java Boutique site at http://javaboutique.internet.com to find out what card games have been developed using the language.

• Visit Oracle’s website for Java users, www.java.com, and click the “Do I Have Java?” link. Follow the instructions to see whether Java’s present on your computer. Download and install the most up-to-date version, if prompted to do so.

Solutions for the activities in this book are presented on the book’s website at www.java24hours.com.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.16.152