Table of Contents

Introduction

About This Book

Conventions Used in This Book

Foolish Assumptions

How This Book Is Organized

Part I: Getting the Android SDK to Work

Part II: Building the Core of an Android Application

Part III: Making Your Applications Fit for the Enterprise

Part IV: Enhancing the Capabilities of Your Android Application

Part V: Effectively Developing, Testing, and Publishing Apps

Part VI: The Part of Tens

Icons Used in This Book

Where to Go from Here

Part I: Getting the Android SDK to Work

Chapter 1: Taking a Quick Look at Mobile Applications on Android

Writing Apps for a Mobile Platform

Seeing What Android Has to Offer

Doing the Sample Application Thing

Understanding the Android System Architecture and the Android Application Model

Understanding the hardware aspects of an Android device

Working with the Linux operating system

Taking advantage of native libraries

The Android Runtime

The Android Application Framework

Understanding the Android Application Model

Applications

App widgets

Services

Activities

Views

Fragments

Menus and the Action Bar

Shared preferences

Files on internal and external storage

Content providers

Resources

Intents and intent filters

Tasks

Context

Designing Android Applications

Chapter 2: Setting Up an Android Development Environment

Setting Up Java

Setting Up Eclipse

Setting Up Android Development Components

Android SDK Starter Package and the Android SDK Components

Eclipse plug-in for Android

Verifying the Development Environment

Creating an emulator

Creating and running a sample program

Understanding the files in the sample project

Importing, Running, and Debugging Tic-Tac-Toe

Running on an emulator

Setting up debugging and running on an Android device

Chapter 3: Making Apps Using the Android SDK

Walking Through the Eclipse Project for Tic-Tac-Toe

Developing the Tic-Tac-Toe Application

Understanding the Different Types of Android Programs

Understanding Activities

Specifying activities in the AndroidManifest.xml file

Implementing activities

Implementing an Activity's User Interface

Laying out a view

Implementing the user interface logic by using event listeners

Implementing the user interface by implementing your own View class

Handling user interactions in the activity itself

Initiating actions from menus and the Action Bar

Setting application preferences

Building Rich User Interfaces for Larger Screens Using Fragments

Understanding fragments

Embedding fragments in activity layouts

Implementing fragments

Incorporating fragments into activity behavior

Managing the Activity Life Cycle

Coordinating activities

Starting activities using intents and intent filters

Saving the transient state of activities

Using tasks to manage the behavior of groups of activities

Implementing Services

Managing Persistent Application Data

Using Shared Preferences to save persistent data

Using files

Employing SQLite

Sharing data across applications through content providers

Part II: Building the Core of an Android Application

Chapter 4: Determining the Appropriate SDK for Your Application

Exploring the Variety of Android Devices and SDKs

Understanding display characteristics

Recognizing there's more than one version of the SDK

Examining the Differences between SDK Versions

Android 1.5 — Cupcake

Android 1.6 — Donut

Android 2.0 — Eclair

Android 2.2 — Froyo

Android 2.3 — Gingerbread

Android 3.0 — Honeycomb

And beyond

Dealing with API Levels

Chapter 5: Designing a User-Friendly Application

Things to Know Before Creating a User Interface

Understanding views

Taking a detailed look at the View hierarchy

Working with views and layouts

Sampling Some Android Layouts

Mocking up a contact display

Examining the XML code closely

Mocking up a simple calculator

Deciphering the structure of a table

Using Greedy widgets that take up multiple columns

Adding non-TableRow elements

Keeping things consistent

RelativeLayout: Flexibility du Jour

The FrameLayout layout

Choosing the Right Layout

Chapter 6: Enhancing Your Layout with Widgets, Styles, and Themes

Beholding the Power of the Framework: Built-In Views

Working with a push button

Creating Tic-Tac-Toe using push buttons

Pretty in pink: Creating custom buttons

Simplifying Attribute Settings with Styles

Creating your own style

Adding inheritance to a style

Taking advantage of the built-in Android styles

Using Themes to Maintain a Consistent Style

Providing compatibility for older devices

Differentiating activities by using specific themes

Chapter 7: Designing Your Application's Logic and Data

Understanding Best Practices in Application Design

Applying object-oriented design

Applying design patterns

Understanding software frameworks

Illustrating Android App Design by Using the Tic-Tac-Toe Example

Discovering classes, responsibilities, and collaborators for Tic-Tac-Toe

Walking through scenarios to discover collaborators and missing classes and responsibilities

Defining method signatures

Incorporating your design into the Android Application Model

Part III: Making Your Applications Fit for the Enterprise

Chapter 8: Making Your Application Fast and Responsive

Becoming Familiar with Nonfunctional Requirements

Designing Your App at Multiple Levels

Optimizing Application Performance

Using the Profiler for Code Optimization

Maximizing Battery Life

Minimizing data services

Minimizing location services

Ensuring Responsiveness in Your Apps

Understanding the SDK Components Used in This Chapter

The Android thread model and components

Power management components

Chapter 9: Making Your Application Safe and Secure

Recognizing the Importance of Security

Looking at Security Holistically

Defining the Threat Model for an Android Application

Understanding the Android Security Model

Protecting SQLite Databases

Minimizing the Security Footprint of Your App

Going Beyond Permissions

Part IV: Enhancing the Capabilities of Your Android Application

Chapter 10: Channeling the Outside World through Your Android Device

Launching a Browser from Your App

Embedding a Browser in Your Android Application

Providing Maps and Location-Based Services

Installing the necessary development components for writing map apps

Displaying a map by using MapView

Calling a geocoding web service and navigating the map

Determining the location of your device (or, wherever you go, there you are)

Building Them Right — Design Considerations for Web and Location-Based Apps

Checking for connectivity

Using threading

Understanding the SDK Components Used in This Chapter

SDK components for incorporating web pages into your application

SDK components for maps

SDK components for finding locations

Chapter 11: Harnessing the Capabilities of Your Android Device

Integrating E-Mail, SMS, and Telephony into Your App

Playing Audio and Video and Capturing Images

Capturing and playing audio

Recording and playing video

Displaying and capturing images

Bringing In the Outside World by Using Sensors

Listing, understanding, and monitoring the sensors on your Android device

Registering with the sensor manager and receiving sensed values

Understanding the SDK Components Used in This Chapter

SDK communication components: SMS, e-mail, and telephony

SDK components for handling media

SDK components for handling sensors

Other SDK components for handling media

Part V: Effectively Developing, Testing, and Publishing Apps

Chapter 12: Effectively Using Your Integrated Development Environment

Eclipse and Android: A Beautiful Friendship

Gaining perspective in Eclipse

Customizing Eclipse for Android

Observing, Debugging, and Tracking an Android App Using Eclipse Perspectives

Getting Serious about Testing — Using the Android Testing Framework

Understanding the SDK Components Used in This Chapter

The Android logging framework

The testing framework API in Android

Chapter 13: Selling Your Application on the Market

Preparing Your App for the Market

Testing your application

Naming and versioning your application

Globalizing your application

Dealing with devices that have limited capabilities

Setting permissions requests

Signing your application

Using embedded maps

Publishing on the Android Market

Creating a developer account

Creating a merchant account

Understanding the Android Market license agreements

Uploading your application to the Android Market

Taking Advantage of Other Marketplaces for Android Apps

The Amazon Appstore for Android

Other marketplaces for Android apps

Becoming Successful in the Market

Fee or free?

Good citizenship: Providing good service

A few more hints

Part VI: The Part of Tens

Chapter 14: The Ten Best Developer Resources for Android

Learning More About Android Development

Seeking out information at the Android Developers home page

Getting advice from experts at the Google I/O sessions

Taking Advantage of Android Resources On the Web

Finding window dressing at Speckyboy.com

Finding sample code at the Google Code site directory

Finding Android Development Help from Experts and Others Like You

Android Developers Google Groups

StackOverflow.com

The Android forums at Phandroid.com

Pondering the Direction of Android Technology

Gizmodo.com

TalkAndroid.com

Looking for Help When You Don't Know Where to Start

Chapter 15: The Ten Most Illustrative Applications for Android

Angry Birds (Rovio Mobile Ltd.)

Sudoku Free (Genina.com)

Pandora (Pandora Internet Radio)

Voice Recorder (Mamoru Tokashiki)

AppAlarm LITE (episode6)

Evernote (Evernote Corporation)

Cardio Trainer (WorkSmart Labs, Inc.)

RunKeeper (FitnessKeeper Inc.)

Yelp (Yelp.com)

Places (Google Inc.)

Index

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

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