Coming Topics
- Doze Mode: https://developer.android.com/training/monitoring-device-state/doze-standby
- Retrofit vs Volley
- Dagger 2
- Creating Custom Annotations : https://blog.mindorks.com/creating-custom-annotations-in-android-a855c5b43ed9
Back up user data
Auto Backup for Apps automatically backs up a user’s data from apps that target and run on Android 6.0 (API level 23) or higher. Android preserves app data by uploading it to the user’s Google Drive, where it’s protected by the user’s Google Account credentials. The backup is end-to-end encrypted on devices running Android 9 or higher using the device’s PIN, pattern, or password. The amount of data is limited to 25 MB per user. There’s no charge for storing backup data.
Read More »Dependency injection with Hilt
Hilt is Jetpack’s recommended library for dependency injection in Android. Hilt defines a standard way to do DI in your application by providing containers for every Android class in your project and managing their lifecycles automatically for you.
Hilt is built on top of the popular DI library Dagger to benefit from the compile time correctness, runtime performance, scalability, and Android Studio support that Dagger provides.
Read More »WorkManager
WorkManager is the recommended solution for persistent work. Work is persistent when it remains scheduled through app restarts and system reboots. Because most background processing is best accomplished through persistent work, WorkManager is the primary recommended API for background processing.
Read More »Kotlin coroutines
A coroutine is a concurrency design pattern that you can use on Android to simplify code that executes asynchronously. Coroutines were added to Kotlin in version 1.3
On Android, coroutines help to manage long-running tasks that might otherwise block the main thread and cause your app to become unresponsive.
Lifecycles
Lifecycle-aware components perform actions in response to a change in the lifecycle status of another component, such as activities and fragments. These components help you produce better-organized, and often lighter-weight code, that is easier to maintain.
The androidx.lifecycle
package provides classes and interfaces that let you build lifecycle-aware components—which are components that can automatically adjust their behavior based on the current lifecycle state of an activity or fragment, which avoid memory leaks or even application crashes.
LiveData
LiveData
is an observable data holder class. Unlike a regular observable, LiveData is lifecycle-aware, meaning it respects the lifecycle of other app components, such as activities, fragments, or services. This awareness ensures LiveData only updates app component observers that are in an active lifecycle state.
ViewModel
The ViewModel
class is designed to store and manage UI-related data in a lifecycle conscious way. The ViewModel
class allows data to survive configuration changes such as screen rotations.
Navigation
Android Jetpack’s Navigation component helps you implement navigation, from simple button clicks to more complex patterns, such as app bars and the navigation drawer.
The Navigation component consists of three key parts that are described below:
- Navigation graph: An XML resource that contains all navigation-related information in one centralized location. This includes all of the individual content areas within your app, called destinations, as well as the possible paths that a user can take through your app.
NavHost
: An empty container that displays destinations from your navigation graph. The Navigation component contains a defaultNavHost
implementation,NavHostFragment
, that displays fragment destinations.NavController
: An object that manages app navigation within aNavHost
. TheNavController
orchestrates the swapping of destination content in theNavHost
as users move throughout your app.
Google Play In-App Review API
The Google Play In-App Review API lets you prompt users to submit Play Store ratings and reviews without the inconvenience of leaving your app or game.
Device requirements
In-app reviews only work on the following devices:
- Android devices (phones and tablets) running Android 5.0 (API level 21) or higher that have the Google Play Store installed.
- Chrome OS devices that have the Google Play Store installed.
App startup time
App launch can take place in one of three states, each affecting how long it takes for your app to become visible to the user: cold start, warm start, or hot start. In a cold start, your app starts from scratch. In the other states, the system needs to bring the running app from the background to the foreground. We recommend that you always optimize based on an assumption of a cold start. Doing so can improve the performance of warm and hot starts, as well.
To optimize your app for fast startup, it’s useful to understand what’s happening at the system and app levels, and how they interact, in each of these states.
Read More »