<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Michael Chiew</title>
    <description>The latest articles on Forem by Michael Chiew (@michaelchiew08).</description>
    <link>https://forem.com/michaelchiew08</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F512061%2Fc87b68d8-2d5c-4996-a7db-c52ee8008b0d.png</url>
      <title>Forem: Michael Chiew</title>
      <link>https://forem.com/michaelchiew08</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/michaelchiew08"/>
    <language>en</language>
    <item>
      <title>Guide To Leverage The Built-in Barcode Scanners on Android PDAs with Flutter</title>
      <dc:creator>Michael Chiew</dc:creator>
      <pubDate>Mon, 10 Nov 2025 13:56:38 +0000</pubDate>
      <link>https://forem.com/michaelchiew08/guide-to-leverage-the-built-in-barcode-scanners-on-android-pdas-with-flutter-15d8</link>
      <guid>https://forem.com/michaelchiew08/guide-to-leverage-the-built-in-barcode-scanners-on-android-pdas-with-flutter-15d8</guid>
      <description>&lt;p&gt;Ever wonder how you can leverage those built-in barcode scanner or sometimes it is called as PDA handheld scanners that runs on Android operating system in your Flutter app?&lt;/p&gt;

&lt;p&gt;You are in luck! This guide introduce you the &lt;a href="https://pub.dev/packages/flutter_pda_scanner_v2" rel="noopener noreferrer"&gt;flutter_pda_scanner_v2&lt;/a&gt; package which is designed to help you to integrate into your Flutter app and operate the barcode scanner.&lt;/p&gt;

&lt;p&gt;Before we dive right in, I have to first clarify that the package is originally fork or reference it from &lt;a href="https://pub.dev/packages/flutter_pda_scanner" rel="noopener noreferrer"&gt;flutter_pda_scanner&lt;/a&gt; and &lt;a href="https://pub.dev/packages/pda_scanner" rel="noopener noreferrer"&gt;pda_scanner&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Due to the lack of update and response from the predecessor, therefore I choose to separate out the repository to include certain new enhancement such as supporting &lt;strong&gt;Android V2 Embedding&lt;/strong&gt; and also include a &lt;strong&gt;wider range of compatibility with the latest Android PDA device models&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;There are also other viable alternatives that work in similar fashion, hence you can still choose whatever that best fits you.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://pub.dev/packages/flutter_warehouse_pda_scanner" rel="noopener noreferrer"&gt;https://pub.dev/packages/flutter_warehouse_pda_scanner&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://pub.dev/packages/flutter_plugin_pda_scanner" rel="noopener noreferrer"&gt;https://pub.dev/packages/flutter_plugin_pda_scanner&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;The installation process is pretty straightforward.&lt;/p&gt;

&lt;p&gt;Firstly, add the package into your dependencies. Version may vary as time goes on, please check with the latest version.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;dependencies&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;flutter_pda_scanner_v2&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;^0.0.5&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Go to your main.dart file or the one that contains your main method, include the package import and then add await &lt;code&gt;PdaScanner.instance.initialize();&lt;/code&gt; into the main method right after the &lt;code&gt;WidgetFlutterBinding.ensureInitialized();&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight dart"&gt;&lt;code&gt;&lt;span class="c1"&gt;/// Import package of `flutter_pda_scanner_v2.dart`&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="s"&gt;'package:flutter_pda_scanner_v2/flutter_pda_scanner_v2.dart'&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="kd"&gt;async&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;WidgetsFlutterBinding&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;ensureInitialized&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
  &lt;span class="c1"&gt;// Initialize the PdaScanner.&lt;/span&gt;
  &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;PdaScanner&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;instance&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;initialize&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
  &lt;span class="n"&gt;runApp&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;MyApp&lt;/span&gt;&lt;span class="p"&gt;());&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After that, go to your respective screen or widget that you want to include to listen to the scanning capability. Make sure you import the package. Finally, add both &lt;code&gt;@override&lt;/code&gt; method of &lt;code&gt;onEvent&lt;/code&gt; and &lt;code&gt;onError&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight dart"&gt;&lt;code&gt;&lt;span class="c1"&gt;/// Import package of `flutter_pda_scanner_v2.dart`&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="s"&gt;'package:flutter_pda_scanner_v2/flutter_pda_scanner_v2.dart'&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;ScreenExampleState&lt;/span&gt; &lt;span class="kd"&gt;extends&lt;/span&gt; &lt;span class="n"&gt;State&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;ScreenExample&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="k"&gt;with&lt;/span&gt; &lt;span class="n"&gt;PdaListenerMixin&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;ScreenExample&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;_code&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="nd"&gt;@override&lt;/span&gt;
  &lt;span class="n"&gt;Widget&lt;/span&gt; &lt;span class="n"&gt;build&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;BuildContext&lt;/span&gt; &lt;span class="n"&gt;context&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="c1"&gt;// Or return your own widget.&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="c1"&gt;// Add these @override methods to listen to scanner events.&lt;/span&gt;
  &lt;span class="nd"&gt;@override&lt;/span&gt;
  &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="n"&gt;onEvent&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;Object&lt;/span&gt; &lt;span class="n"&gt;event&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="c1"&gt;// Process the value of the `event.toString()` here.&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="nd"&gt;@override&lt;/span&gt;
  &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="n"&gt;onError&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;Object&lt;/span&gt; &lt;span class="n"&gt;error&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="c1"&gt;// Process the value of the `error.toString()` here such as show toast or dialog.&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;There you have it! When you tap on the proprietary barcode scanning button, it should flash out a placeholder in order to find and capture the barcode. Once it captured the correct input, it should make a “beep” sound.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fe9q6u04qu0kx45kyafaj.gif" width="324" height="576"&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuv7w6qa5hprrq36yeesl.gif" width="324" height="576"&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The device that shown in the GIF above is using SEUIC AutoID Q9 that runs on Android 10&lt;/p&gt;




&lt;p&gt;What do you think? Please share your thought and your feedback down below on how &lt;a href="https://pub.dev/packages/flutter_pda_scanner_v2" rel="noopener noreferrer"&gt;flutter_pda_scanner_v2&lt;/a&gt; package is enhancing your development experience.&lt;/p&gt;

&lt;p&gt;If it does, a simple👏🏻 to this post would be appreciated!&lt;/p&gt;

&lt;p&gt;Thank you for taking the time to read!&lt;/p&gt;




&lt;p&gt;*Original post from Medium which is also my own post: &lt;a href="https://medium.com/@michaelchiew/guide-to-leverage-the-built-in-barcode-scanners-on-android-pdas-with-flutter-13fc49116e8a" rel="noopener noreferrer"&gt;https://medium.com/@michaelchiew/guide-to-leverage-the-built-in-barcode-scanners-on-android-pdas-with-flutter-13fc49116e8a&lt;/a&gt;&lt;/p&gt;

</description>
      <category>mobile</category>
      <category>android</category>
      <category>flutter</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Flutter Migration Guide: Preparing Your Android App for Google Play’s 16 KB Page-Size Requirement</title>
      <dc:creator>Michael Chiew</dc:creator>
      <pubDate>Mon, 27 Oct 2025 03:28:33 +0000</pubDate>
      <link>https://forem.com/michaelchiew08/flutter-migration-guide-preparing-your-android-app-for-google-plays-16-kb-page-size-requirement-10j0</link>
      <guid>https://forem.com/michaelchiew08/flutter-migration-guide-preparing-your-android-app-for-google-plays-16-kb-page-size-requirement-10j0</guid>
      <description>&lt;p&gt;🚨 &lt;strong&gt;DEADLINE ALERT!&lt;/strong&gt; 🚨&lt;br&gt;
&lt;strong&gt;November 1, 2025 is just around the corner! &lt;br&gt;
Google Play is enforcing the 16 KB page size requirement — and your Flutter app might need an update to stay compliant.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;As you may have seen it on the cover photo above which is about the latest Google Play’s 16 KB page size requirement that is affecting the app. Whereby starting November 1, 2025, all the new app submission must support the new 16 KB page size requirement and must support the target SDK 35 / API 35 or also known as Android 15 and above (this is extended deadline).&lt;/p&gt;

&lt;p&gt;Hence, this raised a question on what should a Flutter developer needs to do to ensure the future release is supporting 16 KB page size, and also how we can verify the app is actually supporting 16 KB page size after performing the upgrade (including the package dependencies upgrade) ?&lt;/p&gt;

&lt;p&gt;To shed some lights, I recently managed to upgrade one of my own personal Flutter app and also helped my workplace to kickstart the upgrade as well to support 16 KB page size requirement. Initially, the Flutter SDK version for the app was &lt;code&gt;3.19.5&lt;/code&gt; and then I upgraded to &lt;code&gt;3.32.8&lt;/code&gt; which I believe this should also required to upgrade the Gradle dependency version. Technically Flutter 3.32.X and above should be aligned with to support 16 KB page size requirement.&lt;/p&gt;

&lt;p&gt;To get things out of the way,&lt;/p&gt;

&lt;p&gt;1.) Locate your &lt;code&gt;android/build.gradle&lt;/code&gt; file, upgrade Kotlin version &lt;code&gt;2.2.10&lt;/code&gt; and the build gradle tools to &lt;code&gt;8.12.2&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;buildscript {
    ext.kotlin_version = '2.2.10'
    repositories {
        google()
        mavenCentral()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:8.12.2'
        // ... rest of your code

    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;2.) Then locate your &lt;code&gt;android/gradle/wrapper/gradle-wrapper.properties&lt;/code&gt; file and change the distributionUrl value to fetch &lt;code&gt;gradle-8.13-all.zip&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-all.zip
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;3.) Make sure your android/settings.gradle also upgrade to &lt;code&gt;8.12.2&lt;/code&gt; and Kotlin Android version to &lt;code&gt;2.2.10&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;plugins {
    id "dev.flutter.flutter-plugin-loader" version "1.0.0"
    id "com.android.application" version "8.12.2" apply false
    id "org.jetbrains.kotlin.android" version "2.2.10" apply false
}

include ":app"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;4.) Although this could be somewhat optional but in the end you still need to upgrade it anyway, therefore set the targeted SDK to &lt;code&gt;35&lt;/code&gt; in this &lt;code&gt;android/app/build.gradle&lt;/code&gt; file.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;android {
    namespace "your.application.id_name"  // make sure this remain your app name
    compileSdk flutter.compileSdkVersion
    ndkVersion flutter.ndkVersion

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

    defaultConfig {
        applicationId "your.application.id_name" // make sure this remain your app name
        minSdkVersion 23
        targetSdkVersion 35
        versionCode flutterVersionCode.toInteger()
        versionName flutterVersionName
    }

//... rest of your code

}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once the all the above 4 items are properly configured, you may start compile the app by running the usual Flutter command to build your .apk file.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;flutter build apk --release
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And then one final step is we have to do verification by creating a script file in our Flutter project root folder, and name it as check_elf_alignment.sh&lt;/p&gt;

&lt;p&gt;Copy the script file code from the link below:&lt;br&gt;
&lt;strong&gt;Kudos to the creator 💖&lt;/strong&gt; &lt;a href="https://gist.github.com/NitinPraksash9911/76f1793785a232b2aa2bc2e409873955" rel="noopener noreferrer"&gt;https://gist.github.com/NitinPraksash9911/76f1793785a232b2aa2bc2e409873955&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Finally, allow the file to be executable (for MacOS) and then run the script in the terminal like below to verify:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;chmod +x check_elf_alignment.sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;./check_alignment_elf.sh build/app/outputs/apk/release/app-release.apk
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once the output shows it is aligned with all the green checkmarks ✅, then you are good to go to generate the App Bundle .aab and submit your app to Google Play Console.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftevzt7kij41d1qzsiztr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftevzt7kij41d1qzsiztr.png" alt=" " width="800" height="614"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffvd9c7alai3brfn43g2f.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffvd9c7alai3brfn43g2f.png" alt=" " width="800" height="447"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In summary:&lt;/p&gt;

&lt;p&gt;Kotlin Version: &lt;code&gt;2.2.10&lt;/code&gt; and above&lt;br&gt;
Gradle Wrapper: &lt;code&gt;8.12&lt;/code&gt; and above&lt;br&gt;
Flutter: &lt;code&gt;3.32&lt;/code&gt; and above&lt;br&gt;
Target Android SDK / API Level: &lt;code&gt;35&lt;/code&gt; and above&lt;br&gt;
Flutter build APK&lt;br&gt;
Verify the APK with script file &lt;code&gt;check_elf_alignment.sh&lt;/code&gt; for 16 KB page size alignment.&lt;/p&gt;




&lt;p&gt;If you got any question or would like to have some discussions, please feel free to drop a comment down below. And if you like my very first post content, please give a 👏🏻 to my post.&lt;/p&gt;

&lt;p&gt;Much appreciated and a big big thanks!&lt;/p&gt;




&lt;p&gt;*Original post from Medium which is also my own post: &lt;a href="https://medium.com/@michaelchiew/flutter-migration-guide-preparing-your-android-app-for-google-plays-16-kb-page-size-requirement-8f6d971f7b23" rel="noopener noreferrer"&gt;https://medium.com/@michaelchiew/flutter-migration-guide-preparing-your-android-app-for-google-plays-16-kb-page-size-requirement-8f6d971f7b23&lt;/a&gt;&lt;/p&gt;

</description>
      <category>flutter</category>
      <category>android</category>
      <category>mobile</category>
      <category>googleplay</category>
    </item>
  </channel>
</rss>
