Category: Android Studio
-
An Android Studio Fragment Tutorial
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…
-
A Guide to Android Fragments
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.…
-
Android Custom Gesture and Pinch Recognition Tutorials
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…
-
An Android GestureDetectorCompat Class Tutorial
The term “gesture” defines a contiguous sequence of interactions between the touch screen and the user. A typical gesture begins at the point that the screen is first touched and ends when the last finger or pointing device leaves the display surface. When correctly harnessed, gestures can be implemented to communicate between the user and…
-
Android Touch and Multi-touch Event Handling
Most Android-based devices use a touch screen as the primary interface between the user and the device. The previous chapter introduced how a touch on the screen translates into an action within a running Android application. There is, however, much more to touch event handling than responding to a single finger tap on a view…
-
An Android Event Handling Tutorial
Much has been covered in the previous chapters relating to the design of user interfaces for Android applications. However, an area that has yet to be covered involves how a user’s interaction with the user interface triggers the underlying activity to perform a task. In other words, from the previous chapters, we know how to…
-
Using Apply Changes in Android Studio
Now that some of the basic concepts of Android development using Android Studio have been covered, this is a good time to introduce the Android Studio Apply Changes feature. As all experienced developers know, every second spent waiting for an app to compile and run is better spent writing and refining code. Introducing Apply Changes…
-
An Android ConstraintSet Tutorial
The previous chapter introduced the basic concepts of creating and modifying user interface layouts in Kotlin code using the ConstraintLayout and ConstraintSet classes. This chapter will put these concepts into practice by creating an example layout created entirely in Kotlin code and without using the Android Studio Layout Editor tool. Creating the Example Project in…
-
Android Constraint Sets
Until this point in the book, all user interface design tasks have been performed using the Android Studio Layout Editor tool, either in text or design mode. An alternative to writing XML resource files or using the Android Studio Layout Editor is to write Kotlin code to directly create, configure and manipulate the view objects…
-
Manual XML Layout Design in Android Studio
While the design of layouts using the Android Studio Layout Editor tool greatly improves productivity, it is still possible to create XML layouts by manually editing the underlying XML. This chapter will introduce the basics of the Android XML layout file format. Manually Creating an XML Layout The structure of an XML layout file is…