Android cookbook: problems and solutions for Android developers
Gespeichert in:
1. Verfasser: | |
---|---|
Format: | Buch |
Sprache: | English |
Veröffentlicht: |
Beijing ; Boston ; Farnham ; Sebastopol ; Tokyo
O'Reilly
May 2017
|
Ausgabe: | Second edition |
Schlagworte: | |
Online-Zugang: | Inhaltsverzeichnis |
Beschreibung: | "Covers Android Nougat 7.0" - Auf dem Umschlag |
Beschreibung: | xxii, 747 Seiten Illustrationen, Diagramme |
ISBN: | 9781449374433 |
Internformat
MARC
LEADER | 00000nam a2200000 c 4500 | ||
---|---|---|---|
001 | BV044339600 | ||
003 | DE-604 | ||
005 | 20170802 | ||
007 | t | ||
008 | 170607s2017 a||| |||| 00||| eng d | ||
020 | |a 9781449374433 |c pbk |9 978-1-4493-7443-3 | ||
035 | |a (OCoLC)993017274 | ||
035 | |a (DE-599)BVBBV044339600 | ||
040 | |a DE-604 |b ger |e rda | ||
041 | 0 | |a eng | |
049 | |a DE-706 |a DE-739 |a DE-11 | ||
084 | |a ST 261 |0 (DE-625)143633: |2 rvk | ||
100 | 1 | |a Darwin, Ian F. |e Verfasser |0 (DE-588)1136028102 |4 aut | |
245 | 1 | 0 | |a Android cookbook |b problems and solutions for Android developers |c Ian Darwin |
250 | |a Second edition | ||
264 | 1 | |a Beijing ; Boston ; Farnham ; Sebastopol ; Tokyo |b O'Reilly |c May 2017 | |
300 | |a xxii, 747 Seiten |b Illustrationen, Diagramme | ||
336 | |b txt |2 rdacontent | ||
337 | |b n |2 rdamedia | ||
338 | |b nc |2 rdacarrier | ||
500 | |a "Covers Android Nougat 7.0" - Auf dem Umschlag | ||
650 | 0 | 7 | |a Android 7.0 |0 (DE-588)1125978422 |2 gnd |9 rswk-swf |
689 | 0 | 0 | |a Android 7.0 |0 (DE-588)1125978422 |D s |
689 | 0 | |5 DE-604 | |
856 | 4 | 2 | |m Digitalisierung UB Passau - ADAM Catalogue Enrichment |q application/pdf |u http://bvbr.bib-bvb.de:8991/F?func=service&doc_library=BVB01&local_base=BVB01&doc_number=029742665&sequence=000001&line_number=0001&func_code=DB_RECORDS&service_type=MEDIA |3 Inhaltsverzeichnis |
999 | |a oai:aleph.bib-bvb.de:BVB01-029742665 |
Datensatz im Suchindex
_version_ | 1804177571892428800 |
---|---|
adam_text | Table of Contents
Preface
« i ·
XIII
1. Getting Started. ....................................................
1.1 Understanding the Android Application Architecture
1.2 Understanding the Android Activity Life Cycle
1.3 Learning About Android Releases
1.4 Learning the Java Language
1.5 Creating a “Hello, World” Application from the Command Line
1.6 Creating a “Hello, World” App with Apache Maven
1.7 Choosing an IDE for Android Development
1.8 Setting Up Android Studio
1.9 Installing Platform Editions and Keeping the SDK Updated
1.10 Creating a “Hello, World” App Using Android Studio
1.11 Converting an Eclipse ADT Project to Android Studio
1.12 Preserving History While Converting from Eclipse to Android Studio
1.13 Building an Android Application with both Eclipse and Android Studio
1.14 Setting Up Eclipse with AndMore (Replacing ADT)
1.15 Creating a “Hello, World” Application Using Eclipse
1.16 Installing the Eclipse Marketplace Client in Your Eclipse
1.17 Upgrading a Project from Eclipse ADT to Eclipse AndMore
1.18 Controlling Emulaters/Devices Using Command-Line ADB
1.19 Sharing Java Classes from Another Eclipse Project
1.20 Referencing Libraries to Implement External Functionality
1.21 Using New Features on Old Devices via the Compatibility Libraries
1.22 Using SDK Samples to Help Avoid Head Scratching
1.23 Taking a Screenshot/Video from the Emulator/Android Device
1.24 Program: A Simple CountDownTimer Example
1.25 Program: Tipster, a Tip Calculator for the Android OS
1
1
3
5
7
8
13
15
18
21
25
30
34
36
39
46
51
53
57
59
62
67
68
70
76
79
2* Designing a Successful Application.......................................97
2.1 Exception Handling 101
2.2 Requesting Android Permissions at Runtime 104
2.3 Accessing Android s Application Object as a “Singleton” 106
2.4 Keeping Data When the User Rotates the Device 109
2.5 Monitoring the Battery Level of an Android Device 111
2.6 Creating Splash Screens in Android 113
2.7 Designing a Conference/Camp/Hackathon/Institution App 117
2.8 Using Google Analytics in an Android Application 119
2.9 Setting First-Run Preferences 122
2.10 Formatting Numbers 124
2.11 Formatting with Correct Plurals 128
2.12 Formatting the Time and Date for Display 130
2.13 Simplifying Date/Time Calculations with the Java 8 java.time API 133
2.14 Controlling Input with KeyListeners 135
2.15 Backing Up Android Application Data 138
2.16 Using Hints Instead of Tool Tips 144
3. Application Testing...................................................... 147
3.1 Setting Up an Android Virtual Device (AVD) for App Testing 148
3.2 Testing on a Wide Range of Devices with Cloud-Based Testing 154
3.3 Testing with Eclipse and JUnit 155
3.4 Testing with Android Studio and JUnit 158
3.5 Testing with Robolectric and JUnit 4 163
3.6 Testing with ATSL, Espresso, and JUnit 4 166
3.7 Troubleshooting Application Crashes 170
3.8 Debugging Using Log.dQ and LogCat 173
3.9 Getting Bug Reports Automatically with Crash Reporting 175
3.10 Using a Local Runtime Application Log for Analysis of Field Errors or
Situations 178
3.11 Reproducing Activity Life-Cycle Scenarios for Testing 182
3.12 Keeping Your App Snappy with StrictMode 186
3.13 Static Code Testing with Android Lint 187
3.14 Dynamic Testing with the Monkey Program 189
3.15 Sending Text Messages and Placing Calls Between AVDs 191
4. Inter-/lntra-Process Communication...................................... 195
4.1 Opening a Web Page, Phone Number, or Anything Else with an Intent 196
4.2 Emailing Text from a View 198
4.3 Sending an Email with Attachments 201
4.4 Pushing String Values Using Intent.putExtraQ 203
4.5 Retrieving Data from a Subactivity Back to Your Main Activity 204
vi | Table of Contents
4.6 Keeping a Background Service Running While Other Apps Are on Display 207
4.7 Sending/Receiving a Broadcast Message 209
4.8 Starting a Service After Device Reboot 210
4.9 Creating a Responsive Application Using Threads 211
4.10 Using AsyncTask to Do Background Processing 212
4.11 Sending Messages Between Threads Using an Activity Thread Queue and
Handler 220
4.12 Creating an Android Epoch HTML/JavaScript Calendar 222
5. Graphics........................................................... 229
5.1 Using a Custom Font 229
5.2 Drawing a Spinning Cube with OpenGL ES 232
5.3 Adding Controls to the OpenGL Spinning Cube 236
5.4 Freehand Drawing Smooth Curves 239
5.5 Taking a Picture Using an Intent 244
5.6 Taking a Picture Using android.media.Camera 246
5.7 Scanning a Barcode or QR Code with the Google ZXing Barcode Scanner 250
5.8 Using AndroidPlot to Display Charts and Graphs 253
5.9 Using Inkscape to Create an Android Launcher Icon from
OpenClipArt.org 257
5.10 Using Paint.NET to Create Launcher Icons from OpenClipArt.org 261
5.11 Using Nine Patch Files 269
5.12 Creating HTML5 Charts with Android RGraph 272
5.13 Adding a Simple Raster Animation 276
5.14 Using Pinch to Zoom 280
6. Graphical User Interface..............................................283
6.1 Understanding and Following User Interface Guidelines 284
6.2 Looking Good with Material Design 285
6.3 Choosing a Layout Manager (a.k.a. ViewGroup) and Arranging
Components 290
6.4 Handling Configuration Changes by Decoupling the View from the Model 291
6.5 Controlling the Action Bar 294
6.6 Adding a Share Action to Your Action Bar 298
6.7 Building Modern UIs with the Fragment API 302
6.8 Creating a Button and Its Click Event Listener 307
6.9 Enhancing UI Design Using Image Buttons 308
6.10 Using a FloatingActionButton , 309
6.11 Wiring Up an Event Listener in Many Different Ways 312
6.12 Using CheckBoxes and RadioButtons 317
6.13 Using Card Widgets 321
6.14 Offering a Drop-Down Chooser via the Spinner Class 323
Table of Contents | vii
6.15 Handling Long-Press/Long-Click Events 326
6.16 Displaying Text Fields with TextView and EditText 327
6.17 Constraining EditText Values with Attributes and the Text Watcher
Interface 328
6.18 Implementing AutoCompleteTextView 331
6.19 Feeding AutoCompleteTextView Using a SQLite Database Query 333
6.20 Turning Edit Fields into Password Fields 335
6.21 Changing the Enter Key to “Next” on the Soft Keyboard 336
6.22 Processing Key-Press Events in an Activity 339
6.23 Let Them See Stars: Using RatingBar 340
6.24 Making a View Shake 344
6.25 Providing Haptic Feedback 345
6.26 Navigating Different Activities Within a Tab View 349
6.27 Creating a Loading Screen that Will Appear Between Two Activities 350
6.28 Adding a Border with Rounded Corners to a Layout 352
6.29 Detecting Gestures in Android 355
6.30 Creating a Simple App Widget 362
7. GUI Alerts: Menus, Dialogs, Toasts, Snackbars, and Notifications...... 367
7.1 Alerting the User with Toast and Snackbar 368
7.2 Customizing the Appearance of a Toast 370
7.3 Creating and Displaying a Menu 371
7.4 Handling Choice Selection in a Menu 373
7.5 Creating a Submenu 374
7.6 Creating a Pop-up/Alert Dialog 376
7.7 Using a Timepicker Widget 378
7.8 Creating an iPhone-like WheelPicker for Selection 380
7.9 Creating a Tabbed Dialog 383
7.10 Creating a ProgressDialog 386
7.11 Creating a Custom Dialog with Buttons, Images, and Text 387
7.12 Creating a Reusable “About Box’ Class 389
7.13 Creating a Notification in the Status Bar 393
8. Other GUI Elements: Lists and Views................................... 399
8.1 Building List-Based Applications with RecyclerView 399
8.2 Building List-Based Applications with ListView 403
8.3 Creating a “No Data” View for ListViews 407
8.4 Creating an Advanced ListView with Images and Text 409
8.5 Using Section Headers in ListViews 413
8.6 Keeping the ListView with the Users Focus 418
8.7 Writing a Custom List Adapter 418
8.8 Using a SearchView to Search Through Data in a ListView 422
viii
Table of Contents
8.9 Handling Orientation Changes: From ListView Data Values to Landscape
Charting 424
9. Multimedia..............................................................431
9.1 Playing a YouTube Video 431
9.2 Capturing Video Using MediaRecorder 432
9.3 Using Android’s Face Detection Capability 435
9.4 Playing Audio from a File 438
9.5 Playing Audio Without Interaction 441
9.6 Using Speech to Text 443
9.7 Making the Device Speak with Text-to-Speech 444
10. Data Persistence...................................................... 447
10.1 Reading and Writing Files in Internal and External Storage 448
10.2 Getting File and Directory Information 452
10.3 Reading a File Shipped with the App Rather than in the Filesystem 457
10.4 Getting Space Information About the SD Card 459
10.5 Providing a Preference Activity 460
10.6 Checking the Consistency of Default Shared Preferences 465
10.7 Using a SQLite Database in an Android Application 467
10.8 Performing Advanced Text Searches on a SQLite Database 470
10.9 Working with Dates in SQLite 476
10.10 Exposing Non-SQL Data as a SQL Cursor 478
10.11 Displaying Data with a CursorLoader 481
10.12 Parsing JSON Using JSONObject 484
10.13 Parsing an XML Document Using the DOM API 486
10.14 Storing and Retrieving Data via a Content Provider 488
10.15 Writing a Content Provider 490
10.16 Adding a Contact Through the Contacts Content Provider 493
10.17 Reading Contact Data Using a Content Provider 496
10.18 Implementing Drag and Drop 498
10.19 Sharing Files via a FileProvider 502
10.20 Backing Up Your SQLite Data to the Cloud with a SyncAdapter 507
10.21 Storing Data in the Cloud with Google Firebase 516
11. Telephone Applications................................................. 523
11.1 Doing Something When the Phone Rings 523
11.2 Processing Outgoing Phone Calls 527
11.3 Dialing the Phone 531
11.4 Sending Single-part or Multipart SMS Messages 533
11.5 Receiving an SMS Message 535
11.6 Using Emulator Controls to Send SMS Messages to the Emulator 537
Table of Contents | ix
11.7 Using Androids Telephony Manager to Obtain Device Information
538
12. Networked Applications...................*............................549
12.1 Consuming a RESTful Web Service Using a URLConnection 550
12.2 Consuming a RESTful Web Service with Volley 553
12.3 Notifying Your App with Google Cloud Messaging “Push Messaging” 555
12.4 Extracting Information from Unstructured Text Using Regular
Expressions 564
12.5 Parsing RSS/Atom Feeds Using ROME 566
12.6 Using MD5 to Digest Clear Text 570
12.7 Converting Text into Hyperlinks 571
12.8 Accessing a Web Page Using a Web View 572
12.9 Customizing a WebView 573
12.10 Writing an Inter-Process Communication Service 574
13. Gaming and Animation................................................. 581
13.1 Building an Android Game Using ffixel-gdx 582
13.2 Building an Android Game Using AndEngine 586
13.3 Processing Timed Keyboard Input 593
14. Social Networking................................................. 595
14.1 Authenticating Users with OAUTH2 595
14.2 Integrating Social Networking Using HTTP 599
14.3 Loading a Users Twitter Timeline Using HTML or JSON 602
15. Location and Map Applications...................................... 605
15.1 Getting Location Information 605
15.2 Accessing GPS Information in Your Application 607
15.3 Mocking GPS Coordinates on a Device 609
15.4 Using Geocoding and Reverse Geocoding 612
15.5 Getting Ready for Google Maps API V2 Development 613
15.6 Using the Google Maps API V2 619
15.7 Displaying Map Data Using OpenStreetMap 624
15.8 Creating Overlays in OpenStreetMap Maps 627
15.9 Using a Scale on an OpenStreetMap Map 629
15.10 Handling Touch Events on an OpenStreetMap Overlay 630
15.11 Getting Location Updates with OpenStreetMap Maps 633
16. Accelerometer........................................................ 637
16.1 Checking for the Presence or Absence of a Sensor 637
16.2 Using the Accelerometer to Detect Shaking 638
16.3 Checking Whether a Device Is Facing Up or Down 642
/
x | Table of Contents
16.4 Reading the Temperature Sensor
643
17. Bluetooth................................................................. 645
17.1 Enabling Bluetooth and Making the Device Discoverable 645
17.2 Connecting to a Bluetooth-Enabled Device 647
17.3 Accepting Connections from a Bluetooth Device 650
17.4 Implementing Bluetooth Device Discovery 651
18. System and Device Control.................................................653
18.1 Accessing Phone Network/Connectivity Information 653
18.2 Obtaining Information from the Manifest File 654
18.3 Changing Incoming Call Notification to Silent, Vibrate, or Normal 655
18.4 Copying Text and Getting Text from the Clipboard 658
18.5 Using LED-Based Notifications 658
18.6 Making the Device Vibrate 659
18.7 Determining Whether a Given Application Is Running 660
19. All the World s Not Java: Other Programming Languages and Frameworks......663
19.1 Learning About Cross-Platform Solutions 664
19.2 Running Shell Commands from Your Application 665
19.3 Running Native C/C++ Code with JNI on the NDK 667
19.4 Getting Started with SL4A, the Scripting Layer for Android 673
19.5 Creating Alerts in SL4A 675
19.6 Fetching Your Google Documents and Displaying Them in a ListView
Using SL4A 679
19.7 Sharing SL4A Scripts in QR Codes 682
19.8 Using Native Handset Functionality from a Web View via JavaScript 684
19.9 Building a Cross-Platform App with Xamarin 686
19.10 Creating a Cross-Platform App Using PhoneGap/Cordova 691
20. All the World s Not English: Strings and Internationalization........... 695
20.1 Internationalizing Application Text 696
20.2 Finding and Translating Strings 699
20.3 Handling the Nuances of strings.xml 701
21. Packaging, Deploying, and Distributing/Selling Your App................. 707
21.1 Creating a Signing Certificate and Using It to Sign Your Application 707
21.2 Distributing Your Application via the Google Play Store 711
21.3 Distributing Your Application via Other App Stores 713
21.4 Monetizing Your App with AdMob 714
21.5 Obfuscating and Optimizing with ProGuard 720
21.6 Hosting Your App on Your Own Server 723
Table of Contents | xi
21.7 Creating a “Self-Updating” App 725
21.8 Providing a Link to Other Published Apps in the Google Play Store 727
Index....................................................................... 731
xii | Table of Contents
|
any_adam_object | 1 |
author | Darwin, Ian F. |
author_GND | (DE-588)1136028102 |
author_facet | Darwin, Ian F. |
author_role | aut |
author_sort | Darwin, Ian F. |
author_variant | i f d if ifd |
building | Verbundindex |
bvnumber | BV044339600 |
classification_rvk | ST 261 |
ctrlnum | (OCoLC)993017274 (DE-599)BVBBV044339600 |
discipline | Informatik |
edition | Second edition |
format | Book |
fullrecord | <?xml version="1.0" encoding="UTF-8"?><collection xmlns="http://www.loc.gov/MARC21/slim"><record><leader>01385nam a2200337 c 4500</leader><controlfield tag="001">BV044339600</controlfield><controlfield tag="003">DE-604</controlfield><controlfield tag="005">20170802 </controlfield><controlfield tag="007">t</controlfield><controlfield tag="008">170607s2017 a||| |||| 00||| eng d</controlfield><datafield tag="020" ind1=" " ind2=" "><subfield code="a">9781449374433</subfield><subfield code="c">pbk</subfield><subfield code="9">978-1-4493-7443-3</subfield></datafield><datafield tag="035" ind1=" " ind2=" "><subfield code="a">(OCoLC)993017274</subfield></datafield><datafield tag="035" ind1=" " ind2=" "><subfield code="a">(DE-599)BVBBV044339600</subfield></datafield><datafield tag="040" ind1=" " ind2=" "><subfield code="a">DE-604</subfield><subfield code="b">ger</subfield><subfield code="e">rda</subfield></datafield><datafield tag="041" ind1="0" ind2=" "><subfield code="a">eng</subfield></datafield><datafield tag="049" ind1=" " ind2=" "><subfield code="a">DE-706</subfield><subfield code="a">DE-739</subfield><subfield code="a">DE-11</subfield></datafield><datafield tag="084" ind1=" " ind2=" "><subfield code="a">ST 261</subfield><subfield code="0">(DE-625)143633:</subfield><subfield code="2">rvk</subfield></datafield><datafield tag="100" ind1="1" ind2=" "><subfield code="a">Darwin, Ian F.</subfield><subfield code="e">Verfasser</subfield><subfield code="0">(DE-588)1136028102</subfield><subfield code="4">aut</subfield></datafield><datafield tag="245" ind1="1" ind2="0"><subfield code="a">Android cookbook</subfield><subfield code="b">problems and solutions for Android developers</subfield><subfield code="c">Ian Darwin</subfield></datafield><datafield tag="250" ind1=" " ind2=" "><subfield code="a">Second edition</subfield></datafield><datafield tag="264" ind1=" " ind2="1"><subfield code="a">Beijing ; Boston ; Farnham ; Sebastopol ; Tokyo</subfield><subfield code="b">O'Reilly</subfield><subfield code="c">May 2017</subfield></datafield><datafield tag="300" ind1=" " ind2=" "><subfield code="a">xxii, 747 Seiten</subfield><subfield code="b">Illustrationen, Diagramme</subfield></datafield><datafield tag="336" ind1=" " ind2=" "><subfield code="b">txt</subfield><subfield code="2">rdacontent</subfield></datafield><datafield tag="337" ind1=" " ind2=" "><subfield code="b">n</subfield><subfield code="2">rdamedia</subfield></datafield><datafield tag="338" ind1=" " ind2=" "><subfield code="b">nc</subfield><subfield code="2">rdacarrier</subfield></datafield><datafield tag="500" ind1=" " ind2=" "><subfield code="a">"Covers Android Nougat 7.0" - Auf dem Umschlag</subfield></datafield><datafield tag="650" ind1="0" ind2="7"><subfield code="a">Android 7.0</subfield><subfield code="0">(DE-588)1125978422</subfield><subfield code="2">gnd</subfield><subfield code="9">rswk-swf</subfield></datafield><datafield tag="689" ind1="0" ind2="0"><subfield code="a">Android 7.0</subfield><subfield code="0">(DE-588)1125978422</subfield><subfield code="D">s</subfield></datafield><datafield tag="689" ind1="0" ind2=" "><subfield code="5">DE-604</subfield></datafield><datafield tag="856" ind1="4" ind2="2"><subfield code="m">Digitalisierung UB Passau - ADAM Catalogue Enrichment</subfield><subfield code="q">application/pdf</subfield><subfield code="u">http://bvbr.bib-bvb.de:8991/F?func=service&doc_library=BVB01&local_base=BVB01&doc_number=029742665&sequence=000001&line_number=0001&func_code=DB_RECORDS&service_type=MEDIA</subfield><subfield code="3">Inhaltsverzeichnis</subfield></datafield><datafield tag="999" ind1=" " ind2=" "><subfield code="a">oai:aleph.bib-bvb.de:BVB01-029742665</subfield></datafield></record></collection> |
id | DE-604.BV044339600 |
illustrated | Illustrated |
indexdate | 2024-07-10T07:50:12Z |
institution | BVB |
isbn | 9781449374433 |
language | English |
oai_aleph_id | oai:aleph.bib-bvb.de:BVB01-029742665 |
oclc_num | 993017274 |
open_access_boolean | |
owner | DE-706 DE-739 DE-11 |
owner_facet | DE-706 DE-739 DE-11 |
physical | xxii, 747 Seiten Illustrationen, Diagramme |
publishDate | 2017 |
publishDateSearch | 2017 |
publishDateSort | 2017 |
publisher | O'Reilly |
record_format | marc |
spelling | Darwin, Ian F. Verfasser (DE-588)1136028102 aut Android cookbook problems and solutions for Android developers Ian Darwin Second edition Beijing ; Boston ; Farnham ; Sebastopol ; Tokyo O'Reilly May 2017 xxii, 747 Seiten Illustrationen, Diagramme txt rdacontent n rdamedia nc rdacarrier "Covers Android Nougat 7.0" - Auf dem Umschlag Android 7.0 (DE-588)1125978422 gnd rswk-swf Android 7.0 (DE-588)1125978422 s DE-604 Digitalisierung UB Passau - ADAM Catalogue Enrichment application/pdf http://bvbr.bib-bvb.de:8991/F?func=service&doc_library=BVB01&local_base=BVB01&doc_number=029742665&sequence=000001&line_number=0001&func_code=DB_RECORDS&service_type=MEDIA Inhaltsverzeichnis |
spellingShingle | Darwin, Ian F. Android cookbook problems and solutions for Android developers Android 7.0 (DE-588)1125978422 gnd |
subject_GND | (DE-588)1125978422 |
title | Android cookbook problems and solutions for Android developers |
title_auth | Android cookbook problems and solutions for Android developers |
title_exact_search | Android cookbook problems and solutions for Android developers |
title_full | Android cookbook problems and solutions for Android developers Ian Darwin |
title_fullStr | Android cookbook problems and solutions for Android developers Ian Darwin |
title_full_unstemmed | Android cookbook problems and solutions for Android developers Ian Darwin |
title_short | Android cookbook |
title_sort | android cookbook problems and solutions for android developers |
title_sub | problems and solutions for Android developers |
topic | Android 7.0 (DE-588)1125978422 gnd |
topic_facet | Android 7.0 |
url | http://bvbr.bib-bvb.de:8991/F?func=service&doc_library=BVB01&local_base=BVB01&doc_number=029742665&sequence=000001&line_number=0001&func_code=DB_RECORDS&service_type=MEDIA |
work_keys_str_mv | AT darwinianf androidcookbookproblemsandsolutionsforandroiddevelopers |