Start free trial
Trending New Genres Authors
EnglishEnglish
EspañolSpanish
简体中文Chinese
繁體中文Chinese (Traditional)
FrançaisFrench
DeutschGerman
日本語Japanese
PortuguêsPortuguese
ItalianoItalian
한국어Korean
РусскийRussian
NederlandsDutch
العربيةArabic
PolskiPolish
हिन्दीHindi
Tiếng ViệtVietnamese
SvenskaSwedish
ΕλληνικάGreek
TürkçeTurkish
ไทยThai
ČeštinaCzech
RomânăRomanian
MagyarHungarian
УкраїнськаUkrainian
IndonesiaIndonesian
DanskDanish
SuomiFinnish
БългарскиBulgarian
עבריתHebrew
NorskNorwegian
HrvatskiCroatian
CatalàCatalan
SlovenčinaSlovak
LietuviųLithuanian
SlovenščinaSlovenian
СрпскиSerbian
EestiEstonian
LatviešuLatvian
فارسیPersian
മലയാളംMalayalam
தமிழ்Tamil
اردوUrdu
Searching...
SoBrief
Learning Android

Learning Android

Build an Android app from a first post to a live timeline and home-screen widget.
by Marko Gargenta 2011 284 pages
3.68
213 ratings
Listen
Immersive
V2.3
Amazon Kindle Audible
Try Full Access for 3 Days
Unlock listening & more!
Continue

Key Takeaways

Build Android apps as cooperating components, not one giant screen.

Think in components. An Android application is a collection of parts with distinct jobs, rather than a single screen that does everything. An Activity presents a screen; a Service handles work without a screen; a Content Provider exposes stored data; and a Broadcast Receiver responds to events. Intents carry requests between these components, sometimes across app boundaries.

Follow Yamba’s design. The book’s sample microblogging app uses a screen to write posts, a background service to fetch a timeline, a local database to keep it available, and a home-screen widget to show a recent update. Splitting responsibilities makes each feature easier to build and test, while Android’s application context supplies shared resources to the app’s components.

Analysis

What's striking is that Android's component model treats an app less like a conventional program and more like a small event-driven system. That resembles service-oriented architecture, where clear interfaces let separate modules evolve without knowing each other's internals. The benefit depends on keeping those interfaces disciplined: splitting everything into components can create needless indirection. A useful design test is whether a feature has a genuinely different lifetime, interface, or data-sharing need. If not, another component may be architecture for architecture's sake.

Let Android own screen lifecycles, and save state before it disappears.

The system manages screens. Activities move through states as users open, cover, leave, and revisit them. The Activity Manager decides which screens stay in memory and which are removed when resources are scarce. A screen returning from the background may be resumed quickly, while one the system has discarded must be recreated.

Persist what matters. The developer does not control those decisions, but can respond to lifecycle callbacks such as `onCreate()`, `onPause()`, and `onStop()`. The book recommends saving important unsaved data before an activity is destroyed, particularly in `onStop()`, since there is no guarantee that `onDestroy()` will be called. Treat the screen as temporary, and put durable user data somewhere designed to outlast it.

Analysis

This model makes resource management part of interface design. It resembles garbage collection: the platform controls allocation pressure, while the application must make its state reconstructible. The deeper lesson is to distinguish durable information, such as a draft or account preference, from disposable presentation state, such as a currently highlighted row. That distinction improves recovery from more than low memory. It also helps with rotation, interruption, and process death. Automatic management reduces user burden, but it does not absolve developers of state-management work.

Declare stable interface structure in XML; reserve Java for behavior.

Separate appearance from action. Android lets developers describe a screen declaratively in XML or construct it with Java. The book recommends using XML for relatively stable structure, such as layouts, labels, and buttons, then using Java to react to input and connect the interface to application logic. At runtime, Android inflates the XML into Java objects.

Use resources deliberately. Text belongs in string resources, not scattered through code, so it can be translated without changing program logic. Alternative resource folders let Android select suitable images or layouts for screen density, language, or orientation. The generated `R` class connects Java code to those resources. It is generated by the tools, so developers refer to it but do not edit it.

Analysis

The separation resembles the model-view-controller tradition: presentation can change without rewriting the behavior that uses it. Resource qualifiers make that separation especially practical because device variation becomes a selection problem rather than a maze of screen-specific conditionals. There is a tradeoff, however. XML can conceal behavior when layouts become deeply nested or overloaded with configuration. The strongest use of declarative UI is not maximal XML, but a clear boundary: describe what the interface contains, then make its interactions explicit in code.

Move slow work off the UI thread before users feel the wait.

Keep interaction responsive. By default, an Android app handles interface drawing, taps, and application work on a main thread, often called the UI thread. A network request can take an unpredictable amount of time. If that request blocks the UI, the app stops responding to the user, and Android may show an Application Not Responding warning. The book notes that this can happen after roughly five seconds.

Separate work from feedback. Its examples use `AsyncTask` for a status post: network work runs in the background, then a callback on the UI thread displays success or failure. For longer background work, the book uses `IntentService`, which processes requests on a worker thread. The key principle is to keep slow I/O away from the thread responsible for interaction.

Analysis

Responsiveness is not cosmetic. It is a form of reliability that users experience directly: a correct result delivered after a frozen screen still feels like failure. This is also a concurrency problem, not simply a speed problem. Background work must communicate results safely, which is why callback boundaries matter. The book's named utilities belong to its Android era, but the design constraint remains: do not block the interface while waiting on remote systems. Network latency is outside the app's control, so its thread strategy cannot be an afterthought.

Use intents to connect app features without hardwiring every destination.

Send a request, not a direct call. An Intent is a message that can start an Activity or Service, or broadcast an event. An explicit intent names the intended component. An implicit intent describes an action, such as opening a web page, and lets Android find an app able to handle it. When several apps qualify, the user can choose one or set a default.

Declare the app’s boundaries. Components and required permissions are recorded in the manifest. Yamba, for example, declares internet access before contacting its remote service. Broadcast Receivers use intent filters to subscribe to events such as device startup, while the system can activate a matching receiver. This messaging approach supports replaceable components, but permissions and exported status determine which other apps may reach them.

Analysis

Intents combine routing with a kind of capability negotiation: the sender describes a task, while the operating system can locate a suitable handler. That is powerful because it allows users to substitute applications without requiring every app to know every other app. The security corollary is important. A component that can be reached by another application is an interface, whether or not its author intended it to be one. Clear manifest declarations and appropriately limited access are therefore part of interface design, not just setup chores.

Cache cloud data locally, then expose it through a clean provider.

Make the app useful offline. Yamba retrieves recent posts from a web service, then stores them in SQLite so the interface can display cached information without waiting for the network. SQLite fits this role because it is built into Android, needs no separate database server, and stores data in a file within the app’s private area.

Put an interface between code and storage. The book introduces a Content Provider as an interface for querying and changing data, including across application boundaries. Its operations follow CRUD: create, read, update, and delete. Yamba’s refresh service inserts records through the provider rather than writing directly to the database. This reduces dependence on a particular storage implementation and gives lists and widgets a consistent way to request updates.

Analysis

A local cache changes the user's relationship with connectivity: the app can remain informative even when the network is unavailable or slow. This is a form of graceful degradation, a principle used in resilient distributed systems. The provider also creates a useful seam between data ownership and data use. Yet an abstraction is valuable only when its access rules and update behavior are clear. Sharing persistent data raises questions of authorization, consistency, and stale results. A provider makes those concerns manageable; it does not make them disappear.

Let adapters bind large datasets to small screens incrementally.

Connect data without copying the world. A ListView can display many records, but manually building a separate view for every database row is inefficient. An Adapter connects a data source, such as a database Cursor, to the views that display each row. Yamba uses a `SimpleCursorAdapter` to map columns for user, message, and timestamp onto fields in a list-item layout.

Load without freezing the screen. The book uses a `CursorLoader` so data retrieval happens away from the UI thread. When results are ready, a callback supplies the Cursor to the adapter. A custom view binder converts a stored timestamp into a relative time display. The same timeline data can support a detailed post view or a home-screen widget, while each interface presents it differently.

Analysis

Adapters are an example of indirection doing practical work: the data model does not need to know how every screen renders it, and the view does not need to own the dataset. As data grows, that separation avoids treating a screen as a container for all records. The design also makes transformation points visible, as with the human-readable timestamp. A caution is that a smooth list depends on more than binding. Query cost, resource cleanup, and update frequency also affect performance, particularly when a data source changes often.

Fragments let one screen design adapt across phones and tablets.

Separate screen content from its container. A Fragment is a reusable portion of an interface hosted by an Activity. The book converts Yamba’s status screen into a fragment, then shows how fragments can be added through XML or created dynamically in Java. A fragment has its own lifecycle, including callbacks for creating and destroying its view.

Recompose for available space. On a small portrait screen, a timeline and its details may need separate screens. On a wider display, both can appear side by side. The same timeline fragment can therefore be paired with a details fragment when there is room, or placed in a separate activity when there is not. Fragments help adapt the composition without duplicating the underlying feature logic.

Analysis

The important idea is compositional design: a screen is not necessarily an indivisible page, but a set of meaningful regions that can be rearranged. This resembles responsive web design, where content structure is preserved while presentation shifts with the viewport. The approach is most effective when fragments have coherent responsibilities and communicate through explicit interfaces. Otherwise, lifecycle complexity can migrate from the activity into tightly coupled fragments. Modularity creates options, but good boundaries still require judgment.

Choose Android API levels for real device reach, not novelty.

Distinguish version from capability. Android’s version label and its API level are related but not interchangeable. The API level identifies the framework capabilities an app expects, and the minimum supported level limits which devices can install it. The book advises choosing the lowest level that meets the app’s requirements, after considering which versions people actually use.

Compatibility is a negotiated promise. Google’s Compatibility Test Suite (CTS) defines whether a device meets requirements associated with Android compatibility. Manufacturers can modify the open-source Android Open Source Project, or build specialized devices without CTS, but compatible devices have a stronger expectation that ordinary apps will work. In the book’s historical 2013 snapshot, version distribution shaped its recommended minimum. That number should not be treated as current guidance.

Analysis

This is a product decision disguised as a build setting. Supporting older APIs expands the possible audience, but it can constrain implementation and testing. Conversely, targeting only the newest capabilities can simplify development while excluding people with older devices. The book's historical framing is valuable precisely because it exposes how quickly platform advice expires. The durable skill is to inspect current distribution data, identify which features justify a higher minimum, and test the actual device range. Compatibility is a user promise, not merely a checkbox.

Build Yamba in working increments, from status post to home widget.

Learn through a complete application. Yamba, short for Yet Another Micro Blogging App, begins as a screen for posting a status and grows into an app that fetches a timeline, stores it locally, and displays it in lists and a widget. Along the way, it uses activities, fragments, preferences, services, providers, receivers, alarms, and notifications. Each feature has a reason to exist in the example rather than appearing as an isolated API demonstration.

Keep each stage runnable. The book’s teaching approach adds features in small steps, checks that the app still works, and refactors when repeated code becomes a problem. The Android SDK, an IDE, and an emulator make that build-test cycle possible without requiring a physical device. The outcome is not just familiarity with Java syntax, but practice assembling Android components into a functioning product.

Analysis

A coherent project teaches integration costs that isolated examples hide. A network call must fit the lifecycle, stored data must reach a list, and a notification must lead somewhere useful. This resembles project-based learning, where understanding is tested through the consequences of connecting ideas. Small runnable increments also localize failures: when something breaks, the newest change is a more plausible cause than the entire codebase. The limitation is that a tutorial service and simplified credentials reduce real-world complexity. The project is a map of Android concepts, not a production specification.

Analysis

Learning Android is a practical teaching book organized around a single evolving application, not a reference manual that merely inventories APIs. Its strongest contribution is architectural: it teaches developers to see an Android app as a set of components with different responsibilities and lifetimes. Yamba gives that abstraction a concrete shape. A post begins in a screen, a background task sends it to a service, fetched messages enter local storage through a provider, and adapters render them in interfaces that can be recomposed with fragments or surfaced in a widget.

That sequence also reveals the central difficulty of Android development: coordination. The platform controls activity lifecycles, the network has unpredictable latency, and the UI must remain responsive while data moves between components. The book repeatedly addresses these constraints with callbacks, background execution, persistent storage, and message-based communication. Its advice is strongest when it explains why a tool exists, such as using a worker thread to avoid a frozen interface, rather than when it simply names a class.

The text is historically situated. It describes Android versions, Eclipse, Dalvik, and utilities such as AsyncTask as they appeared around 2013 and 2014. Current development environments and platform practices have changed, so code-level prescriptions need verification against modern documentation. That age does not erase the durable lessons: keep blocking work away from interaction, design for lifecycle interruption, separate presentation from data, and treat API support as an audience decision.

The book assumes readers already know Java or a similar language. Its concise Java review reinforces concepts needed for Android, including interfaces, inheritance, collections, generics, exceptions, and threads, but the true subject is thinking in platform terms. For a reader seeking current copy-paste code, it is dated. For a reader seeking the conceptual wiring diagram of Android applications, its staged Yamba project remains a useful model.

Summary in 30 Seconds
Android apps work best when screens, background services, data storage, and event handlers have distinct roles. Save important data across screen interruptions, and keep network work off the interface thread to prevent freezes. Store remote data locally for offline access, and use providers and adapters to connect storage to displays. Fragments can rearrange content for different screen sizes, while API-level choices determine which devices can install the app.
Contains spoilers

Last updated:

Report Issue

Review Summary

3.68 out of 5
Average of 213 ratings from Goodreads and Amazon.

Learning Android receives mixed reviews, with an average rating of 3.68/5. Readers appreciate its practical approach, building a Twitter-like app to teach concepts. Many find it helpful for beginners with Java knowledge. However, numerous reviewers note code errors, typos, and outdated information, particularly in later chapters. Some praise the book's comprehensive coverage of Android basics, while others struggle with inconsistencies and incomplete explanations. Despite these issues, many still recommend it as a starting point for Android development, valuing its hands-on methodology.

Your rating:
4.27
206 ratings
Want to read the full book?

Glossary

Activity

A user-facing screen

An Activity is an Android application component that usually presents one screen and responds to user interaction. The system manages its lifecycle, creating, pausing, stopping, or removing it as the user moves through the app and as device resources require. Developers implement lifecycle callbacks to initialize the screen and preserve important state.

Intent

A component message

An Intent is a message used to request an action from an Android component. It can explicitly identify a particular component or implicitly describe an action that any suitable component may handle. Intents can start activities or services, and they can be broadcast to interested receivers.

Service

Background application component

A Service is an Android component without a user interface, intended for operations that should continue independently of the screen currently shown. A service does not automatically run on a separate thread, so work that may block or take significant time must be handled away from the UI thread.

IntentService

Worker-thread service

IntentService is a Service subclass designed to handle work requests on a worker thread. Its onHandleIntent() method performs the task, and the service stops itself after processing is complete. In the book, it is used to fetch timeline data without blocking the interface.

Content Provider

Interface to stored data

A Content Provider exposes structured data through a standard interface, commonly supporting insert, query, update, and delete operations. Other app components access it through a content resolver and a content URI. Providers can share persistent data across application boundaries, subject to their declared access rules.

Broadcast Receiver

Listener for broadcast events

A Broadcast Receiver is an Android component activated when it receives a matching broadcast Intent. It is commonly used to respond to system events, such as device startup, or events sent by an application. Its onReceive() callback handles the event and can initiate other component work.

Fragment

Reusable interface section

A Fragment is a reusable portion of an application's interface hosted within an Activity. It has a lifecycle associated with its host and can be added through XML or dynamically through a fragment transaction. Fragments allow interface regions to be combined or separated to suit different screen sizes and orientations.

Compatibility Test Suite (CTS)

Android compatibility tests

The Compatibility Test Suite is a set of tests and requirements used to assess whether a device implements Android compatibility for a given platform version. The book describes CTS as a way to improve the likelihood that apps built for that version will run on compatible devices, while noting that customized Android systems can choose not to meet it.

Android Open Source Project

Open-source Android base

Android Open Source Project, commonly abbreviated AOSP, is the open-source reference version of Android described in the book. Device manufacturers can use and modify it, often adding their own applications or interface features. A consumer device may therefore run a customized version rather than an untouched AOSP build.

Dalvik

Android virtual machine

Dalvik was the virtual machine used by the Android platform described in this edition. Android development tools converted compiled Java bytecode into Dalvik bytecode, which ran in the Dalvik virtual machine. The book presents it as designed for mobile constraints such as limited memory and battery power.

FAQ

What's Learning Android by Marko Gargenta about?

  • Comprehensive Guide: Learning Android is a detailed guide for developers interested in creating Android applications, covering the platform's components and their effective use in app development.
  • Example-Based Learning: The book is structured around building a sample application called Yamba, which helps readers understand various Android features through practical examples.
  • Target Audience: It is aimed at software developers with a background in Java or similar programming languages, making it accessible for those transitioning into mobile app development.

Why should I read Learning Android by Marko Gargenta?

  • Hands-On Approach: The book emphasizes learning by doing, allowing readers to solidify concepts as they build a real application.
  • Expert Insights: Authored by experienced developers, it provides insights drawn from years of teaching and practical experience in mobile development.
  • Up-to-Date Content: Covers the latest Android features and best practices, ensuring readers learn relevant and current information.

What are the key takeaways of Learning Android by Marko Gargenta?

  • Understanding Android Architecture: Readers will gain a solid understanding of the Android operating system architecture, including its components like activities, services, and content providers.
  • Building User Interfaces: The book teaches how to create user interfaces using XML and Java, focusing on best practices for layout and design.
  • Networking and Data Management: It covers managing data and network operations, including using APIs and handling background tasks effectively.

What are the main building blocks of Android applications discussed in Learning Android?

  • Activities: Represent a single screen in an app and are crucial for user interaction, with explanations on their lifecycle and transitions.
  • Services: Run in the background to perform long-running operations without a user interface, with details on implementation and management.
  • Content Providers: Allow data sharing between applications, with discussions on creating and using them to manage app data.

How does Learning Android by Marko Gargenta approach teaching Android development?

  • Step-by-Step Guidance: Provides instructions for setting up the development environment and building the Yamba application, making it easy for beginners.
  • Incremental Learning: Introduces concepts incrementally, allowing readers to build on their knowledge as they progress through the chapters.
  • Practical Examples: Includes practical examples and exercises that reinforce the concepts being taught, ensuring readers can apply what they learn.

What tools and technologies are recommended in Learning Android by Marko Gargenta?

  • Android SDK: Emphasizes using the Android Software Development Kit (SDK) for building applications, guiding readers through installation and setup.
  • Eclipse IDE: Initially recommends using Eclipse as the Integrated Development Environment (IDE) for Android development, noting the transition to Android Studio.
  • Java Programming: A solid understanding of Java is essential, as the book builds on Java concepts to teach Android development.

What is the Yamba application, and why is it used in Learning Android by Marko Gargenta?

  • Twitter-Like App: Yamba is a sample application that mimics Twitter functionality, allowing users to post status updates and view friends' statuses.
  • Comprehensive Coverage: Covers various Android features, making it an ideal case study for learning about activities, services, and networking.
  • Learning Focus: By building Yamba, readers can see how different components of Android work together in a real-world application, enhancing their understanding of the platform.

How does Learning Android by Marko Gargenta address the Android lifecycle?

  • Lifecycle Management: Explains the lifecycle of activities and services, detailing how to manage state transitions effectively.
  • Callbacks and States: Covers important lifecycle callbacks such as onCreate(), onStart(), and onPause(), helping developers know when to execute specific code.
  • Best Practices: Provides best practices for handling lifecycle events, ensuring applications remain efficient and user-friendly.

What are some common pitfalls in Android development mentioned in Learning Android by Marko Gargenta?

  • UI Thread Blocking: Warns against performing long-running operations on the UI thread, which can lead to application unresponsiveness.
  • Resource Management: Highlights the importance of managing resources effectively, such as memory and network connections, to prevent leaks and crashes.
  • Permissions Handling: Discusses the need for proper permissions management, especially for accessing sensitive data or network resources, to ensure compliance with Android security practices.

What are the best practices for user interface design in Android as per Learning Android by Marko Gargenta?

  • Use of XML Layouts: Advocates for using XML to define layouts, which separates design from logic and makes it easier to manage UI changes.
  • Responsive Design: Emphasizes creating responsive designs that adapt to different screen sizes and orientations, using techniques like alternative resources.
  • User Feedback: Encourages providing immediate feedback to users through UI elements like Toast messages and progress indicators, enhancing the overall user experience.

What are fragments, and how are they used in Learning Android by Marko Gargenta?

  • Modular UI Components: Fragments are reusable components that represent a portion of the user interface, allowing for flexible layouts.
  • Fragment Lifecycle: Covers the lifecycle of fragments, including how they interact with their parent activity, essential for managing UI updates.
  • Dynamic Fragment Management: Demonstrates how to dynamically add, remove, and replace fragments within an activity for more interactive applications.

How does Learning Android by Marko Gargenta explain the use of services?

  • Service Types: Differentiates between started and bound services, explaining their use cases and how they enhance user experience.
  • Service Lifecycle: Covers the lifecycle of services, including how to start, stop, and bind to services for efficient operation.
  • IntentService: Introduces IntentService as a subclass of Service that handles asynchronous requests on a background thread, simplifying long-running operations.

About the Author

Marko Gargenta is an experienced Android developer and educator. He likely has a background in computer science or a related field, given his expertise in mobile app development. Gargenta's approach to teaching Android programming is hands-on, focusing on building a real-world application to illustrate concepts. His writing style is described as clear and well-thought-out, particularly in the earlier chapters of the book. As the founder of Marakana, a training company, Gargenta has experience in crafting educational content for developers. His work reflects a deep understanding of Android's architecture and best practices in app development.

Download PDF

To save this Learning Android summary for later, download the free PDF. You can print it out, or read offline at your convenience.
Download PDF
File size: 0.38 MB     Pages: 21

Download EPUB

To read this Learning Android summary on your e-reader device or app, download the free EPUB. The .epub digital book format is ideal for reading ebooks on phones, tablets, and e-readers.
Download EPUB
File size: 1.34 MB     Pages: 25
Want to read the full book?
Follow
Listen
Home
Swipe
Library
Get App
Try Full Access for 3 Days
Listen, bookmark, and more
Compare Features Free Pro
📖 Read Summaries
Read unlimited summaries. Free users get 3 per month
🎧 Listen to Summaries
Listen to unlimited summaries in 40 languages
—
❤️ Unlimited Bookmarks
Free users are limited to 4
—
📜 Unlimited History
Free users are limited to 4
—
📥 Unlimited Downloads
Free users are limited to 1
—
Risk-Free Timeline
Today: Get Instant Access
Listen to full summaries of 26,000+ books. That's 12,000+ hours of audio!
Day 2: Trial Reminder
We'll send you a notification that your trial is ending soon.
Day 3: Your subscription begins
You'll be charged on Nov 24,
cancel anytime before.
Consume 2.8× More Books
2.8× more books Listening Reading
Our users love us
1M+ readers
Trustpilot Rating
TrustPilot
4.6 Excellent
This site is a total game-changer. I've been flying through book summaries like never before. Highly, highly recommend.
— Dave G
Worth my money and time, and really well made. I've never seen this quality of summaries on other websites. Very helpful!
— Em
Highly recommended!! Fantastic service. Perfect for those that want a little more than a teaser but not all the intricate details of a full audio book.
— Greg M
Save 62%
Yearly
$119.88 $44.99/year/yr
$3.75/mo
Monthly
$9.99/mo
Start a 3-Day Free Trial
3 days free, then $44.99/year. Cancel anytime.
Unlock a world of fiction & nonfiction books
26,000+ books for the price of 2 books
Read any book in 10 minutes
Discover new books like Tinder
Request any book if it's not summarized
Read more books than anyone you know
#1 app for book lovers
Lifelike & immersive summaries
30-day money-back guarantee
Download summaries in EPUBs or PDFs
Cancel anytime in a few clicks

Why one summary?

Scanner
Find a barcode to scan

⭐
⭐
⭐
We have a special gift for you
Open
38% off
DISCOUNT FOR YOU
⭐
⭐
⭐
$79.99
$49.99/year
Only $4.16 per month
Continue
2 taps to start, super easy to cancel
Settings
General
Widget
Loading...