Android Apps for Absolute Beginners

By Wallace Jackson

This book cuts through the fog of jargon and mystery that surrounds Android application development, and gives you simple, step-by-step instructions to get you started.

Full Description

  • ISBN13: 978-1-4302-3446-3
  • 344 Pages
  • User Level: Beginner
  • Publication Date: March 28, 2011
  • Available eBook Formats: EPUB, MOBI, PDF
  • Print Book Price: $29.99
  • eBook Price: $20.99
Buy eBook Buy Print Book Add to Wishlist

Related Titles

Full Description

Anybody can start building simple apps for the Android platform, and this book will show you how! Android Apps for Absolute Beginners takes you through the process of getting your first Android applications up and running using plain English and practical examples. It cuts through the fog of jargon and mystery that surrounds Android application development, and gives you simple, step-by-step instructions to get you started.

  • Teaches Android application development in language anyone can understand, giving you the best possible start in Android development
  • Provides simple, step-by-step examples that make learning easy, allowing you to pick up the concepts without fuss
  • Offers clear code descriptions and layout so that you can get your apps running as soon as possible

What you’ll learn

  • Get yourself and your computer set up for Android apps development
  • Use the Eclipse programming environment to make your Android development efficient and straightforward
  • Follow steps in plain English to build simple apps and get them working immediately
  • Style your application so that it appeals to potential users
  • Make use of the Android’s touch screen
  • Use shortcuts and cheat sheets to create apps the easy way
  • Use the basics of Java and XML to move onto more advanced apps

Who this book is for

If you have a great idea for an Android app, but have never programmed before, then this book is for you. You don’t need to have any previous computer programming skills—as long as you have a desire to learn, and you know which end of the mouse is which, the world of Android apps development awaits!

Table of Contents

Table of Contents

  1. Preliminary Information: Before We Get Started
  2. What’s Next? Our Road Ahead
  3. Setting Up an Open Source Android Development Environment
  4. An Introduction to Java, XML and How Android Works
  5. An Overview of the Android Application Framework
  6. Screen Layout Design: Views, ViewGroups and Layout Types
  7. User Interface Design: Buttons, Menus, Dialogs and Alerts
  8. Designing Graphics for Android: 2D Images & Animation
  9. Adding Interactivity: Handling UI Events
  10. Understanding Content Providers
  11. Understanding Intents and Intent Filters
  12. The Future: 3D, Widgets, Bluetooth, Maps, Search, and More
Source Code/Downloads

Downloads are available to accompany this book.

Your operating system can likely extract zipped downloads automatically, but you may require software such as WinZip for PC, or StuffIt on a Mac.

Errata

Please Login to submit errata.

On page 7 and 19/21:
Conflicting information. Primarily correction is needed in Chapter 1 and the sentence in Chapter 2.

Chapter 1 Page 7 states, "Currently, Android requires the Galileo version of Eclipse (not Helios).

Chapter 3 Page 19 states, "Here, we will walk through installing Java SE and the JRE, Eclipse 3.5(Galileo) or 3.6 (Helios)both of which are supported by the Android SDK, the Android SDK, and the Android Development Tools". (Also includes errors in this sentence with no space between the ")" and "both" and a duplicate of "the Android SDK")

Chapter 3 Page 20 states, "Now that you have successfully installed Java on your computer, you can install Eclipse Galileo (Version 3.5) or Helios (Version 3.6), which is the IDE you will use for your Android projects."

On page 26:

On page 26 it reads:

"1. Click the Eclipse Quick Launch bar icon to start Eclipse."

When I do I get this message:

"A Java Runtime Environment (JRE) or Java Development Kit (JDK) must be available in order to run Eclipse. No Java virtual Machine was found after searching the following locations: C:\eclipse\jre\bin\javaw.exe javaw.exe in your current PATH"

Why?

Please note I've tried modifing the path and even copying the "jre" folder into the "eclipse" folder.

On page 27:

The install dialog does not work due to the file Eclipse created does not have write permission.
To check permissionon folder:
1. Click on the folder
2. Click on Properties
3. Click on Security tab
4.Click "User Name"
The permission is shown in lower Panel
To Change Permissions
1.Click on Edit
2.Higlight Name
3.Click Full Control Allow Box
4.Click apply
If this is done then the detail used by page 27 will work and allow download of the ADT

On page 28:

Attempting to install plug-in I get the following error: " Cannot complete the install because one or more required items could not be found.
Software being installed: Android DDMS 16.0.1.v201112150204-238534 (com.android.ide.eclipse.ddms.feature.group 16.0.1.v201112150204-238534)
Missing requirement: Android DDMS 16.0.1.v201112150204-238534 (com.android.ide.eclipse.ddms.feature.group 16.0.1.v201112150204-238534) requires 'org.eclipse.ui 3.6.2' but it could not be found"

On page 56-60:

The new Android SDK or Indigo version of Eclipse does not behave as indicated by the book.

On page 56 when the code is generated there is no line added which (according to the book) reads:

import android.os.Bundle;


On page 57 when one selects the main.xml and then Open the "Android Layout Editor" view is opened. To open in code view one has to select main.xml and then Open With... "Android Resource Editor".

On page 60 Run as Android app does not work. In the console window it says there is an emulator warning/error:

[2011-07-22 11:27:43 - Emulator] invalid command-line parameter: Files\Android\android-sdk\tools/emulator-arm.exe.
[2011-07-22 11:27:43 - Emulator] Hint: use '@foo' to launch a virtual device named 'foo'.
[2011-07-22 11:27:43 - Emulator] please use -help for more information

though it doesn't tell one where to use @foo

So following the instructions in the book I get to page 60 but can't get the Hello World to run.






On page 61:
The author devotes 4 pages explaining how to create multiple icons. He also recommends targeting Android 1.5. He obviously never tested this setup. Multiple icons was not supported until Android 1.6. Here is a quote from the Android website: Strategies for Android 1.5: "All applications written for Android 1.5 or earlier, by default, support only the baseline HVGA screen used on the T-Mobile G1 and similar devices, which is normal screen size and medium density (mdpi)."

On page 105:
There is an error in some of the example code given on page 105.

the code reads

<TextView
android:id="@+id/label"
android:layout_width="fill_parent"
android:layout_heightfill_parent"
android:text="Type here:"/>

when it should read

<TextView
android:id="@+id/label"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:text="Type here:"/>


On page 109:
The following error is from main.xml:
error!
ClassCastException: com.android.layoutlib.bridge.MockView cannot be cast to android.view.ViewGroup
Exception details are logged in Window > Show View > Error LogThe following classes could not be found:
- SlidingDrawer

This does not run:
"Figure 6–1 5 shows the sliding drawer example running in the emulator."

Will you publish the source code?

On page 119:
Near the top of the page, "Open the project tree on the left Package Explorer tab and expand the src folder by
clicking the arrow."

Should "Open the project tree on the left Package Explorer tab and expand the res folder by
clicking the arrow."

src folder -> res folder. Figure 7.2 displays it correctly.

On page 119:
The second paragraph says you should "[E]xpand the src folder by clicking the arrow. Then right click the drawable folder..."

The drawable folder is located in the "res" folder, not the "src" folder. Figure 7-2 shows the correct location.

On page 121:
The second to the last paragraph mentions code examples provided with the book. Unfortunately, the book page on apress.com does not contain any downloads. Later in the book, the author suggests using other files from the download - again, what download?

Please help by providing the code examples for the book as either a download on apress.com, or optionally just send them to my email address.

Thanks,
Dan.
Author Comment:
Click on the Source Code/Download tab above, which will reveal a link from which you can download the book's supplementary material.

On page 122:
This could simply be a different version of Eclipse, however the tip on page 122 states that you can right click the top level directory of a project and select Validate. The validate option does not appear in that menu.

On page 123 & 124:
Example program as written force closes when run within the Android emulator.

On page 127:
The examples refer to a downloaded code bundle. This bundle seems to not exist.

I have search you web sight and the entire book for a link. It is impossible to use the examples without this.
Author Comment:
Click on the Source Code/Download tab above, which will reveal a link from which you can download the book's supplementary material.

On page 127-131:

On jpage 127 you told us to copy image1.png and image2.png from the code source res folder.

No where between page 127 and 131 do you mention to copy the five icon files (image1icon, image2icon, menu3icon, menu4icon, and menu5icon). I found them on my own.

On page 131:

text indicates:

"figure 7-14 shows the completed chapter7/res/menu/menuname.xml file."

however it should be:

"figure 7-14 shows the completed chapter7/res/menu/mainmenu.xml file."

On page 136 & 137:
Section: Making the Menu Work:

text does not specify what file to be adding the:

"android:id="@+id/uilayout"

to... (should be the res/layout/main.xml file)


then it goes on to add java code, but again does not specify which file (until later when mentioning figure 7-20).

On page 137:
(R.color.background)
(R.color.background2)

if these can not be resolved try:
(android.R.color.white)
(android.R.color.black)

It was the only way I could get the desired result.

On page 137:
ImageView image = (ImageView)findViewById(R.id.ImageView01);

should be

ImageView image = (ImageView)findViewById(R.id.mageView1);

On page 176 through 180:

The video comes out scrambled. Page 177 shows both the layout parameters using: “fill_parent”, however the download shows both parameters using: “320px”. I tried using both and “wrap_content”, but the video still comes out scrambled.

On page 240:
The code shown is:

Toast.makeText(this, "New Contact: " + newName + " " + newPhone, Toast.LENGTH_SHORT);

It should have the .show() added as follows:

Toast.makeText(this, "New Contact: " + newName + " " + newPhone, Toast.LENGTH_SHORT).show();

The graphical example includes it but the text example does not.