<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Muaz KADAN on Medium]]></title>
        <description><![CDATA[Stories by Muaz KADAN on Medium]]></description>
        <link>https://medium.com/@muaz.kadan?source=rss-2de84549abec------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*6Z5o7xn-p7cycxam</url>
            <title>Stories by Muaz KADAN on Medium</title>
            <link>https://medium.com/@muaz.kadan?source=rss-2de84549abec------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 02:08:11 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@muaz.kadan/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Writing Effective Commit Messages]]></title>
            <link>https://medium.com/@muaz.kadan/writing-effective-commit-messages-3f3c313170da?source=rss-2de84549abec------2</link>
            <guid isPermaLink="false">https://medium.com/p/3f3c313170da</guid>
            <category><![CDATA[version-control]]></category>
            <category><![CDATA[git-commit]]></category>
            <category><![CDATA[git]]></category>
            <dc:creator><![CDATA[Muaz KADAN]]></dc:creator>
            <pubDate>Fri, 18 Jul 2025 03:34:48 GMT</pubDate>
            <atom:updated>2025-07-18T03:40:59.797Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*vjnxwUu0cuAKf5K4" /></figure><p>Commit messages are the backbone of a clear and maintainable version control history. A well-crafted commit message communicates the <strong><em>why</em></strong> and <strong><em>what</em></strong> of a change, making collaboration smoother and debugging easier. Here’s how to write effective commit messages that stand the test of time.</p><h3>Keep It Short and Specific</h3><p>Aim for a concise summary line — ideally under 50 characters — that captures the essence of the change. For example, “Fix login button alignment issue” is clear and to the point. Avoid vague phrases like “Update code” or “Fix stuff.” The summary should answer, “What does this commit do?”</p><h3>Use the Body for Context</h3><p>If the change needs more explanation, add a body below the summary line, separated by a blank line. Keep lines under 72 characters for readability in tools like Git logs. Explain <strong><em>why</em></strong> the change was made, not just <strong><em>what</em></strong> was changed. For instance:</p><pre>Fix login button alignment issue<br><br>Adjusted CSS to center the login button on mobile screens.<br>Addresses user feedback about misaligned UI elements.</pre><p>This provides context for future readers, including your future self.</p><h3>Use Imperative Mood</h3><p>Write in the imperative mood, as if giving a command: “Add feature,” “Fix bug,” “Refactor module.” This aligns with Git’s conventions and keeps messages consistent. Think of it as completing the sentence, “If applied, this commit will…”</p><h3>Reference Issues or Tickets</h3><p>If your project uses issue trackers, include ticket numbers or links in the commit message. For example: “Fix login bug (#123).” This ties the change to its broader context, making it easier to trace back to discussions or bug reports.</p><h3>Be Consistent</h3><p>Adopt a team-wide convention for commit messages. Consistency helps everyone understand the history quickly. Whether it’s prefixing with types like “feat:” or “fix:”, or following a specific format, stick to it.</p><p>Good commit messages are a small investment with big payoffs. They improve collaboration, simplify debugging, and make your project’s history a valuable resource. Next time you commit, take a moment to craft a message that’s clear, concise, and meaningful.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3f3c313170da" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Starting Compose Activity from Flutter]]></title>
            <link>https://medium.com/@muaz.kadan/starting-compose-activity-from-flutter-099be5816e15?source=rss-2de84549abec------2</link>
            <guid isPermaLink="false">https://medium.com/p/099be5816e15</guid>
            <category><![CDATA[android]]></category>
            <category><![CDATA[kotlin]]></category>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[dart]]></category>
            <category><![CDATA[jetpack-compose]]></category>
            <dc:creator><![CDATA[Muaz KADAN]]></dc:creator>
            <pubDate>Mon, 06 May 2024 15:02:31 GMT</pubDate>
            <atom:updated>2024-05-06T15:02:31.804Z</atom:updated>
            <content:encoded><![CDATA[<p>In this article, we will explore how to Start an Android (Compose) Activity from Flutter App.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*r_520nvKSt-qyi8Wi7K7DQ.png" /></figure><p><strong>Setting Up the Flutter Project:</strong></p><ul><li>First of all, start a new Flutter Project from Android Studio (you can use whatever IDE you want) :</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/854/1*Mf0NrgzZuFrc_UMRyJYxbw.png" /></figure><p>Initialize a MethodChannel (a communication channel between Flutter and Native) and create a function that uses this channel to send a method call to the native side.</p><pre>final methodChannel = const MethodChannel(&#39;dev.muazkadan.navigateChannel&#39;);<br>void _navigateToNative() {<br>  methodChannel.invokeMethod(&#39;flutterNavigate&#39;);<br>}</pre><p>Here’s how my main.dart looks now:</p><pre>import &#39;package:flutter/material.dart&#39;;<br>import &#39;package:flutter/services.dart&#39;;<br><br>void main() {<br>  runApp(const MyHomePage());<br>}<br><br>class MyHomePage extends StatelessWidget {<br>  const MyHomePage({super.key});<br>  final methodChannel = const MethodChannel(&#39;dev.muazkadan.navigateChannel&#39;);<br><br>  void _navigateToNative() {<br>    methodChannel.invokeMethod(&#39;flutterNavigate&#39;);<br>  }<br><br>  @override<br>  Widget build(BuildContext context) {<br>    return MaterialApp(<br>      home: Scaffold(<br>        appBar: AppBar(<br>          backgroundColor: Theme.of(context).colorScheme.inversePrimary,<br>          title: const Text(&quot;Flutter to Native&quot;),<br>        ),<br>        floatingActionButton: FloatingActionButton(<br>          onPressed: _navigateToNative,<br>          child: const Icon(Icons.arrow_right),<br>        ),<br>      ),<br>    );<br>  }<br>}</pre><p><strong>Setting up the Native Activity:</strong></p><p>To open Android module of the Flutter app:</p><ul><li>Right-click on the Android folder</li><li>Click on “Flutter” option from the menu that pops up</li><li>Select “Open Android module in Android Studio”</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/633/1*kpuSLzcquzunHmntZNAz4Q.png" /></figure><p>Now open your :app module’s build.gradle file and add those dependencies:</p><pre>dependencies {<br>    implementation &quot;androidx.activity:activity-compose:1.9.0&quot;<br>    implementation platform(&quot;androidx.compose:compose-bom:2024.05.00&quot;)<br>    implementation &quot;androidx.compose.material3:material3&quot;<br>}</pre><p>You can of course extend the list to match your needs. I’m going to stick with these for the sake of simplicity.</p><p>Inside Android block:</p><ul><li>Enable Compose in the project</li><li>Specify the Kotlin compiler version</li></ul><pre>buildFeatures {<br>    compose true<br>}<br>composeOptions {<br>    kotlinCompilerExtensionVersion &#39;1.3.0&#39; // compatible with Kotlin 1.7.10<br>}</pre><p><strong>Note</strong>: Because Jetpack Compose supports minSdk of 21 or higher and Flutter‘s default “minSdkVersion” is 19, you might have to change it manually inside the build.gradle file if you are going to use Compose and you get an error.</p><pre>defaultConfig {<br>    applicationId &quot;dev.muazkadan.flutter_to_native&quot;<br>    minSdkVersion 21 // changed manually here to 21<br>    targetSdkVersion flutter.targetSdkVersion<br>    versionCode flutterVersionCode.toInteger()<br>    versionName flutterVersionName<br>    vectorDrawables {<br>        useSupportLibrary true<br>    }<br>}</pre><p>Now sync your prıject with gradle files and create your Native Activity by creating a new Kotlin class and extending<em> </em>ComponentActivity like this:</p><pre>import android.os.Bundle<br>import androidx.activity.ComponentActivity<br>import androidx.activity.compose.setContent<br>import androidx.compose.material3.Text<br><br>class NativeActivity : ComponentActivity() {<br>    override fun onCreate(savedInstanceState: Bundle?) {<br>        super.onCreate(savedInstanceState)<br>        setContent {<br>            Text(&quot;Hello from Native!&quot;)<br>        }<br>    }<br>}</pre><p>Remember to add the Activity you created to “AndroidManifest.xml” File</p><pre>&lt;activity android:name=&quot;.NativeActivity&quot;/&gt;</pre><p>Now open “MainActivity.kt” file and override configureFlutterEngine method like this:</p><pre>import android.content.Intent<br>import io.flutter.embedding.android.FlutterActivity<br>import io.flutter.embedding.engine.FlutterEngine<br>import io.flutter.plugin.common.MethodChannel<br><br>class MainActivity: FlutterActivity(){<br><br>    override fun configureFlutterEngine(flutterEngine: FlutterEngine) {<br>        super.configureFlutterEngine(flutterEngine)<br>        MethodChannel(flutterEngine.dartExecutor.binaryMessenger, &quot;dev.muazkadan.navigateChannel&quot;).setMethodCallHandler { call, result -&gt;<br>            if(call.method == &quot;flutterNavigate&quot;){<br>                startActivity(Intent(this, NativeActivity::class.java))<br>            }<br>        }<br>    }<br>}</pre><p>Note that you have to set up a MethodChannel with the same name as the one in the Dart code (“dev.muazkadan.navigateChannel”).</p><p>The setMethodCallHandler function is used to handle method calls coming from the Dart side. It takes a lambda function with two parameters: call, which represents the method call, and result, which can be used to send a result back to the Dart side.</p><p><strong>The final result should looks like this:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/324/1*83fFLmhSitwG5l02RyPssw.gif" /></figure><p><strong>Conclusion</strong>:</p><p>By using the implementation mentioned above, you can extend your Flutter app with a Native screen that uses Jetpack Compose, which may help you implement more complex features specific to Native.</p><p>Let me know if you need the SwiftUI version of this article.</p><p>If you have any questions or comments about this article, please do not hesitate to contact me on <a href="https://www.linkedin.com/in/muaz-kadan-727911107/">Linkedin</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=099be5816e15" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[MLKit Document Scanner with Jetpack Compose]]></title>
            <link>https://medium.com/@muaz.kadan/mlkit-document-scanner-with-jetpack-compose-4244d352bece?source=rss-2de84549abec------2</link>
            <guid isPermaLink="false">https://medium.com/p/4244d352bece</guid>
            <category><![CDATA[android]]></category>
            <category><![CDATA[jetpack-compose]]></category>
            <category><![CDATA[kotlin]]></category>
            <category><![CDATA[ml-kit]]></category>
            <category><![CDATA[google]]></category>
            <dc:creator><![CDATA[Muaz KADAN]]></dc:creator>
            <pubDate>Fri, 08 Mar 2024 11:42:07 GMT</pubDate>
            <atom:updated>2024-03-08T11:42:07.453Z</atom:updated>
            <content:encoded><![CDATA[<p>In this article, we will explore the integration of MLKit Document Scanning in Jetpack Compose, which allows you to convert physical documents into digital formats and use them as images or PDF files.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tc4ALimgOUBC5UvgW1lrlA.jpeg" /></figure><p><strong>What does this library offer?</strong></p><ul><li>A solution for all the developers who want to implement a document scanner in their apps in a simple and easy way.</li><li>Minimum impact on the size of your app.</li><li>Integration with no camera permission required.</li><li>It works offline (on-device), which enhances privacy and security</li><li>Use crop, apply filters, remove shadows, clean stains and other effects.</li><li>And much more!</li></ul><p><strong>Setting Up the Project:</strong></p><ul><li>First of all, start a new Android Studio project with an empty Compose activity:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/899/1*HSB43byaXFkS5F5NE7MlQw.png" /></figure><ul><li>Add the MLKit Scanner dependency to the app-level build.gradle file:</li></ul><pre>implementation(&quot;com.google.android.gms:play-services-mlkit-document-scanner:16.0.0-beta1&quot;)</pre><ul><li>Initialize an GmsDocumentScannerOptions object and set your preferred options.</li></ul><pre>val options = remember {<br>    GmsDocumentScannerOptions.Builder()<br>        .setGalleryImportAllowed(true)<br>        .setPageLimit(2)<br>        .setResultFormats(RESULT_FORMAT_JPEG, RESULT_FORMAT_PDF)<br>        .setScannerMode(SCANNER_MODE_FULL)<br>        .build()<br>}</pre><p><strong>What can you configure here?</strong></p><ul><li>Allowing the user to import images from gallery.</li><li>Set a limit on the number of pages that can be scanned at once.</li><li>Set the format of the result.</li><li>Set the scanner mode to what suits you best.</li></ul><p><strong>Scanner modes that you can use:</strong></p><ul><li>SCANNER_MODE_BASE: provides basic editing capabilities.</li><li>SCANNER_MODE_BASE_WITH_FILTER: provides filters alongside the basic capabilities.</li><li>SCANNER_MODE_FULL (default): provides ML-enabled image cleaning capabilities</li></ul><p>Now get an instance of GmsDocumentScanner using the GmsDocumentScannerOptions object that you created above.</p><pre>val scanner = remember { GmsDocumentScanning.getClient(options) }</pre><ul><li>Create launcher will be used to start an activity for a result, and handle the result when it comes back:</li></ul><pre>val scannerLauncher =<br>    rememberLauncherForActivityResult(ActivityResultContracts.StartIntentSenderForResult()) { result -&gt;<br>        if (result.resultCode == RESULT_OK) {<br>            val gmsResult =<br>                GmsDocumentScanningResult.fromActivityResultIntent(result.data) // get the result<br>            gmsResult?.pages?.let { pages -&gt;<br>                pages.forEach { page -&gt;<br>                    val imageUri = page.imageUri // do something with the image<br>                }<br>            }<br>            gmsResult?.pdf?.let { pdf -&gt;<br>                val pdfUri = pdf.uri // do something with the PDF<br>            }<br>        }<br>    }</pre><ul><li>Use a Button to trigger the document scanning activity:</li></ul><pre>Button(onClick = {<br>    scanner.getStartScanIntent(this@MainActivity) // or use LocalContext.current as Activity<br>        .addOnSuccessListener { intentSender -&gt;<br>            scannerLauncher.launch(<br>                IntentSenderRequest.Builder(intentSender).build()<br>            )<br>        }.addOnFailureListener {<br>            // handle errors here.<br>        }<br>}) {<br>    Text(&quot;Scan&quot;)<br>}</pre><p><strong>Here is the full code:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*l7RjCnrz6D2rwqmyG9ZpOg.png" /></figure><p><strong>Check my Github project example for more details:</strong></p><p><a href="https://github.com/muazkadan/MLKit-Document-Scan-Compose">GitHub - muazkadan/MLKit-Document-Scan-Compose: Jetpack Compose project showcasing MLKit Document Scanner</a></p><p><strong>Conclusion</strong>:</p><p>By using the implementation mentioned above, your Jetpack Compose project will integrate document scanning in a fundamental manner, ultimately enhancing the user experience and increasing the functionality of your apps.</p><p>Hope you find this article helpful.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4244d352bece" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Biometric Authentication in Jetpack Compose]]></title>
            <link>https://medium.com/@muaz.kadan/biometric-authentication-in-jetpack-compose-5e4d7e35d1e7?source=rss-2de84549abec------2</link>
            <guid isPermaLink="false">https://medium.com/p/5e4d7e35d1e7</guid>
            <category><![CDATA[biometric-authentication]]></category>
            <category><![CDATA[jetpack-compose]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[kotlin]]></category>
            <dc:creator><![CDATA[Muaz KADAN]]></dc:creator>
            <pubDate>Thu, 06 Jul 2023 14:10:38 GMT</pubDate>
            <atom:updated>2023-07-06T14:10:38.889Z</atom:updated>
            <content:encoded><![CDATA[<p>In this article, we will explore the integration of biometric authentication in Jetpack Compose, allowing developers to enhance the security of their applications while providing a user-friendly experience.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*VfpjfmCAwBf1egh1.jpg" /></figure><p><strong>Setting Up the Project:</strong></p><ul><li>First of all, start a new Android Studio project with an empty compose activity:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/899/1*HSB43byaXFkS5F5NE7MlQw.png" /></figure><ul><li>Add the Biometric dependency to the app-level build.gradle file:</li></ul><pre>implementation(&quot;androidx.biometric:biometric:1.2.0-alpha05&quot;)</pre><ul><li>Change your MainActivity’s parent from ComponentActivity to FragmentActivity.</li></ul><pre>class MainActivity : FragmentActivity() {</pre><p><strong>Checking Biometric Availability:</strong></p><ul><li>Inside your Composable function, initialize the BiometricManager with the current context:</li></ul><pre>val context = LocalContext.current<br>val biometricManager = remember { BiometricManager.from(context) }</pre><ul><li>Check the availability of biometric authentication using the canAuthenticate method &amp; handle different availability scenarios, such as BIOMETRIC_SUCCESS, BIOMETRIC_ERROR_NO_HARDWARE, BIOMETRIC_ERROR_HW_UNAVAILABLE, and others.:</li></ul><pre>val isBiometricAvailable = remember {<br>    biometricManager.canAuthenticate(BIOMETRIC_STRONG or DEVICE_CREDENTIAL)<br>}<br>when (isBiometricAvailable) {<br>    BiometricManager.BIOMETRIC_SUCCESS -&gt; {<br>        // Biometric features are available<br>    }<br><br>    BiometricManager.BIOMETRIC_ERROR_NO_HARDWARE -&gt; {<br>        // No biometric features available on this device<br>    }<br><br>    BiometricManager.BIOMETRIC_ERROR_HW_UNAVAILABLE -&gt; {<br>        // Biometric features are currently unavailable.<br>    }<br><br>    BiometricManager.BIOMETRIC_ERROR_SECURITY_UPDATE_REQUIRED -&gt; {<br>        // Biometric features available but a security vulnerability has been discovered<br>    }<br><br>    BiometricManager.BIOMETRIC_ERROR_UNSUPPORTED -&gt; {<br>        // Biometric features are currently unavailable because the specified options are incompatible with the current Android version..<br>    }<br><br>    BiometricManager.BIOMETRIC_STATUS_UNKNOWN -&gt; {<br>        // Unable to determine whether the user can authenticate using biometrics<br>    }<br><br>    BiometricManager.BIOMETRIC_ERROR_NONE_ENROLLED -&gt; {<br>        // The user can&#39;t authenticate because no biometric or device credential is enrolled.<br>    }<br>}</pre><p><strong>Triggering Biometric Authentication:</strong></p><ul><li>Create a BiometricPrompt object and override the necessary callback methods to handle authentication events:</li></ul><pre>val context = LocalContext.current<br><br>val executor = remember { ContextCompat.getMainExecutor(context) }<br>val biometricPrompt = BiometricPrompt(<br>    context as FragmentActivity,<br>    executor,<br>    object : BiometricPrompt.AuthenticationCallback() {<br>        override fun onAuthenticationError(errorCode: Int, errString: CharSequence) {<br>            super.onAuthenticationError(errorCode, errString)<br>            // handle authentication error here<br>        }<br><br>        @RequiresApi(Build.VERSION_CODES.R)<br>        override fun onAuthenticationSucceeded(result: BiometricPrompt.AuthenticationResult) {<br>            super.onAuthenticationSucceeded(result)<br>            // handle authentication success here<br>        }<br><br>        override fun onAuthenticationFailed() {<br>            super.onAuthenticationFailed()<br>            // handle authentication failure here<br>        }<br>    }<br>)</pre><ul><li>Create a PromptInfo object to customize the biometric authentication prompt:</li></ul><pre>val promptInfo = BiometricPrompt.PromptInfo.Builder()<br>            .setAllowedAuthenticators(BIOMETRIC_STRONG)<br>            .setTitle(&quot;Biometric Authentication&quot;)<br>            .setSubtitle(&quot;Log in using your biometric credential&quot;)<br>            .setNegativeButtonText(&quot;Use account password&quot;)<br>            .build()</pre><ul><li>Use a Button to trigger the biometric authentication flow:</li></ul><pre>Button(onClick = { biometricPrompt.authenticate(promptInfo) }) {<br>    Text(&quot;Authenticate with Biometrics&quot;)<br>}</pre><p>With the above implementation, your Jetpack Compose project will incorporate biometric authentication. When the biometric authentication flow is triggered, the user will be prompted to authenticate using their enrolled biometric data. Upon successful authentication, the onAuthenticationSuccess callback will be invoked, allowing you to perform the desired actions or navigate to authenticated content.</p><p>Hope you find this article helpful.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5e4d7e35d1e7" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>