万本电子书0元读

万本电子书0元读

顶部广告

Android Application Development Cookbook - Second Edition电子书

售       价:¥

0人正在读 | 0人评论 9.8

作       者:Rick Boyer

出  版  社:Packt Publishing

出版时间:2016-03-31

字       数:310.7万

所属分类: 进口书 > 外文原版书 > 电脑/网络

温馨提示:数字商品不支持退换货,不提供源文件,不支持导出打印

为你推荐

  • 读书简介
  • 目录
  • 累计评论(0条)
  • 读书简介
  • 目录
  • 累计评论(0条)
Over 100 recipes to help you solve the most common problems faced by Android Developers today About This Book Find the answers to your common Android programming problems, from set up to security, to help you deliver better applications, faster Uncover the latest features of Android Marshmallow to make your applications stand out Get up to speed with Android Studio 1.4 - the first Android Studio based on the IntelliJ IDE from JetBrains Who This Book Is For If you are new to Android development and want to take a hands-on approach to learning the framework, or if you are an experienced developer in need of clear working code to solve the many challenges in Android development, you can benefit from this book. Either way, this is a resource you’ll want to keep at your desk for a quick reference to solve new problems as you tackle more challenging projects. What You Will Learn Along with Marshmallow, get hands-on working with Google’s new Android Studio IDE Develop applications using the latest Android framework while maintaining backward-compatibility with the support library Master Android programming best practices from the recipes Create exciting and engaging applications using knowledge gained from recipes on graphics, animations, and multimedia Work through succinct steps on specifics that will help you complete your project faster Keep your app responsive (and prevent ANRs) with examples on the AsynchTask class Utilize Google Speech Recognition APIs for your app. Make use of Google Cloud Messaging (GCM) to create Push Notifications for your users Get a better understanding of the Android framework through detailed explanations In Detail The Android OS has the largest installation base of any operating system in the world; there has never been a better time to learn Android development to write your own applications, or to make your own contributions to the open source community! This “cookbook” will make it easy for you to jump to a topic of interest and get what you need to implement the feature in your own application. If you are new to Android and learn best by “doing,” then this book will provide many topics of interest. Starting with the basics of Android development, we move on to more advanced concepts, and we’ll guide you through common tasks developers struggle to solve. The first few chapters cover the basics including Activities, Layouts, Widgets, and the Menu. From there, we cover fragments and data storage (including SQLite), device sensors, the camera, and GPS. Then we move on more advanced topics such as graphics and animation (including OpenGL), multi-threading with AsyncTask, and Internet functionality with Volley. We’ll also demonstrate Google Maps and Google Cloud Messaging (also known as Push Notifications) using the Google API Library. Finally, we’ll take a look at several online services designed especially for Android development. Take your application big-time with full Internet web services without having to become a server admin by leveraging the power of Backend as a Service (BaaS) providers. Style and approach This book progresses from the fundamentals of Android Development to more advanced concepts, with recipes to solve the most common problems faced by developers. This cookbook makes it easy to jump to specific topics of interest, where you’ll find simple steps to implement the solution and get a clear explanation of how it works.
目录展开

Android Application Development Cookbook Second Edition

Table of Contents

Android Application Development Cookbook Second Edition

Credits

Disclaimer

About the Authors

About the Reviewer

www.PacktPub.com

eBooks, discount offers, and more

Why Subscribe?

Preface

What this book covers

What you need for this book

Who this book is for

Sections

Getting ready

How to do it…

How it works…

There's more…

See also

Conventions

Reader feedback

Customer support

Downloading the example code

Errata

Piracy

Questions

1. Activities

Introduction

Declaring an activity

Getting ready

How to do it...

How it works...

Starting a new activity with an intent object

Getting ready

How to do it...

How it works...

There's more...

See also

Switching between activities

Getting ready

How to do it...

How it works...

See also

Passing data to another activity

Getting ready

How to do it...

How it works...

There's more...

Returning a result from an activity

Getting ready

How to do it...

How it works...

There's more...

See also

Saving an activity's state

Getting ready

How to do it...

How it works...

There's more...

See also

Storing persistent activity data

Getting ready

How to do it...

How it works...

There's more...

Using more than one preference file

See also

Understanding the activity lifecycle

Getting ready

How to do it...

How it works...

There's more...

Shutting down an activity

2. Layouts

Introduction

Defining and inflating a layout

Getting ready

How to do it...

How it works...

There's more...

See also

Using RelativeLayout

Getting ready

How to do it...

How it works...

There's more...

See also

Using LinearLayout

Getting ready

How to do it...

How it works...

There's more...

See also

Creating tables – TableLayout and GridLayout

Getting ready

How to do it...

How it works...

There's more...

Using ListView, GridView, and Adapters

Getting ready

How to do it...

How it works...

There's more...

Changing layout properties during runtime

Getting ready

How to do it....

How it works...

Optimizing layouts with the Hierarchy Viewer

Getting ready

How to do it...

How it works...

There's more...

3. Views, Widgets, and Styles

Introduction

Inserting a widget into a layout

Getting ready

How to do it...

How it works...

There's more...

See also

Using graphics to show button state

Getting ready

How to do it...

How it works...

There's more...

Using designated folders for screen-specific resources

See also

Creating a widget at runtime

Getting ready

How to do it...

How it works...

There's more...

Creating a custom component

Getting ready

How to do it...

How it works...

There's more...

See also

Applying a style to a View

Getting ready

How to do it...

How it works...

There's more...

See also

Turning a style into a theme

Getting ready

How to do it...

How it works...

There's more...

Selecting theme based on the Android version

Getting ready

How to do it...

How it works...

There's more…

4. Menus

Introduction

Creating an Options menu

Getting ready

How to do it...

How it works...

There's more...

Using a menu item to launch an activity

Creating sub menus

Grouping menu items

See also

Modifying menus and menu items during runtime

Getting ready

How to do it...

How it works...

There's more...

Enabling Contextual Action Mode for a view

Creating a Floating Context Menu

Getting ready

How to do it...

How it works...

There's more...

See also

Using Contextual Batch Mode with a ListView

Getting ready

How to do it...

How it works...

There's more...

See also

Creating a pop-up menu

Getting ready

How to do it...

How it works...

5. Exploring Fragments, AppWidgets, and the System UI

Introduction

Creating and using a Fragment

Getting ready

How to do it...

How it works...

There's more...

Adding and removing Fragments during runtime

Getting ready

How to do it...

How it works...

There's more...

Passing data between Fragments

Getting ready

How to do it...

How it works...

There's more...

See also

Creating a shortcut on the Home screen

Getting ready

How to do it...

How it works...

There's more...

Creating a Home screen widget

Getting ready

How to do it...

How it works...

There's more...

See also

Adding Search to the Action Bar

Getting ready

How to do it...

How it works...

See also

Showing your app full screen

Getting ready

How to do it...

How it works...

There's more...

Sticky Immersion

Dimming the System UI

Setting the Action Bar as an Overlay

Translucent system bars

See also

6. Working with Data

Introduction

Storing simple data

Getting ready

How to do it...

How it works...

There's more...

Read and write a text file to internal storage

Getting ready

How to do it...

How it works...

There's more...

Cache Files

See also

Read and write a text file to external storage

Getting ready

How to do it...

How it works...

There's more...

Getting public folders

Checking available space

Deleting a file

Working with directories

Preventing files from being included in galleries

See also

Including resource files in your project

Getting ready

How to do it...

How it works...

There's more...

See also

Creating and using an SQLite database

Getting ready

How to do it...

How it works...

There's more...

Upgrading a database

See also

Access data in the background using a Loader

Getting ready

How to do it...

How it works...

There's more...

See also

7. Alerts and Notifications

Introduction

Lights, Action, and Sound – getting the user's attention!

Getting ready

How to do it...

How it works...

There's more...

See also

Creating a Toast using a custom layout

Getting ready

How to do it...

How it works...

Displaying a message box with AlertDialog

Getting ready

How to do it...

How it works...

There's more...

Add an icon

Using a list

Custom Layout

Displaying a progress dialog

Getting ready

How to do it...

How it works...

There's more...

Lights, Action, and Sound Redux using Notifications

Getting ready

How to do it...

How it works...

There's more...

Adding a button to the notification using addAction()

Expanded notifications

Lock screen notifications

See also

Creating a Media Player Notification

Getting ready

How to do it...

How it works...

There's more...

See also

Making a Flashlight with a Heads-Up Notification

Getting ready

How to do it...

How it works...

There's more...

See also

8. Using the Touchscreen and Sensors

Introduction

Listening for click and long-press events

Getting ready

How to do it...

How it works...

There's more...

Recognizing tap and other common gestures

Getting ready

How to do it...

How it works...

There's more...

See also

Pinch-to-zoom with multi-touch gestures

Getting ready

How to do it...

How it works...

Swipe-to-Refresh

Getting ready

How to do it...

How it works...

There's more...

Listing available sensors – an introduction to the Android Sensor Framework

Getting ready

How to do it...

How it works...

There's more...

See also

Reading sensor data – using the Android Sensor Framework events

Getting ready

How to do it...

How it works...

There's more...

Environment sensors

Position sensors

Motion sensors

See also

Reading device orientation

Getting ready

How to do it...

How it works...

There's more...

Getting current device rotation

See also

9. Graphics and Animation

Introduction

Scaling down large images to avoid Out of Memory exceptions

Getting ready

How to do it...

How it works...

There's more...

See also

A transition animation – defining scenes and applying a transition

Getting ready

How to do it...

How it works...

Creating the start scene

Creating the transition:

Defining the ending scene:

Starting the transition:

There's more...

See also

Creating a Compass using sensor data and RotateAnimation

Getting ready

How to do it...

How it works...

There's more...

See also

Creating a slideshow with ViewPager

Getting ready

How to do it...

How it works...

There's more...

Creating a Setup Wizard

See also

Creating a Card Flip Animation with Fragments

Getting ready

How to do it...

How it works...

See also

Creating a Zoom Animation with a Custom Transition

Getting ready

How to do it...

How it works...

There's more...

Getting the default animation duration

See also

10. A First Look at OpenGL ES

Introduction

Set up the OpenGL ES environment

Getting ready

How to do it...

How it works...

Declaring OpenGL in the Android Manifest

Extending the GLSurfaceView class

Creating an OpenGL rendered class

There's more...

Drawing shapes on GLSurfaceView

Getting ready

How to do it...

How it works...

There's more...

See also

Applying Projection and Camera View while drawing

Getting ready

How to do it...

How it works...

There's more...

Moving the triangle with rotation

Getting ready

How to do it...

How it works...

There's more...

The render mode

Rotating the triangle with user input

Getting ready

How to do it...

How it works...

There's more...

See also

11. Multimedia

Introduction

Playing sound effects with SoundPool

Getting ready

How to do it...

How it works...

There's more...

See also

Playing audio with MediaPlayer

Getting ready

How to do it...

How it works...

There's more...

Playing music in the background

Using hardware volume keys to control your app's audio volume

See also

Responding to hardware media controls in your app

Getting ready

How to do it...

How it works...

There's more...

Checking the hardware being used

See also

Taking a photo with the default camera app

Getting ready

How to do it...

How it works...

There's more...

Calling the default video app

See also

Taking a picture using the (old) Camera API

Getting ready

How to do it...

How it works...

There's more...

Setting the camera parameters

See also

Taking a picture using the Camera2 (the new) API

Getting ready

How to do it...

How it works...

Setting up the preview

Capturing the image

There's more...

See also

12. Telephony, Networks, and the Web

Introduction

How to make a phone call

Getting ready

How to do it...

How it works...

See also

Monitoring phone call events

Getting ready

How to do it...

How it works...

There's more...

See also

How to send SMS (text) messages

Getting ready

How to do it...

How it works...

There's more...

Multipart messages

Delivery status notification

See also

Receiving SMS messages

Getting ready

How to do it...

How it works...

There's more...

Reading existing SMS messages

See also

Displaying a web page in your application

Getting ready

How to do it...

How it works...

There's more...

Controlling page navigation

How to enable JavaScript

Enable built-in zoom

See also

Checking online status and connection type

Getting ready

How to do it...

How it works...

There's more...

Monitoring network state changes

See also

Getting started with Volley for Internet requests

Getting ready

How to do it...

How it works...

There's more...

See also

Canceling a Volley request

Getting ready

How to do it...

How it works...

There's more...

Using Volley to request a JSON response

Getting ready

How to do it...

How it works...

There's more...

See also

Using Volley to request an image

Getting ready

How to do it...

How it works...

There's more...

Creating a Volley singleton

See also

Using Volley's NetworkImageView and ImageLoader

Getting ready

How to do it...

How it works...

There's more...

See also

13. Getting Location and Using Geofencing

Introduction

How to get the last location

Getting ready

How to do it...

How it works...

There's more...

Mock locations

See also

Resolving problems reported with the GoogleApiClient OnConnectionFailedListener

Getting ready

How to do it...

How it works...

There's more...

See also

How to receive location updates

Getting ready

How to do it...

How it works...

There's more...

Stop receiving location updates

See also

Create and monitor a Geofence

Getting ready

How to do it...

How it works...

There's more...

See also

14. Getting your app ready for the Play Store

Introduction

The new Android 6.0 Run-Time permission model

Getting ready

How to do it...

How it works...

There's more...

See also

How to schedule an alarm

Getting ready

How to do it...

How it works...

There's more...

Cancel the alarm

Repeating alarm

See also

Receive notification of device boot

Getting ready

How to do it...

How it works...

There's more...

See also

Using the AsyncTask for background work

Getting ready

How to do it...

How it works...

There's more...

Parameter types

Cancel the task

See also

Adding speech recognition to your app

Getting ready

How to do it...

How it works...

There's more...

See also

Push Notification using GCM

Getting ready

How to do it...

How it works...

There's more...

Simple testing option

See also

How to add Google sign-in to your app

Getting ready

How to do it...

How it works...

There's more...

Localization resources

See also

15. The Backend as a Service Options

Introduction

App42

Getting ready

How to do it...

How it works...

There's more...

See also

Backendless

Getting ready

How to do it...

How it works...

There's more...

See also

Buddy

Getting ready

How to do it...

How it works...

There's more...

See also

Firebase

Getting ready

How to do it...

How it works...

There's more...

See also

Kinvey

Getting ready

How to do it...

How it works...

There's more...

See also

Index

累计评论(0条) 0个书友正在讨论这本书 发表评论

发表评论

发表评论,分享你的想法吧!

买过这本书的人还买过

读了这本书的人还在读

回顶部