ProKit Flutter - Documentation
ProKit Flutter

πŸ€–Android Configuration

πŸ•’ Estimated Reading Time: 2 minutes
πŸ“‚ Location: Configurations & Customization β†’ Android Configuration

– – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – –

πŸ“Œ What is this file for?

This guide helps you configure your Flutter-based Android app for ProKit, including app identity, Firebase integration, launcher and notification icons, and APK generation.

– – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – –

πŸ”Ή 1. Open the Android Module

You can open the Android module in two ways:

Method 1: Select the Android Module from the same project you’re attempting to open by going to File -> Open.

Method 2: Navigate to Tools -> Flutter -> Android Studio -> Open Android Module.

πŸ”Ή 2. Change The Application Id

πŸ“Œ The Application ID is a unique identifier for your app (like com.example.myapp). Once published on Play Store, you should not change it.

Where to update:

  • For Application ID, change the applicationId in the app/build.gradle file.
  • Locate the build.gradle file at this path: android/app/build.gradle.
defaultConfig {
applicationId "YOUR_PACKAGE_NAME"
minSdkVersion 21
targetSdkVersion 31
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}

πŸ”Ή 3. Change Version Name & Version Code

  • Version Name: Visible to users (e.g., β€œ1.0.1”)
  • Version Code: A numeric value used by Google Play to track app updates.

File location:

  • For Version Name and Version Code change the versionName and versionCode in the build.gradle file at the app level.
  • Locate the build.gradle file at this path: android/app/build.gradle.
defaultConfig {
applicationId "com.iqonic.example"
minSdkVersion 21
targetSdkVersion 31
versionCode "CHANGE_THE_VERSION_CODE"
versionName "CHANGE_THE_VERSION_NAME"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}

πŸ”Ή 4. Change the App Name

IMPORTANT

To change the name of your Android application in Android Studio, you have to change the value of the property android:label defined inside the <application> node in AndroidManifest.xml.

File location: android/app/src/main/AndroidManifest.xml

Update the android:label inside the <application> tag:

<application
android:label="YOUR_APP_NAME">
</application>

πŸ”Ή 5. Change App Icon

IMPORTANT

Android Studio includes a tool called Image Asset Studio that helps you generate your own app icons from material icons, custom images, and text strings. It generates a set of icons at the appropriate resolution for each pixel density that your app supports. Image Asset Studio places the newly generated icons in density-specific folders under the res/ directory in your project. At runtime, Android uses the appropriate resource based on the screen density of the device your app is running on.

Image Asset Studio helps you generate the following icon types:

For More Details You can checkout Android Studio Editor Guide for creating Android Icons.

Generate Icon Process​

  • Configure Image Asset
    • Choose Icon type
    • Set Icon Name
    • Choose Asset Type
    • Customize Icon (Resize , Trim , Padding)
  • Confirm Icon Path
    • Choose Mode for Icon
    • Finish

Generate App Launcher Icon

Method 1 : Use Android Studio To Generate Launcher Icons

  • Go to android/app/src/main/res folder.
  • Right-click on the res folder and select New β†’ Image Asset.

INFO

Foreground Layer : The foreground layer is the primary part of the icon that contains the main visual elements. It’s the layer that the user selects the source asset for, which can be an image, clip art or text.

Background Layer : The background layer is the area behind the foreground layer. It can be used to add a background color or image element to the icon. If you don’t want green background for laucher Icon then set background layer suitable to your Launcher Icon.

  • Choose Icon Type – β€œLauncher icons Adaptive & Legacy”
  • Select the path of your Image and press Next.
  • Select App mode for app Icon.
  • Then Press Finish.

Method 2 : Generate Online

The basic process of this website is –

  • Choose Asset type
  • Basic Configuration
  • Choose Device Type
  • Generate and Get the Zip
  • After extracting zip you get res folder replace it with your android/app/src/main – res folder

Generate Notification Icon

  • Go to android/app/src/main/res folder.
  • Right-click on the res folder and select New β†’ Image Asset.
  • Choose Icon Type – β€œNotification”
  • Select the path of your Image and press Next.
  • Select App mode for app Icon.
  • Then Press Finish.

πŸ”Ή 6. Generate Notification Icon

  1. Navigate to android/app/src/main.
  2. Open your Androidmanifest.xml and check for lines below. If not exist just add this line otherwise Paste the Name of Icon you just created into β€œandroid:resourceβ€œ.

Then, update your AndroidManifest.xml:

<meta-data
android:name="com.google.firebase.messaging.default_notification_icon"
android:resource="@drawable/ic_stat_notification" />

INFO

Update notification icon name intoΒ β€œlib β†’ utils β†’ push_notification_service.dart” Follow the Steps mentioned inΒ Flutter Configuration

πŸ”Ή 7. Add the Firebase JSON File

INFO

πŸ“Œ As part of enabling Google APIs or Firebase services in your Android application, you need to set up Firebase and download the Google JSON file.

Click HereΒ to set up Firebase and download the Google JSON file.

πŸ”Ή 8. Generate Signed APK / AAB

Follow these steps to generate a signed APK or AAB for distribution:

1. Open the build menu and Select Generate Signed Bundle/APK.Choose APK and click Next.

2.  Now you will have two options create a new Keystore or choose existing keystore.

  • If you choose to create a new keystore:
  • A dialogue will appear, prompting you to specify the path of the keystore and give it a name.
  • Enter your password and confirm it.
  • Select the alias name.
  • Confirm the password.
  • Enter any additional information if required.
  • Click OK to create your keystore.
  • If you choose to use an existing keystore, simply select it.

After selecting your keystore or creating a new one, click Next.

Choose the release mode and proceed with building the APK.

πŸ“Œ Important: For Play Store, it’s recommended to use AAB (Android App Bundle) instead of APK.

– – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – –

πŸŽ₯ Video Reference: How to Build ProKit Flutter App for Android

This video walkthrough begins with an overview of the ProKit Flutter app structure, followed by steps to open the Android module from the Flutter project. It also covers how to change the Application ID, update the Version Code and Version Name, and customize the Application Name. At the end, it explains how to generate a Signed APK for releasing the app.

– – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – –

βœ… Setup Completed!

πŸŽ‰ Great! You have successfully configured your Android project for ProKit mobile app. Your app is now ready with:

  • Custom App Name and Icons
  • Firebase Integration
  • Version Control
  • Signed APK / AAB for deployment