Author: admin

  • A Java Android Jetpack Lifecycle Awareness Tutorial

    The previous chapter provided an overview of lifecycle awareness and outlined the key classes and interfaces that make this possible within an Android app project. This chapter will build on this knowledge base by building an Android Studio project to highlight lifecycle awareness in action. Creating the Example Lifecycle Project Select the New Project quick…

  • Working with Android Lifecycle-Aware Components in Java

    The earlier chapter, Android App and Activity Lifecycles described the use of lifecycle methods to track lifecycle state changes within a UI controller such as an activity or fragment. One of the main problems with these methods is that they place the burden of handling lifecycle changes onto the UI controller. On the surface, this…

  • Saving ViewModel Saved State in Java Tutorial

    The preservation and restoration of app state is about presenting the user with continuity in appearance and behavior after an app is placed in the background. Users expect to be able to switch from one app to another and, on returning to the original app, find it in the exact state it was in before…

  • Android Studio Jetpack Data Binding in Java

    In the chapter entitled “Modern Android App Architecture with Jetpack”, we introduced the concept of Android Data Binding. We explained how it is used to directly connect the views in a user interface layout to the methods and data located in other objects within an app without the need to write code. This chapter will…

  • An Android Studio Java LiveData Tutorial

    The previous chapter began building an app to conform to the recommended Jetpack architecture guidelines. These initial steps involved implementing the data model for the app user interface within a ViewModel instance. This chapter will further enhance the app design using the LiveData architecture component. Once LiveData support has been added to the project in…

  • An Android Studio Java ViewModel Tutorial

    The previous chapter introduced the fundamental concepts of Android Jetpack and outlined the basics of modern Android app architecture. Jetpack defines a set of recommendations describing how an Android app project should be structured while providing a set of libraries and components that make it easier to conform to these guidelines to develop reliable apps…

  • An Android Studio Java Fragment Example

    As outlined in the previous chapter, fragments provide a convenient mechanism for creating reusable modules of application functionality consisting of both sections of a user interface and the corresponding behavior. Once created, fragments can be embedded within activities. Having explored the general theory of fragments in the previous chapter, this chapter aims to create an…

  • An Introduction to Java Fragments in Android Studio

    As you progress through the chapters of this book, it will become increasingly evident that many of the design concepts behind the Android system were conceived to promote the reuse of and interaction between the different elements that make up an application. One such area that will be explored in this chapter involves using Fragments.…

  • An Android Studio Java Pinch Gesture Tutorial

    Before moving on from touch handling in general and gesture recognition in particular, the topic of this chapter is handling pinch gestures. While it is possible to create and detect a wide range of gestures using the steps outlined in the previous sections of this chapter, it is, in fact, not possible to detect a…

  • An Android Studio Java Custom Gesture Recognition Tutorial

    The previous chapter covered the detection of what is referred to as “common gestures” from within an Android application. In practice, however, a gesture can conceivably involve just about any sequence of touch motions on the display of an Android device. In recognition of this, the Android SDK allows custom gestures of just about any…