The Android platform is a collection of software that includes an operating system and a number of higher-level libraries that simplify the task of communicating with the operating system. It also includes several applications that smartphone users have come to expect, such as a phone (obviously), e-mail client, contact manager, Google Maps, a web browser, a calendar, and so on.
Everything in the Android development environment, as well as all of the included applications, can be programmed with a combination of Java and XML thanks to the so-called runtime that is included with the Android SDK. The runtime translates the Java and XML code that you write into a language that the operating system and the device understand.
The foundation on which Android is built is carefully coded and painstakingly tested Linux 2.6, an operating system that rarely crashes. Linux and its core services manage the physical phone and give Android applications access to its features: touchscreen, memory, data, security, various network receivers and transmitters, camera, and more.
Linux doesn't do it all alone. Android has a number of libraries that provide higher-level customized functions and services for 2D graphics, 3D graphics, and the audio and video file formats in widest use today. In other words, Android supports all of the media formats you could possibly want to use (for more information see http://developer.android.com/guide/appendix/media-formats.html
).
This chapter introduces the Android environment and shows you how to write your first Android app.
In this book, you'll build apps using a combination of XML and Java, which sit in a layer on top of the operating system (with the runtime as the component that translates Java and XML into instructions for the operating system). However, you could, if you wished, access the operating system and its services directly using lower-level languages such as C or C++. You might consider this approach for an application that needs the utmost speed, such as a 3D game or a real-time heart-monitoring program.
The Android runtime environment provides a core set of operating system libraries that can be accessed via Java and XML. These give you access to device features and lower-level Android operating system functions so that you don't have to do any of that hard programming yourself. You simply include the appropriate components from the libraries you need in your program—something called importing—and then employ their capabilities. You'll learn how to put a number of these little engines to work in later chapters.
To run Java SE code, Android uses a tool called the Dalvik Virtual Machine (DVM). The DVM is an optimization mechanism and technology that allows application code and resources to be highly optimized for use in mobile and embedded environments.
The good news is that the DVM is not something that a developer needs to worry about. I describe it here only to give you a sense of what's going on under the hood with Android.
When you launch an Android application, it creates a process that allocates memory and CPU processing resources (processor time slices) to the application, so that it has the resources needed to function. Each time an application is launched and a process is spawned, an instance or copy of the DVM is launched into your Android smartphone's memory. The DVM actually takes the Java language instructions and application's design guidelines in an XML format, along with any external resources (images, audio files, and so on), and translates them into optimized low-level binary code that goes into the smartphone's memory and eventually into the processor for processing.
So, what is the advantage of this DVM? The use of the DVM allows many more applications to run within the somewhat limited memory resources (1GB) and processing power of consumer electronic devices, and it also protects all of the other spawned processes from each other. In this way, the crash of one application will not bring down the entire operating system (as happened in the olden days of DOS and Macintosh). That's huge.
Android does its best to externalize all application assets that do not absolutely need to be in your Java code. It does this by using the simpler XML markup language to define UI and data structures that would otherwise need to be declared and coded in Java. This modularization is aided by having a clearly defined project hierarchy folder structure, which holds logical types of application assets together in an orderly fashion.
Since Android is very particular about where the assets of your project are stored within the project directory, you need to learn where each belongs early in the game. When it comes time to generate your application—a process called compilation—Android looks into these standardized folders to locate each type of asset it needs, and expects to find like assets logically grouped together.
The assets of a project include its Java code, XML layouts, XML animation definitions, and the rich media files that your Java code and XML markup reference. As shown in Figure 4-1, default folders are created in an Android project to hold menus, images, layouts, colors, fixed data values, raw (uncompressed) media, XML constructs, and animation.
The Java code that drives an application is located in the /src (source code) folder and in any subfolders that are defined by your Java code.
You'll find other assets used by your application in logical subfolders of the /res (resources) folder as needed. It is very important that only folders go in the /res folder. If the Android compiler sees any files in this folder, it will generate a compiler error.
The name of the game is to avoid compiler errors at all costs, because if Eclipse sees compiler errors in your code, it does not even bother generating your application. And if your application is not generated, you certainly cannot test it to see how it works.
If you don't have any resources of a certain type (say animation), you do not need to have an empty folder for it. This means that you do not need to create folders that you will not use.
The most common of the default resources (/res) subfolders are shown in the Figure 4-1. The following are the eight provided when you create a project in Eclipse:
layout: UI screen layouts go in the /res/layout folder, which holds XML files containing UI layout definitions written in XML.
anim: XML files that define animation go in the /res/anim folder.
drawable: Images in PNG format (which Google prefers) or the JPEG format (acceptable but not favored by Google) go into the /res/drawable (screen-drawable imagery) folder.
values: XML files that define constant values are in the res/values folder.
color: XML files that specify related color values for your application's UI go in the /res/color folder. For example, if your app has complicated color bundles for different states of a button (a different color for when it is pressed, focused, or unused), they will be logically arranged in this folder.
xml: XML files that define custom data constructs are in the res/xml folder.
menu: XML files defining menu layouts are in the res/menu folder.
raw: Video files that are precompressed go in the res/raw folder, so Android knows not to process them further.
Let's examine the res/values folder in more detail. This is where you place predefined application values in the form of XML files that define the variable names (x
or y
, for instance) and their values that are later referenced in your Java code. For example, these values might be strings (collections of text characters) or constants (hard-coded values that your Java code uses in its program logic and can't change).
Think of the values folder as holding all of your constant values for your application in one place. This way, if you need to adjust them during application development and testing, you make the changes in a single location.
Figure 4-2 shows examples of files that can be placed in this folder:
colors.xml: An XML file that will define the color values to be used in the app. These allow you to standardize the UI. For example, you would define your background color. Then, if you decide to tweak it later, you need to do the tweak in only one place.
dimens.xml: An XML file that defines dimension values, such as standard heights and font sizes for your UI. You can then use these values across your app to ensure it is consistent.
arrays.xml: An XML file that defines a series of values to be used together (known as an array). For example, this could be a list of icon files or a list of options to display to the user.
strings.xml: An XML file that defines text strings to be used in the application. For example, you can place any screen titles or the app's name here and reference them in your code. If you need to change these items, you simply do it here rather than in your code.
styles.xml: An XML file that defines styles to be used in the application. These styles are then applied to the UI elements that require them, so you separate the look of your app from the layout and functionality. This makes your app easier to maintain.
Notice the Android file name conventions for the different types of XML files in the values folder, adding another level of complexity.
One of the most useful features of Android as a development environment is its use of XML to define a great number of attributes within your application's infrastructure. Because you don't need to work inside the Java programming language to handle these attributes, you save hundreds of lines of Java code. Everything within the application—from your UI layouts, to your text strings, to animation, to interprocess communication with Android's operating system services (like vibrating the phone or playing a ringtone)—can be defined via XML.
What makes XML ideal for Android development, and especially for beginners, is its ease of use. It is no more complicated than HTML markup. So, if you know how to use tags to boldface text or insert an image in your web site, you already understand how to use XML.
You will be learning how this works in the next chapters of the book. Suffice it to say that you will become familiar with XML in your Android development. XML brings one heck of a lot of flexibility to Android development.
Android's use of XML for application design is very similar to the way HTML, Cascading Style Sheets (CSS), and JavaScript are used in today's popular Internet browsers. CSS is used to separate the layout and look of a web page from its content and behavior, which are specified by HTML markup and JavaScript code, respectively. This approach leads to more modular and logically structured web pages. Designers can work on the look of a web site using CSS, while search engine optimization (SEO) professionals optimize its findability with HTML, leaving user interaction to programmers who know how to use JavaScript. The same approach applies to Android. Designers can create the UI for an application with XML, while programmers can call and access its elements using Java without affecting screen formatting, animation, or graphics. Genius.
XML gives us amazing flexibility to accommodate variations within our apps, such as different screen sizes, languages, and UI designs. Here, we'll look at a couple of brief examples to give you an idea of XML's power.
Because UI designs can be defined precisely by an XML file, it's easy to deal with the variety of screen sizes available on Android devices today. Let's say that you want to do a custom layout for each of the three primary screen sizes used in Android phones:
Quarter VGA (QVGA), 240 × 320 pixels
Half VGA (HVGA), 320 × 480 pixels (the "sweet spot" for most Android phones)
Wide VGA (WVGA), 800 × 480 pixels (found on the newest phones)
How does XML provide a solution? Simply create a UI design in XML for each size and use Java to determine the screen resolution of the phone.
As another example of how XML can be leveraged, let's take a look at a few lines of code that define an important utility: Android's popular desktop clock. (In Chapter 6, you'll learn how to create your own custom desktop clocks.)
The XML tag for an Android program function usually has the same name as its Java counterpart, so you can access the power of the programming language from simple XML. For example, here is the XML tag that corresponds to Java's AnalogClock
:
<AnalogClock />
Android's XML tags start with a left-angle bracket (<
), followed immediately (no space) by a class name, a space, a slash mark, and a right-angle bracket (/>
).
To customize an AnalogClock
, you must add attributes to the AnalogClock
tag, inserting them before the closing part of the tag (/>
). Suppose you want to add an ID to reference the utility from other parts of the application. Here's how:
<AnalogClock android:id="@+id/AnalogClock />
This adds an ID to your AnalogClock
with the name AnalogClock
, which you can use to reference it elsewhere in your application.
For each XML tag in Android, there are dozens of parameters that allow you to control the tag's appearance and implementation, including its positioning, naming (used in the Java code), and other options.
In real-life, for readability, programmers usually write this code with each configuration parameter indented on a separate line, like this:
<AnalogClock android:id="@+id/AnalogClock, android:layout_width="fill_parent" android:layout_height="wrap_content" />
The Android compiler considers everything inside the AnalogClock
tag to be a parameter, or a customization option, until it reaches a closing tag (/>
). The fill_parent
parameter stretches content to fill a container, and the wrap_content
parameter tiles the content. We'll cover these and other view and layout concepts in Chapter 6.
In addition to Java code and XML markup, the resources your application draws on consist primarily of media elements and other file types that contribute to its functionality in one way or another. These may include XML files that contain animation parameters or text strings, bitmap image files, and even audio and video streams.
One of the primary reasons for externalizing resources is that you can have sets of resources for variations, such as different screen sizes or language versions. Language localization localizes the application to any given country. These language localizations can be easily referenced in the Java code and switched when necessary by pointing to different external file names or folders.
Let's look at an example of a common application resource: the bitmap image. Your PNG or JPEG bitmap image goes into the /res/drawable folder. It can then be referenced by its file name only (excluding its extension) in the Java code as well as in the XML. For this reason, be sure not to give a PNG file and a JPG file the same name.
Also, contrary to normal file-naming conventions, image file names can contain only numbers and lowercase letters, so make sure to remember this rule (one of the many anomalies of Android programming).
In summary, to set up bitmap images to be used in your application, do the following:
Name them correctly.
Use PNG or JPG format.
Make sure they are in the /res/drawable folder so that Android can find them.
Another great example of resource usage is supplying different UI screen layouts for portrait and landscape orientations. Usually, we will set our default screen UI for phones to portrait mode, as most people use their phone in this way (turning it sideways only to view video).
Android provides support for alternate resources. If you set these up correctly, Android will determine the current settings and use the correct resource configurations automatically. In other words, you provide resources for each orientation, and Android uses the correct resources as the user changes from one orientation to another.
Each set of alternative resources is in its own folder, where it can be referenced and located later on in your Java code. We can provide resources for different screen orientations and resolutions in this fashion, and have Android decide which folders to look in for our application resources based on each user's smartphone model.
Android offers three screen resolutions: low resolution (320 × 240), medium resolution (320 × 480), and high resolution (800 × 480).
To add an alternate resource folder, create a directory under /res with the form <resource_name>-<config_qualifier>. For instance, create/res/drawable-hdpi.
This creates an alternate resource folder for high-density dots per inch (hdpi
) images. The alternate folder will be used automatically if the Android smartphone screen uses a WVGA (800 × 480) screen high-end model. Otherwise, it will use the normal HVGA (320 × 480) screen images, located in the default /res/drawable folder.
If you want to also support low-end screens, you can use the low-density dots per inch qualifier, ldpi
. There is a medium dots per inch qualifier, mdpi
, as well.
So, to have images for QVGA, HVGA, and WVGA screens arranged in folders in a way that allows Android to automatically recognize the folder hierarchy, set up your folder structure as follows:
/res, with only folders
/res/drawable-ldpi, with the following low-density DPI screen images (QVGA):
icon.png (application icon file), 32 × 32 pixels
background.png (application background), 320 × 240 pixels
/res/drawable-mdpi, with the following medium-density DPI screen images (HVGA):
icon.png, 48 × 48 pixels
background.png, 320 × 480 pixels
/res/drawable-hdpi, with the following high-density DPI screen images (WVGA):
You're well on your way to correctly setting up your Android application's resources. One more file we need to examine is AndroidManifest.xml.
When Android launches your application, the first file it seeks out is the application manifest file. This file is always located in the root of your project folder and directory structure, and is always called AndroidManifest.xml so that it can be located easily on startup.
The Android manifest declares some very high-level definitions and settings for your application using (surprise!) the XML markup language. The following are some of the key items AndroidManifest.xml includes:
References to the Java code you will write for your application, so that your code can be found and run
Definitions of the components of your Android application, including when they can be launched
Definitions of permissions for application security and for talking with other Android applications
Declaration of the a minimum level of Android operating system version support, which amounts to defining which version(s) of Android your application is going to support
All of the apps that we will write in this book will support Android versions 1.5, 1.6, 2.0, 2.1, 2.2, 2.3, and 3.0. We call this "Android 1.5 compatibility," because it supports every version of Android all the way back to version 1.5.
I try to develop for the 1.5 API level 3 so that my applications run on API versions 1.5, 1.6, 2.0, 2.1, 2.2, 2.3, and 3.0. Later versions are obviously backward-compatible, so the further back you develop your minimum version level support, the more people will be able to use your application. If you want to make money selling Android apps, this concept translates directly into dollars, as there are millions of 1.5 and 1.6 phones still out there.
By now, you're probably aching to fire up Eclipse and create an application to see how all this works. A tradition in all programming languages for new users is the crafting of the "Hello World" application, so let's create our own Hello World application right here and now.
First, we'll launch Eclipse and create the application. Then we'll take a look at the files and Java and XML code that Eclipse generates to get your app up and running. Finally, we'll give the app an icon to display on the Android main menu.
The first step is to launch Eclipse. From there, you'll create a project to house the application.
To launch Eclipse, find and click the Eclipse shortcut launch icon on your workstation. If a security warning dialog like the one shown in Figure 4-3 appears, click Run. If you don't want to see this dialog every time you start Eclipse, uncheck the box that reads "Always ask before opening this file."
Next you will see the Eclipse startup screen. Then, in a few more seconds, a dialog will appear, allowing you to tell Eclipse where your projects folder is kept on your hard disk drive. Mine is kept on my C: drive and is called Projects, so the entry is C:Projects, as shown in Figure 4-4. If you don't want to specify this each time you start Eclipse, you can check the "Use this as the default and do not ask again" option. Once you click the OK button, Eclipse will start, and the IDE will appear.
Once the IDE has launched, select File
You'll see the New Android Project dialog, which allows you to specify all sorts of important variables for your applications. Let's address them one by one.
Project name: This is the name of the folder in your C:/Projects folder that holds your Hello World application folders and files. Let's give this folder the same name as our application: HelloWorldAndroid.
We have omitted spaces from the folder name because spaces are not supported in Java names. It is not advisable to use spaces in names of folders that you use for software development.
Create new project in workspace: We'll keep this radio button selected so that Eclipse will create the new project within its IDE working area for us automatically.
Use default location: You can see what folder structure Eclipse will use for your project folder by keeping this option checked.
Build Target: This panel allows you to specify the versions of Android your application will support. The more you support, the more users will be able to use your application, so let's use a build target of Android 1.5. That version has everything that we will need to build most applications that work across all current Android smartphones. You do not need to select the Google APIs for 1.5—just pick the 1.5 Android open source package, which includes everything.
Application name: The Properties section lets you specify where you want Eclipse to set up the framework for your application, which is where some of the basic Java and XML code will be written by the IDE to get you started (a really a nice feature of Eclipse). The first field in this section is for the application name, which is the name that will appear in the application's title bar when it runs. Let's set that name to Hello Great Big Android World Out There!
Package name: This is the name you want to use for your Java package. For now, we will simply define this as the name of the container that will hold all of the Java code our application uses. Let's name this package Hello.World
. (Java package names are separated by periods, much like file pathnames are separated by forward slashes).
Create Activity: Leave this box selected and let's name our Java activity class MyHelloWorld
. A Java activity class is a collection of code that controls your UI (you will learn more about activities in the next chapter).
Min SDK Version: Set this value to 3. This matches up with your Android 1.5 build target selection, since version 1.5 of Android uses the level 3 SDK.
Figure 4-6 shows the completed New Android Project dialog for this example. When you are finished filling it out, click the Finish button. Eclipse will create your first Android project for you.
After you click Finish in the New Android Project dialog, you are returned to Eclipse. In the IDE, you can navigate through the project using the Package Explorer pane.
Let's look at the folder hierarchy that Eclipse has automatically created for our project. Click the arrow icons next to the HelloWorldAndroid folder, and then click the arrow icons next to the src and res folders under it.
Going further, click the open folder arrows next to the Hello.World, drawable, layout, and values folders, so you can see the Java and XML files that Eclipse has so kindly created for us. Figure 4-7 shows the Package Explorer pane at this point.
Now let's open some of these files and see just how much coding Eclipse has done for this project.
To open any of the files listed in the Package Explorer, select the file by clicking once on it (the icon will turn blue), and then press F3. Alternatively, right-click the file name to get a context-sensitive menu, and then select the Open option.
The MyHelloWorld.java file holds our activity class. Right-click it and select Open to explore it now. As shown in Figure 4-8, Eclipse has already written the code to create a UI screen for the application and set its content to the UI defined in the main.xml file (with the R.layout.main
text), which we will look at next.
Let's examine this in a little more detail:
package Hello.World; import android.app.Activity; import android.os.Bundle; public class MyHelloWorld extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); } }
As you can see, Eclipse used the information in our New Android Project dialog to create a usable Java file, which includes a Hello.World package
declaration, import
statements, a MyHelloWorld
activity class, and an onCreate()
method.
Next, let's take a look at our UI interface markup code in the main.xml file in the layout folder, as shown in Figure 4-9. The XML code in the main.xml file is quite a bit different from the Java code.
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" > <TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="@string/hello" /> </LinearLayout>
It uses tags like those in HTML to define structures that you will be using in your applications. In this case, it is a UI structure that contains a LinearLayout
tag, which keeps our UI elements in a straight line, and a TextView
tag, which allows us to put our text message on the application screen.
If you don't see something like Figure 4-9, to view the file, click its icon in the layout folder, select Open, and then choose main.xml at the bottom of the window.
Notice that the TextView
tag uses an attribute called android:text
, which is set equal to @string/hello
. This is a reference to the strings.xml file, which we are going to look at next.
So far, we have looked at the Java code, which points to the main.xml file, which in turn points to the strings.xml file. Open that file now (right-click the file's icon in the Package Explorer and select Open). The file will open in a third tab within the Eclipse IDE, as shown in Figure 4-10.
When you open the strings.xml file, you will see that Eclipse has already added two variables: hello
and app_name
. The string variable named hello
is to hold the text that we want our application to display. The app_name
variable is to hold the string data that will appear in the title bar at the top of the application. We already specified it in the New Android Project dialog as Hello Great Big Android World Out There!.
Notice the tabs at the bottom of the editing pane labeled Resources and strings.xml. These tabs allow you to switch between the actual XML code and the more user-friendly interface that you see in Figure 4-10, which makes editing Android resources a bit easier than coding straight XML.
Since the app_name
value is already specified thanks to our New AndroidProject dialog, let's leave it alone and set the value of hello
.
To set the value of hello
, all you need to do is to click its name in the left pane of the Resources view and edit its text. Once you click hello
, two fields will appear. One contains the string variable name (hello
), and the other has its value. In the Value field, type Hello Android World, Here I Come!, as shown in Figure 4-11.
Once you have entered a string for the hello
variable, click the strings.xml tab at the bottom of the editing pane and take a look at the XML code that Eclipse has generated, as shown in Figure 4-12.
In this view, you can see the actual XML code for the string tags, which are nested inside the <resources>
tags that allow us to define resources for our Android application.
<?xml version="1.0" encoding="utf-8"?> <resources> <string name="hello">Hello Android World, Here I Come!</string> <string name="app_name">Hello Great Big Android World Out There!</string> </resources>
Each <string>
tag has a variable name
attribute so we can refer to it by name in our Java code. Tags are ended by the same tag that started them with the addition of a forward slash, like this: <
string
>
XXX
</string
>
.
As you can see in the XML code, Eclipse has created the correct XML code for us to use to write our Hello World message to the smartphone screen. The code reads as follows:
<string name="hello">Hello Android World, Here I Come!</string>
Now it's time to compile and run the application.
To compile and run the application, right-click the HelloWorldAndroid folder icon in the Eclipse Package Explorer and select Run As
Eclipse will compile your app, and then open a version 1.5 emulator window to display a virtual phone on which to run it. When the emulator first starts up, it will display the standard smartphone screen, simulating a background image and standard Android icons for system time, signal strength, and so on.
To actually run the app in the emulator, you need to click the Menu button in the middle-bottom area of the screen, or use the Home button to display your application icons and then select an icon to run. So, your application will not just run in the emulator automatically. You must use the phone interface, finding and running the app as you would in real life. Give it a shot now. Figure 4-13 shows Hello World running in the emulator.
Congratulations, you have created your first application. Next, we'll customize its Android icon.
The final thing that we are going to do in this chapter is give our application an icon that will show up on users' Android devices and can be used by them to launch the application. We'll use what you have learned about defining alternate resources by creating an icon that works on small, medium, and large screens. We'll add the appropriate icon
files into the correct alternate folders so that Android automatically finds and uses the correct icon for each type of Android screen:
Not surprisingly, this is done by giving your icon an exact name and file format, and putting it into an exact directory. When Android finds an icon file there, it automatically puts it into play as your application's icon. The file must follow these rules:
Here, I'll use my 3D company logo, but you can use any image you like. Also, I use Photoshop for this type of image editing, but you can use any image-editing program you prefer.
The first thing we need to do is to put the logo onto a transparency. Here are the steps to remove the white background from the logo (illustrated in Figure 4-14):
Open the logo file. It is 200 × 200 pixels.
Select the Magic Wand tool (in the toolbar) and set the tolerance at 12 (top toolbar). Click the white areas to select them.
Choose Invert the Selection to grab only the logo and select Edit
Create a new file of 200 × 200 pixels and paste the logo pixels on top of the transparency.
Now, we'll create three standard Android-sized icons by using the Image
High-resolution icon: Resize the image from 200 × 200 to 72 × 72 pixels, as shown in Figure 4-15. Then use Save For Web to save it as a 24-bit PNG file with the transparency option checked in your project folder: C:/Android_Project/res/drawable-hdpi. Name it icon.png.
Figure 4.15. Using the Image Size command to create a high-resolution, 72-pixel square application icon
Medium-resolution icon: Repeat the same process for the medium-resolution icon. First, select Edit
Low-resolution icon: Go back and resize the image to 32 pixels, and save it to the low-density image folder: C:/Android_Project/res/drawable-ldpi. Name it icon.png.
Figure 4-16 shows the three different icon.png files, illustrating their relative sizes to the original. Android will now pick the appropriate icon when your application is run.
Don't delete the drawable folder, because Android will use the icon in it if none of your resources matches the characteristics of the device running your app.
Android is very particular about which types of files you use and where you put them within your project folder. We will be looking at the particulars of how things need to be set up in order to work properly in Android throughout this book.
In this chapter, you created and compiled your first project for Android inside Eclipse using the Android application development environment you installed in Chapter 3. You saw that the Android environment in Eclipse gives you a lot of development assistance, and as a beginner, you'll want to take advantage of every bit of help you can get. The proof is in the pudding, as they say. You just developed an Android Hello World application and needed to change only one line of code in the Eclipse IDE. You saw how Android sets up a basic application, and which Java and XML files are needed in order to create a UI and a basic application.
Your Android application icon is very important to the branding of the application, as it represents your application on the users' desktop, which is usually crowded with all of the other installed application icons. Customizing an app icon is as simple as putting the icon file into the correct folder. You just must make sure that the icon is saved in the correct file type, is the correct resolution, uses an alpha channel, and has the correct file name: icon.png.
The next chapter provides an overview of Java and how Android compartmentalizes things having to do with an application. In the remaining chapters, we will get down to actually coding in Java and creating XML markup that delivers your application's UI and functionality.
98.82.120.188