Posts

Pick an Image from the Gallery – Android Studio - Compose

Image
How to Pick an Image from the Gallery? In this tutorial, we will walk through the complete process of selecting an image from the device’s Gallery in an Android application. This feature is commonly used in many modern apps—for uploading profile pictures, choosing photos for posts, or attaching images to forms. We will start by creating a simple layout with a button that the user can tap to open the Gallery. Once the button is clicked, the system’s built-in image picker will appear, allowing the user to browse their photo library and select a single image. After the user chooses an image, we will retrieve its URI and display it inside an  ImageView  within our app. >> Check for Java >> Check for Kotlin >> Check for Compose Code: MainActivity.java package com.technifysoft.myapplication import android.net.Uri import android.os.Bundle import android.widget.Toast import androidx.activity.ComponentActivity import androidx.activity.compose.rememberLaunc...

Picture In Picture - Android Studio - Compose

Image
How to add Picture In Picture Mode in the Android app? Android 8.0 (API level 26) allows activities to launch in the picture-in-picture (PIP) mode. PIP is a special type of multi-window mode mostly used for video playback. It lets the user watch a video in a small window pinned to a corner of the screen while navigating between apps or browsing content on the main screen. The PIP window appears in the top layer of the screen in a corner chosen by the system. >> Check For Java >> Check For Kotlin >> Check For Compose Step 1: Create a new project   OR   Open your project Step 2: Create another activity named PIPActivity Step 3: Add the following properties to the PIPActivity in AndroidManifest <activity android:name= ".PIPActivity" android:configChanges= "screenSize|smallestScreenSize|screenLayout|orientation" android:launchMode= "singleTask" android:resizeableActivity= "true" ...

Pick Contact - Android Studio - Compose

Image
Implement the Contact Pick feature in and Android App To allow the user to pick a contact from the phone's contacts list, we can use contact intent. You will get all information of the contact e.g. Name, Phone Number(s), Address, Thumbnail, Email, etc. You can use get the specific information according to your requirement. To pick a contact we need to  READ_CONTACTS  permission. >>  Check for Java >> Check For Kotlin >> Check For Compose Code: Add permission in AndroidManifest.xml: <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android= "http://schemas.android.com/apk/res/android" package= "com.blogspot.atifsoftwares.pickcontact" > <!--Read contact permission--> <uses-permission android:name= "android.permission.READ_CONTACTS" /> <application android:allowBackup= "true" android:icon= "@mipmap/ic_launcher" andr...