Pro Android 2. Sayed Y. Hashimi Satya Komatineni Dave Mac Lean. Apress

Similar documents
Companion ebook Available Pro Android Includes Android 1.5 SOURCE CODE ONLINE US $44.99

Android Programming (5 Days)

Android App Development

Android" Application Development SAMS. Sams Teach Yourself. Shane Conder. Lauren Darcey. Second Edition

Android Programming - Jelly Bean

Companion ebook Available Pro Android Includes Android 1.5 SOURCE CODE ONLINE US $44.99

Androidfp_printOnly.book Page vii Tuesday, October 4, :15 AM. Contents. Before You Begin

MC Android Programming

ANDROID SYLLABUS. Advanced Android

Pro Android. Sayed Y. Hashimi and Satya Komatineni

Android Online Training

ORACLE UNIVERSITY AUTHORISED EDUCATION PARTNER (WDP)

GUJARAT TECHNOLOGICAL UNIVERSITY

Android. (XKE Mars 2009) Erwan Alliaume.

Android Apps. with Eclipse. Apress. Onur Cinar

Programming Concepts and Skills. Creating an Android Project

In this Class Mark shows you how to put applications into packages and how to run them through the command line.

ANDROID COURSE BROCHURE

Lecture 1 Introduction to Android. App Development for Mobile Devices. App Development for Mobile Devices. Announcement.

Software Development & Education Center ANDROID. Application Development

SHWETANK KUMAR GUPTA Only For Education Purpose

Mobile and Wireless Systems Programming

MARS AREA SCHOOL DISTRICT Curriculum TECHNOLOGY EDUCATION

Android Overview. Most of the material in this section comes from

Android System Architecture. Android Application Fundamentals. Applications in Android. Apps in the Android OS. Program Model 8/31/2015

Android Development Crash Course

Android Programming in Bluetooth Cochlea Group

BCA 6. Question Bank

Introduction To Android

Android App Development. Muhammad Sharjeel COMSATS Institute of Information Technology, Lahore

1. What are the key components of Android Architecture? 2. What are the advantages of having an emulator within the Android environment?

Android Programming Lecture 2 9/7/2011

Mobile Application Development Android

Lab 3: Using Worklight Server and Environment Optimization Lab Exercise

Syllabus- Java + Android. Java Fundamentals

Lecture 1 - Introduction to Android

Android App Development

Questions and Answers. Q.1) Which of the following is the most ^aeuroeresource hungry ^aeuroepart of dealing with activities on android?

brief contents PART 1 INTRODUCING WINDOWS PHONE... 1 PART 2 CORE WINDOWS PHONE... 57

M.C.A. Semester V Subject: - Mobile Computing (650003) Week : 2

Android UI DateBasics

Beginning Android Tablet

ITG Software Engineering

Mobile Application Development - Android

ANDROID APPS DEVELOPMENT FOR MOBILE AND TABLET DEVICE (LEVEL II)

IGEEKS TECHNOLOGIES. Software Training Division. Academic Live Projects For BE,ME,MCA,BCA and PHD Students

The World of Android Development

Introduction to Android Android Smartphone Programming. Outline University of Freiburg. What is Android? Background University of Freiburg.

Beginning Android 4 Application Development

Course Syllabus. Course Title. Who should attend? Course Description. Android ( Level 1 )

Jim Jackson II Ian Gilman

COLLEGE OF ENGINEERING, NASHIK-4

Contents. Before You Begin. Copyright by Pearson Education, Inc. All Rights Reserved.

CHAPTER 4. Fragments ActionBar Menus

Android Development Tutorial. Yi Huang

CS378 -Mobile Computing. Anatomy of and Android App and the App Lifecycle

Android Application Development 101. Jason Chen Google I/O 2008

Around Android. Essential Android features illustrated by a walk through a practical example

Required Core Java for Android application development

GUJARAT TECHNOLOGICAL UNIVERSITY, AHMEDABAD, GUJARAT. Computer Engineering

CS378 - Mobile Computing. Anatomy of an Android App and the App Lifecycle

An Introduction to Android. Jason Chen Developer Advocate Google I/O 2008

Android Application Development

Developer s overview of the Android platform

Android App Development Workshop

Android Application Development

M.C.A. Semester V Subject: - Mobile Computing (650003) Week : 1

Another difference is that the kernel includes only the suspend to memory mechanism, and not the suspend to hard disk, which is used on PCs.

Mobile OS. Symbian. BlackBerry. ios. Window mobile. Android

ANDROID DEVELOPMENT. Course Details

Mobile and Ubiquitous Computing: Android Programming (part 1)

Wirtschaftsinformatik Skiseminar ao. Prof. Dr. Rony G. Flatscher. Seminar paper presentation Dennis Robert Stöhr

Android. Michael Greifeneder. Image source: Android homepage

Android. Lesson 1. Introduction. Android Developer Fundamentals. Android Developer Fundamentals. to Android 1

Android Training Overview (For Demo Classes Call Us )

ANDROID APPS (NOW WITH JELLY BEANS!) Jordan Jozwiak November 11, 2012

CHAPTER 1: HELLO, ANDROID 1

Produced by. Mobile Application Development. David Drohan Department of Computing & Mathematics Waterford Institute of Technology

Pro Android 4. Satya Komatineni Dave MacLean

CS260 Intro to Java & Android 05.Android UI(Part I)

Android Software Development Kit (Part I)

ECOM 5341 Mobile Computing(Android) Eng.Ruba A. Salamah

Android Development Tools = Eclipse + ADT + SDK

CS260 Intro to Java & Android 05.Android UI(Part I)

Mobile Application Development

Computer Science E-76 Building Mobile Applications

Pro ios Design and. Development. HTML5, CSS3, and JavaScript with Safari. Andrea Picchi. Apress*

Android Syllabus. Android. Android Overview and History How it all get started. Why Android is different.

MOC 20481C: Essentials of Developing Windows Store Apps Using HTML5 and JavaScript

Project Covered During Training: Real Time Project Training

Lab 3. Accessing GSM Functions on an Android Smartphone

Murach s Beginning Java with Eclipse

Configuring the Android Manifest File

Introduction to Android

1. Implementation of Inheritance with objects, methods. 2. Implementing Interface in a simple java class. 3. To create java class with polymorphism

Contextual Android Education

Mobile Computing and Application Development Course code :

Programming Android UI. J. Serrat Software Design December 2017

ANDROID APPLICATION DEVELOPMENT PROSPECTUS ADAAD UNIVERSITY OF SKILLS

Mobile Programming Lecture 1. Getting Started

Transcription:

Pro Android 2 Sayed Y. Hashimi Satya Komatineni Dave Mac Lean Apress

Contents Contents at a Glance Contents About the Authors About the Technical Reviewer Acknowledgments Foreword iv v xiii xiv xv xvi Chapter 1: Introducing the Android Computing Platform 1 A New Platform for a New Personal Computer 1 History of Android 3 Delving into the Dalvik VM 5 Comparing Android and Java ME 7 Understanding the Android Software Stack 10 Developing an End-User Application with the Android SDK 11 Android Emulator 11 The Android Ul 12 The Android Foundational Components 13 Advanced Ul Concepts 14 Android Service Components 16 Android Media and Telephony Components 16 Android Java Packages 18 Taking Advantage of Android Source Code 23 Summary 24 Chapter 2: Getting Your Feet Wet 25 Setting Up Your Environment 25 Downloading JDK 6 26 Downloading Eclipse 3.5 26 Downloading the Android SDK 27 V

Installing Android Development Tools (ADT) 28 Learning the Fundamental Components 31 View 31 Activity 31 Intent 31 Content Provider 32 Service 32 AndroidManifest.xml 32 Android Virtual Devices 32 Hello World! 33 Android Virtual Devices 38 Exploring the Structure of an Android Application 40 Analyzing the Notepad Application 42 Loading and Running the Notepad Application 43 Dissecting the Application 44 Examining the Application Lifecycle 51 Debugging Your App 54 Summary 55 Chapter 3: Using Resources, Content Providers, and Intents 57 Understanding Resources 58 String Resources 59 Layout Resources 60 Resource-Reference Syntax 62 Defining Your Own Resource IDs for Later Use 63 Compiled and Noncompiled Android Resources 64 Enumerating Key Android Resources 65 Working with Arbitrary XML Resource Files 73 Working with Raw Resources 74 Working with Assets 75 Reviewing the Resources Directory Structure 75 Understanding Content Providers 76 Exploring Android's Built-in Providers 77 Architecture of Content Providers 83 Implementing Content Providers 95 Understanding Intents 106 Available Intents in Android 107 Intents and Data URIs 109 Generic Actions 110 Using Extra Information 111 Using Components to Directly Invoke an Activity 113 Best Practice for Component Designers 114 Understanding Intent Categories 114 The Rules for Resolving Intents to Their Components 117 Exercising the ACTION.PICK 117 Exercising the GET_CONTENT Action 119 Further Resources for This Chapter 121 Summary 121

Chapter 4: Building User Interfaces and Using Controls 123 Ul Development in Android 123 Understanding Android's Common Controls 129 Text Controls 129 Button Controls 133 List Controls 139 Grid Controls 143 Date and Time Controls 145 Other Interesting Controls in Android 147 The MapView Control 148 The Gallery Control 148 The Spinner Control 148 Understanding Layout Managers 149 The LinearLayout Layout Manager 149 The TableLayout Layout Manager 153 The RelativeLayout Layout Manager 157 The FrameLayout Layout Manager 159 Customizing Layout for Various Device Configurations 162 Understanding Adapters 164 Getting to Know SimpleCursorAdapter 165 Getting to Know ArrayAdapter 165 Creating Custom Adapters 166 Debugging and Optimizing Layouts with the Hierarchy Viewer 167 Summary 170 Chapter 5: Working with Menus and Dialogs 171 Understanding Android Menus 171 Creating a Menu 173 Working with Menu Groups 174 Responding to Menu Items 175 Creating a Test Harness for Testing Menus 176 Working with Other Menu Types 183 Expanded Menus 183 Working with Icon Menus 183 Working with Submenus 184 Provisioning for System Menus 185 Working with Context Menus 185 Working with Alternative Menus 188 Working with Menus in Response to Changing Data 192 Loading Menus Through XML Files 192 Structure of an XML Menu Resource File 193 Inflating XML Menu Resource Files 193 Responding to XML-Based Menu Items 194 A Brief Introduction to Additional XML Menu Tags 195 Using Dialogs in Android 196 Designing an Alert Dialog 197 Designing a Prompt Dialog 199 The Nature of Dialogs in Android 204

Rearchitecting the Prompt Dialog 205 Working with Managed Dialogs 206 Understanding the Managed-Dialog Protocol 206 Recasting the Non-Managed Dialog As a Managed Dialog 206 Simplifying the Managed-Dialog Protocol 208 Summary 215 Chapter 6: Unveiling 2D Animation 217 Frame-by-Frame Animation 218 Planning for Frame-by-Frame Animation 218 Creating the Activity 219 Adding Animation to the Activity 220 Layout Animation 223 Basic Tweening Animation Types 224 Planning the Layout-Animation Test Harness 225 Creating the Activity and the ListView 226 Animating the ListView 228 Using Interpolators 231 View Animation 233 Understanding View Animation 233 Adding Animation 236 Using Camera to Provide Depth Perception in 2D 239 Exploring the AnimationListener Class 240 Some Notes on Transformation Matrices 241 Summary 242 Chapter 7: Exploring Security and Location-Based Services 243 Understanding the Android Security Model 243 Overview of Security Concepts 244 Signing Applications for Deployment 244 Performing Runtime Security Checks 249 Understanding Security at the Process Boundary 249 Declaring and Using Permissions 250 Understanding and Using Custom Permissions 252 Understanding and Using URI Permissions 258 Working with Location-Based Services 258 Understanding the Mapping Package 259 Understanding the Location Package 270 Summary 287 Chapter 8: Building and Consuming Services 289 Consuming HTTP Services 289 Using the HttpClient for HTTP GET Requests 290 Using the HttpClient for НИР POST Requests 291 Dealing with Exceptions 295 Addressing Multithreading Issues 297 Doing Interprocess Communication 301 Creating a Simple Service 301 Understanding Services in Android 302 Understanding Local Services 303

Understanding AIDL Services 307 Defining a Service Interface in AIDL 308 Implementing an AIDL Interface 310 Calling the Service from a Client Application 312 Passing Complex Types to Services 316 Summary 326 Chapter 9: Using the Media Framework and Telephony APIs 327 Using the Media APIs 327 Playing Audio Content 331 Understanding the setdatasource Method 335 Playing Video Content 336 Understanding the MediaPlayer Oddities 338 Exploring Audio Recording 339 Exploring Video Recording 343 Exploring the MediaStore Class 348 Adding Media Content to the Media Store 352 Using the Telephony APIs 354 Working with SMS 354 Working with the Telephony Manager 361 Summary 362 Chapter 10: Programming 3D Graphics with OpenGL 363 Understanding the History and Background of OpenGL 364 OpenGL ES 365 OpenGL ES and Java ME 366 M3G: Another Java ME 3D Graphics Standard 367 Fundamentals of OpenGL 367 Essential Drawing with OpenGL ES 368 Understanding OpenGL Camera and Coordinates 374 Interfacing OpenGL ES with Android 378 Using GLSurfaceView and Related Classes 379 Simple Test Harness That Draws a Triangle 380 Changing Camera Settings 384 Using Indices to Add Another Triangle 386 Animating the Simple OpenGL Triangle 387 Braving OpenGL: Shapes and Textures 390 A Simple Menu Trick for Your Demos 391 Drawing a Rectangle 395 Working with Shapes 397 Working with Textures 410 Drawing Multiple Figures 415 OpenGL Resources 419 Summary 419 Chapter 11: Managing and Organizing Preferences 421 Exploring the Preferences Framework 421 Understanding ListPreference 422 Manipulating Preferences Programmatically 429 Understanding CheckBoxPreference 430

Understanding EditTextPreference 432 Understanding RingtonePreference 433 Organizing Preferences 435 Summary 438 Chapter 12: Exploring Live Folders 439 Exploring Live Folders 439 How a User Experiences Live Folders 440 Building a Live Folder 445 Summary 456 Chapter 13: Home Screen Widgets 457 Architecture of Home Screen Widgets 458 What Are Home Screen Widgets? 458 User Experience with Home Screen Widgets 459 Lifecycle of a Widget 462 A Sample Widget Application 468 Defining the Widget Provider 470 Defining Widget Size 471 Widget Layout-Related Files 472 Implementing a Widget Provider 474 Implementing Widget Models 476 Implementing Widget Configuration Activity 483 Widget Limitations and Extensions 487 Resources 488 Summary 489 Chapter 14: Android Search 491 Android Search Experience 492 Exploring Android Global Search 492 Enabling Suggestion Providers for Global Search 497 QSB and Suggestions Provider Interaction 500 Activities and Search Key Interaction 502 Behavior of Search Key on a Regular Activity 503 Behavior of an Activity That Disables Search 510 Invoking Search Through a Menu 511 Understanding Local Search and Related Activities 514 Enabling Type-to-Search 519 Implementing a Simple Suggestion Provider 520 Planning the Simple Suggestions Provider 520 Simple Suggestions Provider Implementation Files 521 Implementing the SimpleSuggestionProvider class 521 Understanding Simple Suggestions Provider Search Activity 525 Search Invoker Activity 529 Simple Suggestion Provider User Experience 531 Implementing a Custom Suggestion Provider 535 Planning the Custom Suggestion Provider 535 SuggestURLProvider Project Implementation Files 536 Implementing the SuggestUrlProvider Class 536 Implementing a Search Activity for a Custom Suggestion Provider 545

Custom Suggestions Provider Manifest File 551 Custom Suggestion User Experience 552 Using Action Keys and Application-Specific Search Data 556 Using Action Keys in Android Search 557 Working with Application-Specific Search Context 559 Resources 561 Summary 562 Chapter 15: Exploring Text to Speech and Translate APIs 563 The Basics of Text to Speech in Android 563 Using Utterances to Keep Track of Our Speech 568 Using Audio Files for Your Voice 569 Advanced Features of the TTS Engine 576 Setting Audio Streams 576 Using Earcons 577 Playing Silence 577 Using Language Methods 578 Translating Text to a Different Language 579 Summary 588 Chapter 16: Touchscreens 591 Understanding MotionEvents 591 Using VelocityTracker 603 Exploring Drag and Drop 605 Multi-Touch 608 Touches with Maps 615 Gestures 618 Summary 625 Chapter 17: Titanium Mobile: A WebKit-Based Approach to Android Development 627 Titanium Mobile Overview 628 Architecture 629 The Titanium Ecosystem 632 Downloading and Installing Titanium Developer 633 Getting to Know the Ropes: The First Project 640 Creating a Titanium Mobile Project 640 Crafting "Hello World" 642 Provisioning the Application for Debugging 644 Packaging the Application 647 Installing the.apk File on Your Own Emulator 649 Planning for Real-World Applications 650 Essential Primer on JQuery 651 Essential Primer on Advanced JavaScript 653 Understanding the Microtemplating Engine 656 Additional Titanium Mobile APIs 659 Summary 660 Chapter 18: Working with Android Market 661 Becoming a Publisher 661 Following the Rules 662

CONTENTS Developer Console 665 Preparing Your Application for Sale 666 Testing for Different Devices 666 Supporting Different Screen Sizes 666 Preparing AndroidManifest.xml for Uploading 667 Localizing Your Application 667 Preparing Your Application Icon 668 Considerations for Paid Apps 668 Directing Users Back to the Market 669 Preparing Your.apk File for Uploading 669 Uploading Your Application 670 User Experience on Android Market 672 Summary 674 Chapter 19: Outlook and Resources 675 Current State of Android 675 Android Based Mobile Device Manufacturers 676 Android Application Stores 677 Outlook For Android 679 Quick Summary of Mobile Operating Systems 679 Contrasting Android with other Mobile OSs 681 Support for HTML 5 and What it Reveals 682 Android Resources 683 Core Android Resources 683 Android News Related Resources 684 Summary 685 Index 687 xii