You can divide your activity behavior and user interface into multiple components so that certain components in an activity can be reused and replaced with new components to create a flow of an activity or to perform a task. These components which are part of an activity are called Fragments.
There are many pitfalls when loading images in Android such as memory issues, slow image loading and unresponsive UI which can be handled with image loading library Glide.
Android supports sensors which provide the measurements of certain properties such as device motion, orientation and rotation, pressure, temperature, light, magnetic field, proximity and humidity.
If your app features use images from network, it is very important to download the images efficiently to provide good user experience for your app users.
In this post, you can learn how to provide a feature in your app that allows user to capture pictures using device camera and save them on the local storage or cloud storage.
Activity is the main android component which displays user interface, handles user events and provide behavior. Each screen of an app is associated with an activity. An activity can exist in different states and has life cycle. Android system calls callback methods of an activity depending on the state change.
A drawable resource represents a graphic file or xml drawable file that can be drawn on screen. In Android, these files are stored in res/drawable folder.
In Android, shape drawables can be defined in xml which can be used as resources in java code and xml to set image related attributes such as background, icon, etc of views. You can define rectangle, oval, ring, and line shape drawables in xml.
Using Android color state list, different colors can be applied to Android widgets depending on applicable states such as pressed, focused, selected, checkable, checked and enabled.
Every application contains code and resources. While code provides behavior of applications, resources are static which either provide configuration information to behavior or are displayed in UI. Examples of application resources are images, text values, xml, audio and video files, fonts, color definitions, menus, animation, and user interface layouts.
Since Android system supports multiple languages and allows user to choose language or locale, displaying your app content or resource based on the chosen locale allows users to view your app’s text content in user preferred language and to experience other content in a way that reflects the culture of the selected locale.
In this post, you can learn how to use data binding library to bind event handler and data model object properties to views in the item layout of RecyclerView.