Skip to main content

Beginning Android Application Development

Beginning Android Application Development

Wei-Meng Lee

ISBN: 978-1-118-01711-1 April 2011 448 Pages

 Paperback

In Stock

£30.99

*VAT

Description

Create must-have applications for the latest Android OS

The Android OS is a popular and flexible platform for many of today's most in-demand mobile devices. This full-color guide offers you a hands-on introduction to creating Android applications for the latest mobile devices. Veteran author Wei Meng Lee accompanies each lesson with real-world examples to drive home the content he covers. Beginning with an overview of core Android features and tools, he moves at a steady pace while teaching everything you need to know to successfully develop your own Android applications.

  • Explains what an activity is and reviews its lifecycle
  • Zeroes in on customizing activities by applying styles and themes
  • Looks at the components of a screen, including LinearLayout, AbsoluteLayout, and RelativeLayout, among others
  • Details ways to adapt to different screen sizes and adjust display orientation
  • Reviews the variety of views such as TextView, ProgressBar, TimePicker, and more

Beginning Android Application Development pares down the most essential steps you need to know so you can start creating Android applications today.

Related Resources

INTRODUCTION xv

GETTING STARTED W CHAPTER 1: ITH ANDROID PROGRAMMING 1

CHAPTER 2: ACTIVITIES AND INTENTS 27

CHAPTER 3: GETTING TO KNOW THE ANDROID USER INTERFACE 81

CHAPTER 4: DESIGNING YOUR USER INTERFACE USING VIEWS 125

CHAPTER 5: DISPLAYING PICTURES AND MENUS WITH VIEWS 169

CHAPTER 6: DATA PERSISTENCE 203

CHAPTER 7: CONTENT PROVIDERS 237

CHAPTER 8: MESSAGING AND NETWORKING 263

CHAPTER 9: LOCATION-BASED SERVICES 301

CHAPTER 10: DEVELOPING ANDROID SERVICES 331

CHAPTER 11: PUBLISHING ANDROID APPLICATIONS 359

APPENDIX A: USING ECLIPSE FOR ANDROID DEVELOPMENT 381

APPENDIX B: USING THE ANDROID EMULATOR 393

APPENDIX C: ANSWERS TO EXERCISES 411

INDEX 415

ReadMe File
Download
All Chapter Files
Download
Chapter 1
Download
Chapter 2
Download
Chapter 3
Download
Chapter 4
Download
Chapter 5
Download
Chapter 6
Download
Chapter 7
Download
Chapter 8
Download
Chapter 9
Download
Chapter 10
Download
Resources
Download
ChapterPageDetailsDatePrint Run
235-36Error in Code
showDialog(1)

should be:
showDialog(0)
10/4/11

50Error in Code
"Using the same project created in the previous section, add the following statements in bold to the main.xml file:"

This should be "activity2.xml" instead "main.xml"
5/15/2011

54Error in Code
It says:
startActivityForResult(i, 1);

It should say:
startActivityForResult(i, request_Code);

The code will still work, since request_Code = 1, but it is better to use the constant.
7/12/2011

119Error in Code
this line must be bolded:
import android.view.View;
7/27/11

132Typo
The text just below Figure 4-5 reads as follows:
"The ToogleButton displays..."

it should be:
"The ToggleButton displays..."
6/20/11

144Error in Text
Title for the Try it Out currently reads "Using the TimePicker Wiew"

Should read "Using the TimePicker View"
7/13/2011

151, 153Error in Code
In the code in bold towards the bottom it says:
"Date selected:" + datePicker.getMonth() + 1 + ..... etc.

It should be:
"Date selected:" + (datePicker.getMonth() + 1) + .... etc

This will ensure that the "1" is added; otherwise the output looks like this (assuming the month of June (5) is picked: 51/1/11

With the fix above it will show: 6/1/11

Also on pg 153 in the "how it works" section.
7/6/11

159Errors in Code
This line: setContentView(R.layout.main);

commented out, like this:
// setContentView(R.layout.main);

AND

Instead of using constants 0, 1 and 2, like this:

lstView.setChoiceMode(2); //CHOICE_MODE_MULTIPLE

You could also use:

lstView.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE);


AND

This line:
setListAdapter(new ArrayAdapter(this,
                android.R.layout.simple_list_item_checked, presidents));

Should be bold.
7/22/11

186Missing Step
Add step between Step 1 and 2: Add the following <Button> element to the main.xml file:

<?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"
    >

<Button android:id="@+id/btn1"
        android:layout_width="fill_parent" 
        android:layout_height="wrap_content"
        android:text="Tap and hold this for more options..." />

</LinearLayout>
7/28/11

5187Error in Menu Definition
The "Menus" application has the following menus defined:
menu.add(0,3,3, "Item 5");
menu.add(0,3,3, "Item 6");
menu.add(0,3,3, "Item 7");

This causes menus 5-7 to display
"You clicked on Item 4"

Should instead be:
menu.add(0,4,4, "Item 5");
menu.add(0,5,5, "Item 6");
menu.add(0,6,6, "Item 7");
6/14/11

195Missing Step
Insert the line:
<uses-permission android:name="android.permission.INTERNET" />
in the manifest tag to make webview work.
9/12/11

270Error in Code
Inside the Note box, SMS_SEND should read SEND_SMS.
7/13/2011

273Error in Text
Try It Out title should be "Updating an Activity When a SMS is Received"
7/13/2011

278Error in Code
"onDestroy()" method is invoked and the super.onPause() method is called before exiting

"super.onPause()" method should be "super.onDestroy()" method
12/6/2011

279Error in Text
Step 3 of the Try It Out:
main.xml

should be:
AndroidManifest.xml
6/9/11

286Error in Text
Try It Out title should be "Downloading Images"
7/13/2011

287,297Error in Code
On page 287, the URL for the image: "http://www.streetcar.org/mim/cable/images/cable-01.jpg" is no longer valid.

Replace URL with: "http://www.mayoff.com/5-01cablecarDCP01934.jpg"

The same applies to the URL on page 297.
5/16/2011

302Error in Figure
The figure should select Google APIs.
7/13/2011

9306Error in Code
Step 2, main.xml should be AndroidManifest.xml.
5/16/2011

9322Error in Code
You need to add in the following permissions in order for your application to receive location coordinates:

<uses-permission android:name="android.permission.ACCESS_COARSE_LOC ATION">
<uses-permission android:name="android.permission.ACCESS_FINE_LOCAT ION">
5/16/2011

338Error in Code
This line must be bolded:
import android.util.Log;
7/31/11