Skip to main content

2022 | Buch

The First Line of Code

Android Programming with Kotlin

insite
SUCHEN

Über dieses Buch

The First Line of Code is a must-have for developers who want to learn Android and Kotlin, and the best-seller in China. Knowledge between Android and Kotlin is interspersed in a way that readers are easy to understand and get start:

· Android part covers all the important aspects of the Android platform, such as activity, service, content provider, broadcast receiver, fragment, basic UI, data storage, network, Jetpack and other application-level knowledge.

· Kotlin part covers various aspects of Kotlin, such as standard grammar, common skills, higher-order functions, generics, coroutines, DSL and other language-level knowledge.

In addition, The First Line of Code is a very practicing book, illustrating concepts with a complete weather forecast program. You can use and practice all the knowledge comprehensively after learning and see the actual result for what you have learned through the book.

All contents of the book are quite easy to understand. It might be a good choice for both beginners and experienced developers. Also suitable for college students, college teachers, etc.

Inhaltsverzeichnis

Frontmatter
Chapter 1. Your First Line of Android Code
Abstract
Welcome to the Android World! Android is by now the most popular mobile operating system (OS) in the world, and you can find Android phones wherever you go. But do you know how did Android has become the world’s No. 1 mobile OS? Let us take a look at the history of Android.
Lin Guo
Chapter 2. Explore New Language: A Quick Introduction to Kotlin
Abstract
In the first 9 years after Android’s birth, Java was the only language used to develop Android applications. Although Google introduced NDK in Android 1.5 to support the development of Android applications using C and C++, it never challenged the dominant role of Java.
Lin Guo
Chapter 3. Start with the Visible: Explore Activity
Abstract
In Chap. 1, you’ve already learned how to create the first Android project. Apparently, that is not enough and it’s time to learn something more advanced. Where should we begin? Imagine that you’ve already created a high-quality app and want to introduce it to your very first user, where should you begin? Of course, you will start with the user interface! This is because users don’t care about the algorithms, system design. They are only interested in what they see, so let’s begin with what’s visible.
Lin Guo
Chapter 4. Everything About UI Development
Abstract
It is natural for mobile engineers to focus on how to implement the functionality of the app when they use an app. However, users will just focus on the UI and functionality of the app instead of the implementation. While it is not our duty to come up with beautiful designs, we can use the rich UI tools provided by Android to build beautiful UIs.
Lin Guo
Chapter 5. Support Phones and Tablets with Fragment
Abstract
The number of mobile devices is increasing at a great speed in today’s world. Mobile phones are essential to people’s daily lives and tablets are becoming more and more popular. The biggest difference between phones and tablets is the size: phone screen sizes are between 3 and 6 in.; tablet screen sizes are between 7 and 10 in. The difference in size will make the same UI looks different. For instance, some designs may look beautiful in phones but may look distorted in tablets as certain UI components will grow disproportionately or too much space between the UI components.
Lin Guo
Chapter 6. Broadcasts in Details
Abstract
Back to my school days, each classroom would have a speaker that was connected to the broadcast control room, and whenever there was something important to announce, there would be a broadcast to notify everyone in the school. The same mechanism is widely used in computer science. If you’re familiar with computer networking and communication, you should know that in IP address, the highest number is used for broadcast address. For instance, if a network’s IP range is among 192.168.0.XXX, the subnet mask is 255.255.255.0, then the broadcast address for this network is 192.168.0.255. The broadcast packet will be sent to all the end points of the same network, then all the host machines in this network will receive this broadcast.
Lin Guo
Chapter 7. Data Persistence
Abstract
When we interact with an app, we are actually interacting with the data behind the scene. For instance, when we use Messenger, NewsBreak, and Twitter, we are interacting with corresponding content which is the data in the app. Without data, apps are useless. Then where does the data come from? Most of the data are generated by users these days; for example, sending tweets and commenting news. When they are doing all of these behaviors, they are generating data.
Lin Guo
Chapter 8. Share Data Between Apps with ContentProvider
Abstract
In the last chapter, we discussed Android data persistence which includes file, SharedPreferences, and database. You probably notice that all the data mentioned before is only accessible within the app. Although file and SharedPreferences used to provide MODE_WORLD_READABLE and MODE_WORLD_WRITABLE to allow other apps to access data, they got deprecated in Android 4.2. Android introduced safer ContentProvider to replace them.
Lin Guo
Chapter 9. Enrich Your App with Multimedia
Abstract
Phones used to be the device that can only be used to make phone calls and send text messages. Now, phones are playing a more and more important role in our daily lives, and we can have all kinds of entertainment through a mobile phone: we can listen to music during the boring commute; we can watch movies during the trip; we can shoot photos whereever we go.
Lin Guo
Chapter 10. Work on the Background Service
Abstract
Back to the college days, iPhone was a luxury device and only few could afford, Android was not even born yet, and Nokia dominated the world market of mobile phones. At that time, I used to enjoy Nokia’s Symbian OS because it supported background task which a lot of other phones did not support. I could make phone calls or listen to music keeping QQ live on the background, how cool was it! I also used to naively think that smart phones are those that support background tasks.
Lin Guo
Chapter 11. Exploring New World with Network Technologies
Abstract
If you cannot connect to the internet while playing with the phone, you will feel bored in a short time. Indeed, twenty-first century is the century of the internet, and nowadays, almost all the PCs, phones, tablets, and TVs are capable of connecting to the internet.
Lin Guo
Chapter 12. Best UI Experience: Material Design in Action
Abstract
For a long time, Android UI was widely seen as not beautiful or at least not as good as iOS UI. This makes some companies enforce unified UI for Android and iOS which does not make sense to me. Because for the same user, it is unlikely that they will use the same app on different OS but surely that they use different apps in the same OS. Thus having same style across different apps in the same OS is more important than unifying the style of the same app in different OS.
Lin Guo
Chapter 13. High-Quality Developing Components: Exploring Jetpack
Abstract
Up to now, you should be able to build Android App independently. However, there is a huge gap between making an app and an app that has quality codebase and good architecture.
Lin Guo
Chapter 14. Keep Stepping Up: More Skills You Need to Know
Abstract
Toward the end of the book, we’ve covered enough fundamental topics, and it is time to discuss some more advanced techniques.
Lin Guo
Chapter 15. Real Project Practice: Creating a Weather App
Abstract
In this chapter we will build a functional weather app to test what we have learned. Let us name it SunnyWeather and begin the work.
Lin Guo
Metadaten
Titel
The First Line of Code
verfasst von
Lin Guo
Copyright-Jahr
2022
Verlag
Springer Nature Singapore
Electronic ISBN
978-981-19-1800-1
Print ISBN
978-981-19-1799-8
DOI
https://doi.org/10.1007/978-981-19-1800-1