Android Developers
1.3K subscribers
166 photos
5 videos
58 files
59 links
Here you can get android app development tutorials for free

LinkTree
https://linktr.ee/androiddeveloperspage

For comments & feedback
@androiddevstutorialscommentbot
Download Telegram
How To Resize Image Using OpenCV

To Resize Image Using OpenCV Follow The Following Steps.

Step1. In The View Area Add ImageView Or Any Other Image Displaying View.

Step2. Make Sure You Select OpenCV Android SDK In The Library Manager.

Step3. In The Custom Imports Add The Following Classes From OpenCV.

import org.opencv.core.Mat;
import org.opencv.core.Size;
import org.opencv.android.Utils;
import android.graphics.Bitmap;
import org.opencv.imgproc.Imgproc;
import org.opencv.imgcodecs.Imgcodecs;
import android.graphics.drawable.BitmapDrawable;

Step4. Load OpenCV C++ Binary Using The Following Code.

}
static {
System.loadLibrary("opencv_java4");
}
{

Step5. In Any Event You Want(OnCreate, OnButton Click Or Any Other Event) Where You Want To Resize The Image Use This Code. Read Comment's For Better Understanding.

//Get Bitmap From ImageView Called imageview1

Bitmap bitmap = ((BitmapDrawable) imageview1.getDrawable()).getBitmap();

//Initialize Mat Object For The Bitmap

Mat mat = new Mat();

//Convert The Bitmap From imageview1 To OpenCV Mat Object.

Utils.bitmapToMat(bitmap, mat);

//Initialize Mat Object For The Resized Image

Mat resizedmat = new Mat();

//Resize The Image From Mat Object With New Width 512 & Height 512

Imgproc.resize(mat, resizedmat, new Size(seekbar1.getProgress(), seekbar1.getProgress()));

//Create Bitmap From The Resized Mat Object Columns & Rows.

Bitmap resizedbitmap = Bitmap.createBitmap(resizedmat.cols(), resizedmat.rows(), Bitmap.Config.ARGB_8888);

//Convert The Resized Mat Object To Bitmap

Utils.matToBitmap(resizedmat, resizedbitmap);

//Display The Resized Bitmap In imageview1

imageview1.setImageBitmap(resizedbitmap);

//Release The Mat Objects To Prevent Memory Leaks

mat.release();
resizedmat.release();
OpenCV Image Resizer Sketchware Pro Project
1
Android Developers pinned «What Did You Feel About The OpenCV Tutorial»
Android Developers pinned «OpenCV Image Resizer Sketchware Pro Project»
Android Developers YouTube Channel Reaches 40 Subscribers.

😊 Thank You 😊

@SE_BIBEL_MEK

👉 @androiddevstutorial
👍2
Sketchware Pro Nightly Version v6.4.0-SNAPSHOT-5f82376-minApi26
⚠️ Caution ⚠️

I've Tested This Sketchware Pro Nightly Build On realme RMX3381 Android13 Device & I Have Not Found Any Bugs(Except The Local Library Downloader Bug). But There May Be Some Unstablity Issues In Other Android Versions. So I Highly Recommend You To Backup Your .sketchware Folder Before Trying This One. If You Want The Latest Stable Build Of Sketchware Pro You Can Download It From Here. Otherwise Enjoy The New Features & Bug Fixes.

@SE_BIBEL_MEK

👉 @androiddevstutorial
👍1
Channel photo updated
How To Install Kotlin In Android Using Termux

Kotlin is a modern programming language developed by JetBrains, designed to be fully interoperable with Java and enhance the development experience for Android and other applications. Here are some key features of Kotlin:

* Concise Syntax: Kotlin aims to reduce boilerplate code, making it more concise and readable compared to Java.

* Null Safety: It includes built-in null safety features, helping to eliminate the risk of null pointer exceptions by distinguishing between nullable and non-nullable types.

* Interoperability: Kotlin can seamlessly interact with Java code, allowing developers to use existing Java libraries and frameworks.

In This Post We're Going To Learn How To Install Kotlin & Run Our First Kotlin Program In Android Using Termux.

Step1. If You Don't Have Termux App Installed On Your Android Device You Can Install It From Here.
Step2. After Installing Termux Open The Terminal & Install JDK (Java Development KIT) Using This Command Since Kotlin Runs On JVM(Java Virtual Machine).

pkg install openjdk

* You Can Check If JDK Is Correctly Installed On You Termux Environment Using This Command.

java --version

If It's Installed It Should Print The Version Like This.

openjdk 21.0.5 2024-10-15
OpenJDK Runtime Environment (build 21.0.5)
OpenJDK 64-Bit Server VM (build 21.0.5, mixed mode)


Step3. After Installing JDK Successfully Let's Install Kotlin Using This Command.

pkg install kotlin

* You Can Check If Kotlin Is Correctly Installed On You Termux Environment Using This Command.

kotlin -version

If It's Installed It Should Print The Version Like This.

Kotlin version 2.0.21-release-482 (JRE 21.0.5)

Step4. After Kotlin Installation Is Done Let's Create Our First Program. For Instance I've Created This One.
1
fun main(){
println("Hello Android Developers")
}