Beginning Android Tablet Programming starts off by showing how to get your system ready for Android tablet programming. You won't need any previous Android experience, because you'll learn all about the basic structure of an Android program and how the Android operating system works—and then you'll learn how to write your first Android tablet application from scratch! Beginning Android Tablet Programming then equips you to build a set of interesting and fully-working Android tablet applications. These projects will give you the inspiration and insights to build your own Android programs in the future. You'll be introduced to 2D programming, and you'll see what you can do with a touch screen interface and the Honeycomb SDK. Of course, 3D programming is even more alluring for many programmers. If that includes you, you'll learn about how Honeycomb has changed the game for Android graphics programming, and get your first taste of 3D programming on an Android tablet. Lights, camera, action! You'll learn along the way how Android Honeycomb gives you access, through your programming, to all those interesting sensors that tablet computers are equipped with today—beyond the touch screen itself. You'll learn, for example, how you to use a tablet GPS sensor to locate your car! You'll also discover how you can access files on your tablet—or on the web—through programming, and then build on that insight to create your own file browser application. This Android project contains many useful coding techniques appropriate for many situations you might encounter in your future programming Android tablet applications; you'll be glad to have them under your belt. So do you want to write programs that can receive and send reminder messages via SMS? Do you want to write your first 2D or 3D game on Android? Perhaps you'd like to write an application that sorts out all your contacts for you! Beginning Android Tablet Programming introduces you to Android tablet programming, and shows how you can program your Android tablet from scratch to do what you want! What you’ll learn Programming for a touch screen environment Learn about the new facilities available from Android 3.0 Honeycomb Take advantage of sensors and data feeds while writing entirely new applications Code a game for an Android tablet How to write Android tablet programs code in programming languages other than Java Transition from an Android smart phone environment to an Android tablet Who this book is for Beginning and intermediate Android programmers Intermediate Java programmers Intermediate programmers in open-source programming languages, especially Python Table of Contents Getting Started How Android Works What You Can Do with an Android Tablet Beyond Java: Programming in Python and Friends Project 1: Media Player Explorer:An Android File Explorer Contact Manager:and other potentially useful applications Dude, Where’s My Car?:Adventures in GPS Let the games begin!: Some 2d and 3d graphical game techniques Remind Me:Playing with Alarms and SMS Everything Else: Advanced Techniques and other stuff
Author(s): Robbie Matthews
Edition: 1
Publisher: Apress
Year: 2011
Language: English
Pages: 288
GetFullPageImage......Page 1
front-matter......Page 2
Index......Page 0
A Short, Personal History of Portable Programming......Page 20
The Advent of Android......Page 22
Installing Your Development Environment......Page 23
Creating an Emulator Instance......Page 24
Your First Android Program......Page 25
Oh, No! Java!......Page 28
A Quick Guide to Java......Page 29
Structure......Page 30
Flow Control......Page 31
Objects......Page 32
Constructors, Initializers, and Overloading......Page 36
Where’s “Free”?......Page 38
String Handling......Page 39
Packages......Page 40
Lists and Maps......Page 41
Generics......Page 42
Inheritance and Interfaces......Page 43
Annotations......Page 44
Summary......Page 45
Basic Structure of Android Programs......Page 46
Intents: What, Where, Why, and Are They Honorable?......Page 61
Intent Filters......Page 66
Finally......Page 67
Secretly Linux......Page 68
Summary......Page 70
CHAPTER 3 What Can You Do with an Android Tablet?......Page 71
More Sensors Than the CIA......Page 72
Lights, Camera, Action......Page 81
Browsing for Fun and Profit......Page 82
Managing Your Assets......Page 84
Getting Fancy......Page 85
Accessing Contacts......Page 87
A Quick Side Trip into Lists......Page 90
Different Things to Access......Page 92
Bonus Stuff—Menu Options......Page 93
Sending E-mail......Page 94
Sound and Fury (Managing Media Files)......Page 95
Summary......Page 96
CHAPTER 4 Beyond Java: Programming in Python and Friends......Page 97
Script Management......Page 98
What’s a Facade?......Page 100
Intents (Again)......Page 101
Different Ways of Using the Intent Methods......Page 102
User Interaction......Page 104
Events......Page 107
Media Files......Page 109
Controlling Your Phone......Page 112
Where Am I?......Page 113
Battery......Page 115
Keeping the Device Awake......Page 117
Editing Tips......Page 118
Contacts and Phone Numbers......Page 120
SQL......Page 121
Summary......Page 122
What’s a Fragment?......Page 123
Examining the Example......Page 124
The ActionBar......Page 127
FragmentManager......Page 129
Media Player Application......Page 130
Displaying a List from a Cursor......Page 132
Some More on the ActionBar......Page 133
Getting a Media URI......Page 134
Playing Media......Page 135
Dialog Boxes......Page 136
Advanced Media Playing......Page 138
Displaying Our Progress......Page 139
Summary......Page 140
Anatomy of a File Explorer......Page 141
ListActivity for Fun and Profit......Page 142
A Note on Resources......Page 143
Build Your Own List Adapter......Page 144
Populating the List......Page 146
Finding Out About Your File......Page 148
Going Native......Page 151
State Your Preference......Page 155
Sorting Techniques......Page 158
The Actual Activity......Page 159
Reacting to a List Selection......Page 160
Creation at Last......Page 161
Reacting to a Context Menu......Page 162
Dialogs......Page 163
A Few Last Bits......Page 166
Summary......Page 167
CHAPTER 7 Contact Manager......Page 168
Anatomy of a Signpost......Page 169
Room for Improvement......Page 173
Backward Compatibility......Page 174
Saving the List......Page 175
Import and Export......Page 176
A Last Note on Dialogs......Page 177
Managing Contacts......Page 178
Loaders......Page 179
Why a Loader?......Page 180
The Search Bar......Page 181
Contact Details......Page 183
Editing Data......Page 186
Adding a Phone Number......Page 187
Changing Types......Page 188
And Deleting......Page 189
Summary......Page 190
Location Manager......Page 191
BAT3PGps......Page 192
A Class to Handle the Location Manager......Page 193
Location......Page 197
The Compass......Page 199
Bearing and Distance......Page 201
Wakeup Calls......Page 202
Services......Page 203
Notifications......Page 204
Proximity Alerts......Page 206
Proximity Alert Pros and Cons......Page 208
Lists of Targets......Page 209
Where Was That Again?......Page 213
Summary......Page 214
Threads......Page 215
Java Threads......Page 216
Synchronizing Your Threads......Page 218
Floater......Page 219
SurfaceView......Page 220
Handlers......Page 223
Handling Input......Page 224
Custom Fonts......Page 225
So What’s an Asset?......Page 226
Menus: A Different Approach......Page 228
It’s a Box......Page 230
More Interprocess Communication Options......Page 235
Summary......Page 236
Alarms......Page 237
Matching PendingIntent......Page 238
Sending SMS......Page 239
Receiving SMS......Page 240
Text To Speech......Page 241
SQLite......Page 243
Creating a SQLite Database......Page 244
Using Your Database......Page 245
The Application......Page 246
Contacts......Page 249
Set Alarm......Page 250
Alarms List......Page 253
Testing TTS......Page 256
Summary......Page 257
Timers......Page 258
Stopping Gracefully......Page 261
Doing Things in Background......Page 262
Asking for Directions......Page 266
The Download Manager......Page 269
Querying Your Downloads......Page 272
Animations......Page 274
Defining an Animation......Page 275
Loading Your Animation......Page 276
Programming Your USB......Page 277
Responding to USB Events......Page 280
And Finally......Page 282
back-matter......Page 283