![]() ![]() This activity contains the first screen that will be displayed when the app is run on a device. When we created the ComposeDemo project, Android Studio created a single initial activity for our app, named it MainActivity, and generated some code for it in the MainActivity.kt file. ![]() The application might also utilize a second activity consisting of multiple screens where new appointments may be entered by the user and existing appointments edited. An appointments application might, for example, contain an activity screen that displays appointments set up for the current day. An activity is a single, standalone module of application functionality that either correlates directly to a single user interface screen and its corresponding functionality, or acts as a container for a collection of related screens. ![]() Once completed, the user interface for the app will appear as shown in Figure 3-1:Īndroid applications are created by bringing together one or more elements known as Activities. When the slider is moved, the current value will be displayed on one of the text components, while the font size of the second text instance will adjust to match the current slider position. The completed project will consist of two text components and a slider. If anything is unclear when you have completed the project, rest assured that all of the areas covered in the tutorial will be explored in greater detail in later chapters of the book. In the next chapter, we will use this project to create a simple Android app.īoth chapters will briefly explain key features of Compose as they are introduced within the project. This chapter will create a new project using the Android Studio Compose project template and explore both the basic structure of a Compose-based Android Studio project and some of the key areas of Android Studio. The project will also serve to verify that your Android Studio environment is correctly installed and configured. Although this project will make use of several Compose features, it is an intentionally simple example intended to provide an early demonstration of Compose in action and an initial success on which to build as you work through the remainder of the book. Now that we have installed Android Studio, the next step is to create an Android app using Jetpack Compose. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |