Share E-Book
Scan to open this page

Scan with your phone to open this page

Author: Antonio Leiva

Rating No ratings yet

Learn Kotlin the easy way while developing an Android App. Kotlin is the new official language to write Android Apps, and thanks to this book, you'll be writing code in no time. Straight to the point, practical and full of examples, it will show you the language while developing an Android App. Learn the Kotlin and start enjoying Android development again with this powerful and modern language.

AI Reading Assistant

Whole-book reading guide from stratified index samples; jump to passages in the text

AI guide
【One-Line Pitch】 A hands-on guide that teaches Kotlin by building a real Android weather app from scratch, ideal for Java-savvy Android developers who want to switch languages without wading through abstract theory. 【Book Arc】 - **Opening (~0%–10%)**: Sets up the case for Kotlin — its IntelliJ/JetBrains lineage, Java interoperability, and the headline wins (data classes, null safety) that make it attractive to Android developers. - **Early (~10%–30%)**: Environment and language fundamentals — installing Android Studio, configuring Gradle with the Kotlin plugin, then core syntax: functions, default parameters, variables, properties, and the first `MainActivity` rendering a `RecyclerView`. - **Early–Middle (~30%–45%)**: Networking and data modeling — performing HTTP requests off the main thread with Anko, parsing JSON via Gson, shaping a domain layer with `Command`, and using data classes, `copy`, and destructuring. - **Middle (~45%–65%)**: Collections and functional operations (aggregate, filter, map, order), lambdas and higher-order functions, plus visibility modifiers and constructors. - **Late (~65%–85%)**: Android-specific Kotlin tooling — Kotlin Android Extensions for synthetic view access, application singletons and delegated properties (including custom delegates). - **Ending (~85%–100%)**: Persistence — building an `SQLiteOpenHelper`, defining tables, dependency injection, and saving/requesting data through database model classes. 【Key Takeaways】 - **Kotlin is designed for Java developers migrating to Android** (Opening): The book leans on prior Java knowledge, contrasting verbose Java boilerplate (getters/setters, `toString`) with Kotlin's concise equivalents. - **Data classes and null safety are the flagship ergonomics** (Early): `data class` auto-generates accessors, `equals`, `hashCode`, and `toString`; the `?` safe-call operator replaces defensive null checks. - **Default parameters replace function overloading** (Early): Named parameters with default values let you write one function instead of several overloads. - **Properties unify field + getter + setter** (Early): Kotlin properties collapse the Java field/accessor pattern into a single declaration. - **Asynchrony needs care on Android** (Early–Middle): The book warns that `AsyncTask` is fragile (activity may be destroyed before `postExecute`) and presents Anko's `doAsync`/`uiThread` DSL as a cleaner alternative. - **Functional collection operations are first-class** (Middle): Aggregate, filter, map, element, generation, and ordering operations let you express data transformations declaratively. - **Lambdas and higher-order functions simplify callbacks** (Middle): The book shows converting verbose anonymous-class listeners into concise lambda-based code. - **Kotlin Android Extensions remove `findViewById` boilerplate** (Late): Synthetic imports let views be accessed as properties by their XML ids, for activities, fragments, and custom views. 【Reading Tips】 - **Deep-read the early language chapters** (functions, properties, data classes, null safety) — these are the foundation everything else builds on. - **Skim the Gradle/Android Studio setup** if you already have a working Android environment; return to it only if configuration breaks. - **Treat the app as a spine, not a reference**: follow the weather-app build in order, since later chapters (database, DI) assume earlier classes exist. - **Pause on the async and lambda chapters** — these are the conceptual jumps where Java habits most need unlearning. - **Use the linked GitHub branches** (referenced per chapter) to compare your code against the author's at each stage. 【Coverage Limits】 The excerpts cover the table of contents and scattered chapters across the full arc, but detailed prose for some middle and late chapters (e.g., specific collection operation internals, full database implementation) is thin. Claims about exact chapter content beyond what the excerpts show are inferred from headings.
Page 7
. . . . . . . . . . . . . . . 65 15.2 Refactoring our code . . . . . . . . . . . . . . . . . . . . . . . . . . 67 16 Application Singleton and Delegated Prop...
View in text
Excerpt 2
n the module build.gradle, where the configuration has also added a dependency to the Kotlin standard library. Go check it now: 1 apply plugin: 'com.android....
View in text
Excerpt 3
nother option is to wrap these classes. You could create an ImmutableDate class which wraps a Date and doesn’t allow to modify its state. It’s up to you to d...
View in text
Excerpt 4
of the function is another function, it can be brought out of the parentheses, so we can create a block of code where we can use this and the public properti...
View in text
Excerpt 5
uired to provide an implementation of the onCreate function. When no libraries are used, tables creation is done by writing a raw CREATE TABLE query where we...
View in text
Excerpt 6
odel, and inserts each daily forecast and the city forecast. The structure is similar to the previous one: it returns the value from the use function from th...
View in text
Excerpt 7
prepared to create the DetailActivity. In Android Studio 2.3 and below, you can select the packagewhere youwant to create the activity, right click and selec...
View in text
Excerpt 8
ult = RequestForecastCommand(94043).execute() 11 uiThread { 12 val adapter = ForecastListAdapter(result) { 13 startActivity<DetailActivity>(DetailActivity.ID...
View in text
Tags
AI categories
Programming LanguageGoMobile
Publisher: Leanpub
Publish Year: 2017
Language: English
Pages: 191
File Format: PDF
File Size: 1.1 MB
Text Preview (First 20 pages)
Registered users can read the full content for free

Register as a Gaohf Library member to read the complete e-book online for free and enjoy a better reading experience.

Generating text preview…