Posts

Face Detection - Google ML - Android Studio - Compose

Image
Detect Face using Google/Firebase ML Kit  In this tutorial, we will detect the face(s) from an image. We will use to get the Bitmap from an image in the drawable folder, but we will also show how you may also get the Bitmap from Uri, ImageView, etc.  Using the ML Kit Face Detection API, you can easily identify the key facial features & get the contours of detected faces. Note that the API only detects the faces; it doesn’t recognize the people. With the ML Kit Face Detection API, you can easily get the information you need to perform tasks like embellishing selfies & portraits or generating avatar(s) from the user's photo. Since the ML Kit Face Detection API can perform Face Detection in real-time, you can use it in applications like video chat or games that respond to the player's expressions. We will use the Android Studio IDE and the Kotlin language with the Jetpack Compose. >> Check For Java >> Check For Kotlin >> Check For Compose Code: build.gra...

Get Result From Other Activity - Android Studio - Compose

Image
How To Get Result From Another Activity Using the registerForActivityResult? In this tutorial, we will learn how to retrieve results from another activity using registerForActivityResult. You may be aware of using the method startActivityForResult, which is now deprecated. So we will use the newer way, which is registerForActivityResult. We will create 2 Activities: the MainActivity and the FormActivity. From the MainActivity, we will launch the FormActivity to input some data and get that data back as a result to the MainActivity. >> Check For Java >> Check For Kotlin >> Check For Compose Code: MainActivity.kt package com.technifysoft.myapplication import android.app.Activity import android.content.Intent import android.os.Bundle import android.widget.Toast import androidx.activity.ComponentActivity import androidx.activity.compose.rememberLauncherForActivityResult import androidx.activity.compose.setContent import androidx.activity.result.contr...

Permission Handling - Android Studio - Compose

Image
How to handle single & multiple runtime permissions As we know we need to request Runtime Permissions on Android 6.0 (API level 23 also known as Marshmallow) and above as well as to declare them in the AndroidManifest file.  If we need to use some features like Camera, Location, Contact, etc. we have to handle the runtime permissions. In this Tutorial, we will learn how to Request Single and Multiple Permissions. Note: I'll add some permissions for example purposes only you may apply the same on permissions you want. >> Check For Java >> Check For Kotlin >> Check For Compose Code AndroidManfiest.xml <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android= "http://schemas.android.com/apk/res/android" xmlns:tools= "http://schemas.android.com/tools" > <!--For Single Permission Example--> <uses-permission android:name= "android.permission.ACCESS_FINE_LOCATION" /> ...