Android programming

Start from the beginning
                                        

Picture 3 Android Developer Challenge Logo Of course the Android Developers Challenge, with its overall 10 Million Dollars of prize money, was attracting even more software-developers to create a bunch of really useful applications. On the other side many voices said, that this was no good choice from Google, because it would lead to less code-sharing, as many would fear sharing their ideas with a community, during the first important months after the SDK release. There were two Challenges planned:

 Android Developer Challenge I: Submissions up to April 14, 2008

 Android Developer Challenge II: This part will launch after the first handsets built on the platform become available in the second half of 2008.

In the Android Developer Challenge I, the 50 most promising entries submitted by April 14 will each receive a $25,000 award to fund further development. Those selected will then be eligible for even greater recognition via ten $275,000 awards and ten $100,000 awards. Applications submitted to the Challenge were supposed to be innovative and demonstrate all the capabilities of the Android platform, like location based services, media consumption, gaming and social networking, to enrich mobile experience.

andbook - Android Programming

15

powered by anddev.org

Creating Android Applications

In this chapter we will concentrate on the specialties in creating any Android-Application.

Anatomy of an Android Application

There are four building blocks to an Android application:

 Activity

 Intent Receiver

 Service

 Content Provider

Not every application needs to have all four, but your application will be written with some combination of these.

Once you have decided what components you need for your application, you should list them in a file called AndroidManifest.xml. This is an XML file where you declare the components of your application and what their capabilities and requirements are. We will discuss soon, what the AndroidManifest.xml is responsible for.

Activity

Activities are the most common of the four Android building blocks. An activity is usually a single screen in your application. Each activity is implemented as a single class that extends the Activity base class. Your class will display a user interface composed of Views and respond to events. Most applications consist of multiple screens. For example, a text messaging application might have one screen that shows a list of contacts to send messages to, a second screen to write the message to the chosen contact, and other screens to review old messages or change settings. Each of these screens would be implemented as an activity. Moving to another screen is accomplished by a starting a new activity. In some cases an Activity may return a value to the previous activity - for

andbook - Android Programming

16

powered by anddev.org

example an activity that lets the user pick a photo would return the chosen photo to the caller. When a new screen opens, the previous screen is paused and put onto a history stack. The user can navigate backward through previously opened screens in the history. Screens can also choose to be removed from the history stack when it would be inappropriate for them to remain. Android retains history stacks for each application launched from the home screen.

You've reached the end of published parts.

⏰ Last updated: Oct 09, 2012 ⏰

Add this story to your Library to get notified about new parts!

Android programmingWhere stories live. Discover now