Book Image

Android Studio 4.1 Development Essentials – Java Edition

By : Neil Smyth
Book Image

Android Studio 4.1 Development Essentials – Java Edition

By: Neil Smyth

Overview of this book

For developers, Android 11 has a ton of new capabilities. The goal of this book is to teach the skills necessary to develop Android-based applications using the Java programming language. This book begins with the steps necessary to set up an Android development and testing environment. An overview of Android Studio along with the architecture of Android is covered next, followed by an in-depth look at the design of Android applications and user interfaces using the Android Studio environment. You will also learn about the Android architecture components along with some advanced topics such as touch screen handling, gesture recognition, the recording and playback of audio, app links, dynamic delivery, the AndroidStudio profiler, Gradle build configuration, and submitting apps to the Google Play Developer Console. The concepts of material design, including the use of floating action buttons, Snackbars, tabbed interfaces, card views, navigation drawers, and collapsing toolbars are a highlight of this book. This edition of the book also covers printing, transitions, and cloud-based file storage; the foldable device support is the cherry on the cake. By the end of this course, you will be able to develop Android 11 Apps using Android Studio 4.1, Java, and Android Jetpack. The code files for the book can be found here: https://www.ebookfrenzy.com/retail/androidstudio41/index.php
Table of Contents (88 chapters)
88
Index

62.4 Creating the Second Activity

For the purposes of this example, the app will contain a second activity which will be launched by the user from within the notification. Add this new activity to the project by right-clicking on the com.ebookfrenzy.notifydemo package name located in app -> java and select the New -> Activity -> Empty Activity menu option to display the New Android Activity dialog.

Enter ResultActivity into the Activity Name field and name the layout file activity_result. Since this activity will not be started when the application is launched (it will instead be launched via an intent from within the notification), it is important to make sure that the Launcher Activity option is disabled before clicking on the Finish button.

Open the layout for the second activity (app -> res -> layout -> activity_result.xml) and drag and drop a TextView widget so that it is positioned in the center of the layout. Edit the text of the TextView so that it reads...