Author: admin
-
An Android Studio TableLayout and TableRow Tutorial
When the work began on the next chapter of this book (An Android Studio Room Database Tutorial), it was originally intended to include the steps to design the user interface layout for the Room database example application. It quickly became evident, however, that the best way to implement the user interface was to use the…
-
Using the Android Room Persistence Library
Included with the Android Architecture Components, the Room persistence library is designed to make it easier to add database storage support to Android apps in a way consistent with the Android architecture guidelines. With the basics of SQLite databases covered in the previous chapter, this chapter will explore the basic concepts behind Room-based database management,…
-
SQLite Databases in Android Studio
Mobile applications that do not need to store at least some persistent data are few and far between. The use of databases is an essential aspect of most applications, ranging from almost entirely data-driven applications to those that need to store small amounts of data, such as the prevailing game score. The importance of persistent…
-
An Android Studio SharedFlow Tutorial
The previous chapter introduced Kotlin flows and explored how these can be used to return multiple sequential values from within coroutine-based asynchronous code. This tutorial will look at a more detailed flow implementation, this time using SharedFlow within a ViewModel. The tutorial will also demonstrate how to ensure that flow collection responds correctly to an…
-
Kotlin Flow Guide
The earlier chapter, A Guide to Kotlin Coroutines taught us about Kotlin Coroutines and explained how they can perform multiple tasks concurrently without blocking the main thread. As we have seen, coroutine suspend functions are ideal for performing tasks that return a single result value. In this chapter, we will introduce Kotlin Flows and explore…
-
An Android Remote Bound Service Tutorial
In this final chapter dedicated to Android services, an example application will be developed to demonstrate the use of a messenger and handler configuration to facilitate interaction between a client and remote bound service of a messenger and handler configuration to facilitate interaction between a client and a remote bound service. Client to Remote Service…
-
Android Local Bound Service Tutorial
As outlined in the previous chapter, Bound services provide a mechanism for implementing communication between an Android service and one or more client components. This chapter builds on the overview of bound services provided in An Overview of Android Services before embarking on an example implementation of a local bound service. Understanding Bound Services Bound…
-
An Overview of Android Services
The Android Service class is designed to allow applications to initiate and perform background tasks. Unlike broadcast receivers, which are intended to perform a task quickly and then exit, services are designed to perform tasks that take a long time to complete (such as downloading a file over an internet connection or streaming music to…
-
A Kotlin Coroutines Tutorial
The previous chapter introduced the key concepts of performing asynchronous tasks within Android apps using Kotlin coroutines. This chapter will build on this knowledge to create an example app that launches thousands of coroutines at the touch of a button. Creating the Coroutine Example Application Select the New Project option from the welcome screen and,…
-
A Guide to Kotlin Coroutines
When an Android application is first started, the runtime system creates a single thread in which all components will run by default. This thread is generally referred to as the main thread. The primary role of the main thread is to handle the user interface in terms of event handling and interaction with views in…