Ebook Learning Android 2nd Edition

Learning Android 2nd Edition - PDF Books
Learning Android 2nd Edition – PDF Books

Download

THÔNG TIN TÀI LIỆU

Nhà xuất bản O’Reilly Media, Inc
Tác giả Marko Gargenta and Masumi Nakamura
Số trang 288
Ngày xuất bản 2014
File PDF

NỘI DUNG TÀI LIỆU
1. Android Overview
Android Overview 1
Comprehensive 1
Open Source Platform 2
Designed for Mobile Devices 2
History 3
Google’s Motivation 4
Android Compatibility 4
Open Handset Alliance 5
Android Versions 5
Android Flavors 7
Android Open Source Project 7
Manufacturer Add-Ons 7
Summary 8

2. Java Review
Comments 12
Data Types: Primitives and Objects 13
Modifiers 14
Arrays 15
Operators 16
Control Flow Statements 16
Error/Exception Handling 19
Complex Example 22
Interfaces and Inheritance 26
Collections 27
Generics 28
Threads 28
Summary 29

3. The Stack
Stack Overview 31
Linux 31
Android != Linux 33
Native Layer 33
HAL 34
Native Libraries 34
Native Daemons 35
Native Tools 36
Dalvik 36
Android and Java 37
Application Framework 39
Applications 40
Android Application Package (APK) 40
Application Signing 41
Application Distribution 41
Summary 42

4. Installing and Beginning Use of Android Tools
Installing Java Development Kit 43
Installing the Android SDK 45
Setting Up a PATH to Tools 45
Installing Eclipse 46
Eclipse Workspace 46
Setting Up Android Development Tools 46
Hello World! 48
Creating a New Project 48
Anatomy of an Android Project 50
Android Manifest File 51
String Resources 54
Layout XML Code 55
Drawable Resources 56
The R File 56
Java Source Code 57
Building the Project 58
Android Emulator 59
An Emulator Versus a Physical Phone 59
Summary 62

5. Main Building Blocks
A Real-World Example 63
Activities 64
Activity Life Cycle 64
Intents 68
Services 68
Content Providers 70
Broadcast Receivers 72
Application Context 72
Summary 74

6. Yamba Project Overview
The Yamba Application 75
Design Philosophy 79
Project Design 80
Part 1: Android User Interface 81
Part 2: Intents, ActionBar, and More 82
Part 3: Android Services 82
Part 4: Content Providers 83
Part 5: Lists and Adapters 83
Part 6: Broadcast Receivers 84
Part 7: App Widgets 84
Part 8: Networking and the Web (HTTP) 85
Part 9: Live Wallpaper and Handlers 85
Summary 85

7. Android User Interface
Two Ways to Create a User Interface 87
Declarative User Interface 87
Programmatic User Interface 88
The Best of Both Worlds 88
Views and Layouts 88
LinearLayout 89
TableLayout 90
FrameLayout 91
RelativeLayout 92
Starting the Yamba Project 93
The StatusActivity Layout 97
Important Widget Properties 101
Strings Resource 103
The StatusActivity Java Class 104
Inflating XML to Java 104
Initializing Objects 106
Handling User Events 107
Logging Messages in Android 108
LogCat 108
Compiling Code and Building Your Projects: Saving Files 109
Adding the Twitter API Library 112
Updating the Manifest File for Internet Permission 113
Threading in Android 114
Single Thread 114
Multithreaded Execution 115
AsyncTask 116
Other UI Events 119
Alternative Resources 124
Summary 127

8. Fragments
Fragment Example 129
Fragment Life Cyle 136
Dynamically Adding Fragments 137
Summary 139

9. Intents, Action Bar, and More
Preferences 141
Preference Resource 142
SettingsActivity 145
Update the Manifest File 147
The Action Bar 148
Creating a Blank Main Activity 149
The Menu Resource 150
Android System Resources 152
Loading the Menu 153
Updating StatusActivity to Handle Menu Events 154
Shared Preferences and Updating Status Fragment 155
The Filesystem Explained 157
Exploring the Filesystem 158
Filesystem Partitions 158
System Partition 158
SDCard Partition 158
The User Data Partition 160
Filesystem Security 161
Summary 161

10. Services
Our Example Service: RefreshService 164
Creating the RefreshService Java Class 164
Introducing IntentService 166
Update the Manifest File 167
Add Menu Items 168
Update the Options Menu Handling 168
Testing the Service 169
Pulling Data from Yamba 169
Testing the Service 172
Summary 172

11. Content Providers
Databases on Android 175
About SQLite 176
DbHelper 176
The Database Schema and Its Creation 177
Four Major Operations 177
Cursors 178
Status Contract Class 179
Update RefreshService 181
Testing the Service 184
Content Providers 186
Creating a Content Provider 187
Defining the URI 187
Getting the Data Type 189
Inserting Data 191
Updating Data 192
Deleting Data 193
Querying Data 194
Updating the Android Manifest File 199
Updating RefreshService 200
Summary 201

12. Lists and Adapters
MainActivity 203
Basic MainActivity 203
Timeline Fragment 205
Creating a List Item Layout 206
About Adapters 207
Loading the Data 208
Custom Logic via ViewBinder 211
Details View 213
Details Fragment 214
Details Activity 216
Register with the Manifest File 217
Main Activity, Landscape View 217
Updating TimelineFragment 218
Summary 221

13. Broadcast Receivers
About Broadcast Receivers 223
BootReceiver 224
Registering the BootReceiver with the Android Manifest File 225
Testing the Boot Receiver 225
Alarms and System Services 225
Broadcasting Intents 227
Notification Receiver 230
Summary 231

14. App Widgets
Using Content Providers Through Widgets 233
Implementing the YambaWidget Class 234
Creating the XML Layout 237
Creating the AppWidgetProviderInfo File 238
Updating the Manifest File 238
Testing the Widget 239
Summary 239

15. Networking and Web Overview
Quick Example 241
Networking Basics 242
HTTP API 244
Apache HTTP Client 245
HttpUrlConnection 248
Networking in the Background using AsyncTask and AsyncTaskLoader 251
Summary 251

16. Interaction and Animation: Live Wallpaper and Handlers
Live Wallpaper 253
Handler 260
Summary 262
Index

Be the first to comment

Leave a Reply

Your email address will not be published.

*