Exploring google's new android APIs

Overview

Exploring New android APIs

1. New Splash Screen API in Android 12

Starting in Android 12, the launch animation for all apps when running on a device with Android 12 or higher. This includes an into-app motion at launch, a splash screen showing your app icon, and a transition to your app itself.

This experience brings standard design elements to every app launch, but it’s also customizable so your app can maintain its unique branding.

In addition to using the SplashScreen platform API, you can also use the SplashScreen compat library, which wraps the SplashScreen API.

Splash Screen animations and the launch sequence

Additional latency is often associated with launching an app on a cold start. Adding an animated icon to your splash screen has obvious aesthetic appeal and provides a more premium experience, plus there’s an additional benefit: user research shows that perceived startup time is less when viewing an animation.

A splash screen animation is embedded within the following launch sequence components.

Enter animation: This consists of the system view to the splash screen. This is controlled by the system and is not customizable.

Splash screen: The splash screen can be customized, allowing you to supply your own logo animation and branding. It must meet the requirements described in this document to work properly.

Exit animation: This consists of the animation run that hides the splash screen. If you want to customize it, you'll have access to the SplashScreenView and its icon and can run any animation on them, with settings for transform, opacity, and color. In that case, the splash screen needs to be manually removed when the animation is done.

When running the icon animation, app launch gives you the option to skip the sequence in cases where the app is ready earlier. Either the app triggers onResume() or the splash screen times out automatically so make sure the motion can be comfortably skipped. The splash screen should only be dismissed with onResume() when the app is stable from a visual standpoint, so no additional spinners needed. Introducing an incomplete interface can be jarring for users and may give an impression of unpredictability or lack of polish.

For detailed info visit official doc - https://developer.android.com/develop/ui/views/launch/splash-screen

2. Notification Runtime Permission in Android 13

Android 13 (API level 33) and higher supports a runtime permission for sending non-exempt (including Foreground Services (FGS)) notifications from an app: POST_NOTIFICATIONS. This change helps users focus on the notifications that are most important to them.

If you continue to target 12L (API level 32) or lower, you lose some flexibility with requesting the permission in the context of your app's functionality.

Declare the Permission

The permission that you need to declare in your app's manifest file appears in the following code snippet:

<manifest ...>
    <uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>
    <application ...>
        ...
    </application>
</manifest>

App capabilities depend on user choice in permissions dialog

In this dialog, users have the following actions available to them:

Select allow Select don't allow Swipe away from the dialog, without pressing either button The following sections describe how your app behaves, based on which action the user takes.

User selects "Allow" If the user selects the allow option, your app can do the following:

  1. Send notifications. All notification channels are allowed.
  2. Post notifications related to foreground services. These notifications appear in the notification drawer.

User selects "Don't allow" If the user selects the don't allow option, your app can't send notifications unless it qualifies for an exemption. All notification channels are blocked, except for a few specific roles. This is similar to the behavior that occurs when the user manually turns off all notifications for your app in system settings.

🛑 Caution: If your app targets 12L or lower and the user taps Don't allow, even just once, they aren't prompted again until one of the following occurs: The user uninstalls and reinstalls your app. You update your app to target Android 13 or higher.

User swipes away from dialog If the user swipes away from the dialog—that is, they don't select either allow or don't allow—the state of the notification permission doesn't change.

Click here to know effects of this runtime notification on apps - https://developer.android.com/develop/ui/views/notifications/notification-permission

3. Jetpack Compose Permissions

A library which provides Android runtime permissions support for Jetpack Compose.

Warning

The permission APIs are currently experimental and they could change at any time. All of the APIs are marked with the @ExperimentalPermissionsApi annotation.

Usage rememberPermissionState and rememberMultiplePermissionsState APIs The rememberPermissionState(permission: String) API allows you to request a certain permission to the user and check for the status of the permission. rememberMultiplePermissionsState(permissions: List<String>) offers the same but for multiple permissions at the same time.

Both APIs expose properties for you to follow the workflow as described in the permissions documentation.

🛑 Caution: The call to the method that requests the permission to the user (e.g. PermissionState.launchPermissionRequest()) needs to be invoked from a non-composable scope. For example, from a side-effect or from a non-composable callback such as a Button's onClick lambda.

Visit here for more info - https://google.github.io/accompanist/permissions/

You might also like...
Template to accelerate the creation of new apps using Spring Boot 3, MongoDB & GraphQL.

Template to accelerate the creation of new apps using Spring Boot 3, MongoDB & GraphQL.

HelloKMM - Hello World in Kotlin Multiplatform Mobile (new empty project)
HelloKMM - Hello World in Kotlin Multiplatform Mobile (new empty project)

Hello KMM! Hello World in Kotlin Multiplatform Mobile (new empty project) Gettin

An e-commerce app which provide a new platform to order food items from various restaurants
An e-commerce app which provide a new platform to order food items from various restaurants

Food_App_Internshala An e-commerce app which provide a new platform to order food items from various restaurants. Splash and Login Page Opening of the

New Relic Kotlin Instrumentation for Kotlin Coroutine. It successfully handles thread changes in suspend states.

new-relic-kotlin-coroutine New Relic Kotlin Instrumentation for Kotlin Coroutine. It successfully handles thread changes in suspend states. Usage 1- U

Checks for app updates and automatically updates the current app if the new one in local storage have a different version

Silent Android App Update Sample This sample shows how to update Android app silently without user confirmation with a device owner app. It works on A

AndroidIDE - an IDE for Android to develop full featured Android apps on Android smartphones.
AndroidIDE - an IDE for Android to develop full featured Android apps on Android smartphones.

AndroidIDE - an IDE for Android to develop full featured Android apps on Android smartphones.

Aggregated Android news, articles, podcasts and conferences about Android Development
Aggregated Android news, articles, podcasts and conferences about Android Development

DroidFeed Curated news feed for Android Developers! Stay up to date with the latest Android Development news. Built for the Android developer communit

 🍲Foodium is a sample food blog Android application 📱 built to demonstrate the use of Modern Android development tools - (Kotlin, Coroutines, Flow, Dagger 2/Hilt, Architecture Components, MVVM, Room, Retrofit, Moshi, Material Components).
Comments
  • .

    .

    • Changed compose compiler version to version suitable for kotlin 1.7.10. Here is the compatibility map, (otherwise the build was failing)
    • Added code highlighting for xml in README.md
    • Callback in ShowNotification were missing braces

    (Suggestions no one asked for lol. You must've already covered them up. )

    opened by tejas-jadhav 0
Owner
Prachi
Android Developer @bigbusiness-app | Software Engineer Intern @Codemonk
Prachi
In this Repo i create public apis to serve apps, like muslim apps using Spring, kotlin, and microservices

spring-freelance-apis-kotlin In this Repo i create public apis to serve apps, like muslim apps using Spring, kotlin, and microservices This repo for l

null 6 Feb 13, 2022
Service exposes sensitive administration APIs to initialize and set lower level of Slurpanize infrastructure

slurpanize-baker Project This project uses Quarkus, the Supersonic Subatomic Java Framework. If you want to learn more about Quarkus, please visit its

Slurpanize by Tetracube RED 0 Nov 25, 2021
Xoxo is a simple wrapper around org.w3c.dom to parse XML using nice Kotlin APIs

Xoxo ?? Xoxo is a simple wrapper around org.w3c.dom to parse XML using nice Kotlin APIs. No more NodeList, .item(), etc... just use .children, .filter

Martin Bonnin 51 Sep 1, 2022
🃏 Multimodular Android MVVM Template I use whenever I start a new Android Project.

Android architecture starter template This template is compatible with the latest stable version of Android Studio. Features Room Database Hilt ViewMo

Klejvi Kapaj 4 Dec 27, 2022
New style for app design Online Sunglasses Shop App UI made in Jetpack Compose.😉😎

JetSunglassUI-Android New style for app design Online Sunglasses Shop App UI made in Jetpack Compose. ?? ?? (Navigation Components, Dagger-Hilt, Mater

Arvind Meshram 18 Dec 12, 2022
This is our new version of chatkit

ChatKitV4 (This read me is under develop) This is our new version of chatkit. Here we seprate Core Logic and UI sections. You can use it as seprate mo

Hamidreza amz 0 Jan 4, 2022
CodeLab for the workshop: A Composable New World

A Composable New World! Compose is here! ?? I've created a codelab where you can follow step by step the development of android application using Comp

Carlos Mota 9 Nov 25, 2022
Kotlin Tutorials for new learners.

Kotlin Programming Tutorial for Beginners Learn Kotlin Programming, its basics and Fundamentals from scratch. Topics to be covered Overview Course int

INTELLISOFT 8 Apr 21, 2022
A sandbox where I will experiment with new techniques, concepts, and technologies.

A sandbox where I will experiment with new techniques, concepts, and technologies. Here you will find some DDD, CQRS, Clean Architecture, Event-Driven Architecture, Serverless, Microservices, RabbitMQ, gRPC, SOLID, Design Patterns, and more.

Jefferson Didi Silva 6 Nov 15, 2022
Aagent-new-service-parent - A Springboot Rest Webservice Project that can be deployed to a Docker container

Webservice in a Docker Container A Springboot Rest Webservice Project that can b

ReeceRiley-aa 0 Jan 4, 2022