Contents xvii
■ Chapter 13: Android Service Class and Threads: Background Processing ������������������� 475
Android Service Classes: Characteristics 476
Controlling Your Service: Privacy and Priority 477
Processes and Thread: Foundational Information 478
Spawning a Process: The android:process XML Parameter 479
The Process Lifecycle: Keeping a Process Alive 480
Thread Caveats: Don’t Interfere with UI Thread 483
Should Your Android App Use Services or Threads? 484
Creating a Service Subclass: AmbientService 485
Using a Service to Carry Out a Task 487
Configuring AndroidManifest to Add a <service> 490
Starting a Service: Using startService( ) 491
Setting Up Your UI Design Using XML and Java 492
Testing the PlayVideo Class with the Nexus One 500
Summary 503
■ Chapter 14: Android Content Providers: Providing Data to Applications ��������������������� 505
An Overview of Android Content Providers 506
Database Fundamentals: Concepts and Terms 507
SQLite: The Open Source Database Engine 508
Android Built-in Content Providers 510
Android 15 Contacts Database Contact Provider 510
Deprecated Database Structures: Software Upgrades 511
The Android MediaStore Content Providers 514
The Android CalendarContract Content Providers 514
Referencing a Content Provider: Content URI 515
Creating the Activity: ContactGalaxyjava 517
Adding the ContactGalaxy Class to the Manifest 519
Adding a Contact Galaxy Ruler Item to the Menu 520
Adding a Menu Intent in the MainActivity Class 521
Creating Your Galaxy Emperor Contact Database 523