More and more authors write books for learning Kotlin in different languages. We are very thankful to all of them and appreciate all their efforts in helping us increase a number of professional Kotlin developers.
Here are just a few books we’ve reviewed and recommend you for learning Kotlin. You can find more books on our community website.
Atomic Kotlin is for both beginning and experienced programmers!
From Bruce Eckel, author of the multi-award-winning Thinking in C++ and Thinking in Java, and Svetlana Isakova, Kotlin Developer Advocate at JetBrains, comes a book that breaks the language concepts into small, easy-to-digest “atoms”, along with a free course consisting of exercises supported by hints and solutions directly inside IntelliJ IDEA!
Head First Kotlin is a complete introduction to coding in Kotlin. This hands-on book helps you learn the Kotlin language with a unique method that goes beyond syntax and how-to manuals and teaches you how to think like a great Kotlin developer.
You’ll learn everything from language fundamentals to collections, generics, lambdas, and higher-order functions. Along the way, you’ll get to play with both object-oriented and functional programming.
If you want to really understand Kotlin, this is the book for you.
Kotlin in Action teaches you to use the Kotlin language for production-quality applications. Written for experienced Java developers, this example-rich book goes further than most language books, covering interesting topics like building DSLs with natural language syntax.
The book is written by Dmitry Jemerov and Svetlana Isakova, developers on the Kotlin team.
Chapter 6, covering the Kotlin type system, and chapter 11, covering DSLs, are available as a free preview on the publisher web site.
In this book you will learn to work effectively with the Kotlin language through carefully considered examples designed to teach you Kotlin’s elegant style and features.
Starting from first principles, you will work your way to advanced usage of Kotlin, empowering you to create programs that are more reliable with less code.
Programming Kotlin is written by Venkat Subramaniam.
Programmers don’t just use Kotlin, they love it. Even Google has adopted it as a first-class language for Android development.
With Kotlin, you can intermix imperative, functional, and object-oriented styles of programming and benefit from the approach that’s most suitable for the problem at hand.
Learn to use the many features of this highly concise, fluent, elegant, and expressive statically typed language with easy-to-understand examples.
Learn to write maintainable, high-performing JVM and Android applications, create DSLs, program asynchronously, and much more.
The Joy of Kotlin teaches you the right way to code in Kotlin.
In this insight-rich book, you’ll master the Kotlin language while exploring coding techniques that will make you a better developer no matter what language you use. Kotlin natively supports a functional style of programming, so seasoned author Pierre-Yves Saumont begins by reviewing the FP principles of immutability, referential transparency, and the separation between functions and effects.
Then, you’ll move deeper into using Kotlin in the real world, as you learn to handle errors and data properly, encapsulate shared state mutations, and work with laziness.
This book will change the way you code — and give you back some of the joy you had when you first started.
Источник
Android kotlin book pdf
Physics.Math.Code запись закреплена
Head First. Kotlin [2020] Гриффитс Дэвид, Гриффитс Дон
Вот и настало время изучить Kotlin. В этом вам поможет уникальная методика Head First, выходящая за рамки синтаксиса и инструкций по решению конкретных задач. Хотите мыслить, как выдающиеся разработчики Kotlin? Эта книга даст вам все необходимое — от азов языка до продвинутых методов. А еще вы сможете попрактиковаться в объектно-ориентированном и функциональном программировании. Если вы действительно хотите понять, как устроен Kotlin, то эта книга для вас!
Почему эта книга не похожа на другие?
Подход Head First основан на новейших исследованиях в области когнитивистики и теории обучения. Визуальный формат позволяет вовлечь в обучение мозг читателя лучше, чем длинный текст, который вгоняет в сон. Зачем тратить время на борьбу с новыми концепциями? Head First задействует разные каналы получения информации и разрабатывался с учетом особенностей работы вашего мозга.
«Четко, доступно, просто для понимания. Если вы только осваиваете Kotlin, эта книга станет отличным вводным пособием». — Кен Коусен (Ken Kousen) Сертифицированный преподаватель Kotlin
«Head First Kotlin поможет вам быстро проникнуть в суть дела, заложить надежный фундамент и (снова) получать удовольствие от написания кода». — Инго Кроцки (Ingo Krotzky), изучающий Kotlin
«Наконец-то! Kotlin для тех, кто не знает Java. Просто, лаконично и занимательно. Я давно ждал появления такой книги». — Доктор Мэтт Венэм (Dr. Matt Wenham), специалист по data science и программист Python
Источник
Kotlin for Android Developers
Short Description
Descripción: Kotlin for android developers.
Description
Kotlin for Android Developers Learn Kotlin the easy way while developing an Android App Antonio Leiva This book is for sale at http://leanpub.com/kotlin-for-android-developers This version was published on 2017-06-02
Tweet This Book! Please help Antonio Leiva by spreading the word about this book on Twitter! The suggested hashtag for this book is #kotlinandroiddev. Find out what other people are saying about the book by clicking on this link to search for this hashtag on Twitter: https://twitter.com/search?q=#kotlinandroiddev
This book is dedicated to all the loyal readers of antonioleiva.com, who made me believe that writing about Android development was a powerful tool to help others learn about it. I felt this book as a necessary step forward. I also want to do a special mention to Luis Herrero Jiménez, who has designed the awesome cover of this book, and to Gautier Mechling for helping me so much by reviewing this book. It’s thanks to him that this pages are not full of typos and mistakes. And, of course, this is specially dedicated to you. With your support and your help this book is growing, and I hope it will become a reference. So any claim or suggestion you think it will improve the quality of this book will be welcomed. Feel free to write anytime to [email protected]
Contents I. About this book . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . What is “Kotlin for Android Developers” about . . . . . . . . . . . . . .
3 Creating a new project . . . . . . . . . . . . 3.1 Create a new project in Android Studio 3.2 Convert MainActivity to Kotlin code . . 3.3 Configure Kotlin in project . . . . . . . 3.4 Include some other useful configuration 3.4 Test that everything works . . . . . . .
13 13 14 14 15 17
4 Classes and functions . . . . . . . . . . . . 4.1 How to declare a class . . . . . . . . . 4.2 Class inheritance . . . . . . . . . . . . 4.3 Functions . . . . . . . . . . . . . . . . 4.4 Constructor and functions parameters
27 A first walk into coroutines . . . . . . . . 27.1 Understanding how coroutines work 27.2 Using Anko for coroutines . . . . . . 27.3 Using coroutines in our example . . .
I. About this book Hey! Thanks so much for your interest on this book, I’m really glad you decided to become a Kotlin for Android expert. Many things have happened since I started writing “Kotlin for Android Developers” in mid-2015. At that point, Kotlin was still in an early access edition. But I felt so much power in the language, that I decided to explain all what I was learning in a book. Since then, the language has kept growing to the point that Google announced that they would start supporting Kotlin as an official language to develop Android Apps. These were amazing news. But it was even more amazing that both Google and Jetbrains suggested this book to Android developers that want to learn the language. As you may know, this is a lean publication. This means that the book grew and progressed thanks to the readers comments. So I can only thank you for helping me bring this dream to life.
What is “Kotlin for Android Developers” about In this book, I’ll be creating an Android app from ground up using Kotlin as the main language. The idea is to learn the language by example, instead of following a regular reference book structure. I’ll be stopping to explain the most interesting concepts and ideas about Kotlin, comparing them to Java 6. This way, you can see what the differences are and which parts of the language will help you speed up your work. This book is not meant to be a language reference, but a tool for Android developers to learn Kotlin and be able to continue with their own projects by themselves. I’ll be solving many of the most recurring problems we have to face in our daily lives as App developers, by making use of Kotlin expressiveness and some other really
I. About this book
interesting tools and libraries. However, this text covers most Kotlin features, so by the end of the reading you will have a deep knowledge about the language. The content is very practical, so I recommend you to follow the examples and the code in front of a computer and try everything it’s suggested. You could, however, take a first read to get a broad idea and then dive into practice. Even though this book now finished, I will review it from time to time to keep it up to date with new Kotlin versions. So feel free to write and tell me what you think about the book, or what could be improved. I want this book to be the perfect tool for Android developers, and as such, help and ideas will be welcomed. If you are reading a printed copy and want to receive the latest updates, please feel free to write me back to [email protected] with a proof of purchase, and I’ll give you access to the digital copy. That way, you’ll keep receiving the updates. Thanks for becoming part of this exciting project!
II. Is this book for you? This book is written to be useful to Android developers who are interested in learning Kotlin language. This book is for you if you are in some of the following situations: • You have some basic knowledge about Android Development and the Android SDK, as well as Java language. • You want to learn how to develop Android apps using Kotlin by following an example. • You need a guide on how to solve many of the common challenges Android developers find every day, by using a cleaner and more expressive language. On the other hand, this book may not be for you. This is what you won’t find in it: • This is not a Kotlin Bible. I’ll explain all language basics, and even more complex ideas when they come out during the process, just when we need them. So you will learn by example and not the other way round. • I will not explain how to develop an Android app. You won’t need a deep understanding of the platform, but at least some basics, such as some knowledge of Android Studio, Gradle, Java programming and Android SDK. You may even learn some new Android things in the process! • This is not a guide to learn functional programming. Of course, I’ll explain what you need, as Java 6 is not functional at all, but I won’t dive deep into functional topics.
III. About the author Antonio Leiva is an Android Engineer who spends time learning about new ways to get the most out of Android and then writes about it. He writes a blog at antonioleiva.com¹, focused in helping other Android developers learn Kotlin. He also leads intensive live workshops, where all the information from this book is put into practice. In 10 hours, people steps from no Kotlin knowledge to being able to create their own Apps from scratch. Antonio started as a consultant in CRM technologies, but after some time, looking for his real passion, he discovered the Android world. After getting some experience on such an awesome platform, he started a new adventure at a mobile company, where he led several projects for important Spanish companies. He now works as an Android Engineer at Plex², where he also plays an important role in the design and UX of the Android applications. You can find Antonio on Twitter as @lime_cl³ or Google+ as +AntonioLeivaGordillo⁴. ¹http://antonioleiva.com ²http://plex.tv ³https://twitter.com/lime_cl ⁴http://plus.google.com/+AntonioLeivaGordillo‘
1 Introduction Things are changing for good for Android Developers. The Android team announced during Google I/O 2017 that Kotlin is now an official language to develop Android Apps. This means that, while it’s still possible to develop Android Apps using Java, from now on Kotlin is fully supported and Google will make sure that all new Android features, the framework, the IDE and all their libraries work seamlessly with the new language. Google listened to the community, who was asking for years that Kotlin became a first-party language. So you can now take advantage from all the features of a modern language while developing Android. Throughout this book I’ll show you how, so I hope that I can help you understand the various ways how Kotlin can take you one step ahead and make your code much better. But before diving into the features of the language, let me tell you just a little bit of background.
1.1 What is Kotlin? Kotlin is a JVM based language developed by JetBrains⁵, a company known for creating IntelliJ IDEA, a powerful IDE for Java development. Android Studio, the official Android IDE, is based on IntelliJ. Kotlin was created with Java developers in mind, and with IntelliJ as its main development IDE. And these are two very interesting features for Android developers: • Kotlin is very intuitive and easy to learn for Java developers. Most parts of the language are very similar to what we already know, and the differences in basic concepts can be learnt in no time. ⁵https://www.jetbrains.com/
• We have total integration with our daily IDE for free. Android Studio can understand, compile and run Kotlin code. And the support for this language comes from the company who develops the IDE, so we Android developers are first-class citizens. But this is only related to how the language integrates with our tools. What are the advantages of the language when compared to Java 6? • It’s more expressive: this is one of its most important qualities. You can write more with much less code. • It’s safer: Kotlin is null safe, which means that we deal with possible null situations in compile time, to prevent execution time exceptions. We need to explicitly specify that an object can be null, and then check its nullity before using it. You will save a lot of time debugging null pointer exceptions and fixing nullity bugs. • It’s functional: Kotlin is basically an object oriented language, not a pure functional language. However, as many other modern languages, it uses many concepts from functional programming, such as lambda expressions, to solve some problems in a much easier way. Another nice feature is the way it deals with collections. • It makes use of extension functions: This means we can extend any class with new features even if we don’t have access to the source code. • It’s highly interoperable: You can continue using most libraries and code written in Java, because the interoperability between both languages is excellent. It’s even possible to create mixed projects, with both Kotlin and Java files coexisting.
1.2 What do we get with Kotlin? Without diving too deep into Kotlin language (we’ll learn everything about it throughout this book), these are some interesting features we miss in Java:
Expressiveness With Kotlin, it’s much easier to avoid boilerplate because the most common patterns are covered by default in the language. For instance, in Java, if we want to create a data class, we’ll need to write (or at least generate) this code: 1 2 3 4 5