r-baad1, ebooks

[ Pobierz całość w formacie PDF ]
Beginning Android™ Application Development
Published by
Wiley Publishing, Inc.
10475 Crosspoint Boulevard
Indianapolis, IN 46256
www.wiley.com
Copyright © 2011 by Wiley Publishing, Inc., Indianapolis, Indiana
Published simultaneously in Canada
ISBN: 978-1-118-01711-1
ISBN: 978-1-118-08729-9 (ebk)
ISBN: 978-1-118-08749-7 (ebk)
ISBN: 978-1-118-08780-0 (ebk)
Manufactured in the United States of America
10 9 8 7 6 5 4 3 2 1
No part of this publication may be reproduced, stored in a retrieval system or transmitted in any form or by any means,
electronic, mechanical, photocopying, recording, scanning or otherwise, except as permitted under Sections 107 or 108 of
the 1976 United States Copyright Act, without either the prior written permission of the Publisher, or authorization through
payment of the appropriate per-copy fee to the Copyright Clearance Center, 222 Rosewood Drive, Danvers, MA 01923,
(978) 750-8400, fax (978) 646-8600. Requests to the Publisher for permission should be addressed to the Permissions
Department, John Wiley & Sons, Inc., 111 River Street, Hoboken, NJ 07030, (201) 748-6011, fax (201) 748-6008, or
Limit of Liability/Disclaimer of Warranty:
The publisher and the author make no representations or warranties with respect to
the accuracy or completeness of the contents of this work and speciically disclaim all warranties, including without limitation
warranties of itness for a particular purpose. No warranty may be created or extended by sales or promotional materials. The
advice and strategies contained herein may not be suitable for every situation. This work is sold with the understanding that
the publisher is not engaged in rendering legal, accounting, or other professional services. If professional assistance is required,
the services of a competent professional person should be sought. Neither the publisher nor the author shall be liable for dam-
ages arising herefrom. The fact that an organization or Web site is referred to in this work as a citation and/or a potential
source of further information does not mean that the author or the publisher endorses the information the organization or Web
site may provide or recommendations it may make. Further, readers should be aware that Internet Web sites listed in this work
may have changed or disappeared between when this work was written and when it is read.
For general information on our other products and services please contact our Customer Care Department within the
United States at (877) 762-2974, outside the United States at (317) 572-3993 or fax (317) 572-4002.
Wiley also publishes its books in a variety of electronic formats. Some content that appears in print may not be available
in electronic books.
Library of Congress Control Number:
2011921777
Trademarks:
Wiley, the Wiley logo, Wrox, the Wrox logo, Wrox Programmer to Programmer, and related trade dress are
trademarks or registered trademarks of John Wiley & Sons, Inc. and/or its afiliates, in the United States and other coun-
tries, and may not be used without written permission. Android is a trademark of Google, Inc. All other trademarks are
the property of their respective owners. Wiley Publishing, Inc., is not associated with any product or vendor mentioned in
this book.
contentS
IntroductIon
xv
chApter 1:
getting StArted With Android progrAmming
1
What is Android?
2
Android Versions
2
Features of Android
3
Architecture of Android
3
Android Devices in the Market
4
The Android Market
6
Obtaining the Required Tools
6
Eclipse
7
Android SDK
7
Android Development Tools (ADT)
7
Creating Android Virtual Devices (AVDs)
11
Creating Your First Android Application
14
Anatomy of an Android Application
22
Summary
25
chApter 2:
ActivitieS And intentS
2
7
Understanding Activities
27
Applying Styles and Themes to Activity
32
Hiding the Activity Title
33
Displaying a Dialog Window
34
Displaying a Progress Dialog
39
Linking Activities Using intents
43
Resolving Intent Filter Collision
48
Returning Results from an Intent
50
Passing Data Using an Intent Object
54
Calling Built-in Applications Using intents
56
Understanding the Intent Object
64
Using Intent Filters
65
Adding Categories
71
Displaying notiications
73
Summary
78
 COnTenTS
chApter 3:
getting to knoW the Android uSer interFAce
81
Understanding the Components of a Screen
81
Views and ViewGroups
82
LinearLayout
83
AbsoluteLayout
87
TableLayout
89
RelativeLayout
91
FrameLayout
93
ScrollView
95
Adapting to Display Orientation
97
Anchoring Views
98
Resizing and Repositioning
1 01
Managing Changes to Screen Orientation
1 04
Persisting State Information during Changes in Coniguration
1 08
Detecting Orientation Changes
1 09
Controlling the Orientation of the Activity
110
Creating the User interface Programmatically
111
Listening for Ui notiications
114
Overriding Methods Deined in an Activity
114
Registering Events for Views
119
Summary
122
chApter 4:
deSigning your uSer interFAce uSing vieWS
125
Basic Views
126
TextView View
126
Button, ImageButton, EditText, CheckBox, ToggleButton, RadioButton,
and RadioGroup Views
127
ProgressBar View
135
AutoCompleteTextView View
141
Picker Views
144
TimePicker View
144
Displaying the TimePicker in a Dialog Window
147
DatePicker View
149
Displaying the DatePicker View in a Dialog Window
153
List Views
156
ListView View
156
Customizing the ListView
159
Using the Spinner View
1 62
Summary
1 66
x
 COnTenTS
chApter 5:
diSplAying pictureS And menuS With vieWS
1 69
Using image Views to Display Pictures
1 69
Gallery and ImageView Views
170
ImageSwitcher
177
GridView
1 81
Using Menus with Views
1 85
Creating the Helper Methods
1 86
Options Menu
1 88
Context Menu
190
Some Additional Views
193
AnalogClock and DigitalClock Views
194
WebView
194
Summary
200
chApter 6:
dAtA perSiStence
20
3
Saving and Loading User Preferences
203
Using getSharedPreferences()
204
Using getPreferences()
208
Persisting Data to Files
209
Saving to Internal Storage
209
Saving to External Storage (SD Card)
214
Choosing the Best Storage Option
216
Using Static Resources
217
Creating and Using Databases
218
Creating the DBAdapter Helper Class
218
Using the Database Programmatically
224
Adding Contacts
224
Retrieving All the Contacts
225
Retrieving a Single Contact
226
Updating a Contact
227
Deleting a Contact
228
Upgrading the Database
230
Pre-Creating the Database
230
Bundling the Database with an Application
231
Summary
234
chApter 7:
content providerS
23
7
Sharing Data in Android
237
Using a Content Provider
238
Predeined Query String Constants
243
xi
  [ Pobierz całość w formacie PDF ]

  • zanotowane.pl
  • doc.pisz.pl
  • pdf.pisz.pl
  • marbec.opx.pl