Skip to main content

Android Configuration

This section covers the configurations required for Android platform.

Icons

Create your app icon ic_launcher and notification icon ic_notification folders from Launcher icon generator. Place the generated icons inside the following folders:

  • /mipmap-hdpi in /android/app/src/main/res/ folder
  • /mipmap-mdpi in /android/app/src/main/res/ folder
  • /mipmap-xhdpi in /android/app/src/main/res/ folder
  • /mipmap-xxhdpi in /android/app/src/main/res/ folder
  • /mipmap-xxxhdpi in /android/app/src/main/res/ folder

Get Dependencies

Run the following command to download the required dependencies for the app.

flutter pub get

Change Package Name

You may need to change the package name to match your business or organization for uniqueness.
  • Open /android/app/build.gradle and change the package name

    defaultConfig {
    // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
    applicationId "YOUR_PACKAGE_NAME"
    minSdkVersion 16
    targetSdkVersion 29
    versionCode flutterVersionCode.toInteger()
    versionName flutterVersionName
    }

    In the above code, replace YOUR_PACKAGE_NAME with something like com.company.projectify

  • Open /android/app/src/main/AndroidManifest.xml and specify your:

    • YOUR_PACKAGE_NAME
    • YOUR_APPLICATION_NAME
    <manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="YOUR_PACKAGE_NAME">
    <!-- io.flutter.app.FlutterApplication is an android.app.Application that
    calls FlutterMain.startInitialization(this); in its onCreate method.
    In most cases you can leave this as-is, but you if you want to provide
    additional functionality it is fine to subclass or reimplement
    FlutterApplication and put your custom class here. -->
    <application
    android:name="io.flutter.app.FlutterApplication"
    android:label="YOUR_APPLICATION_NAME"
    android:icon="@mipmap/ic_launcher">

    In the above code,
    replace YOUR_PACKAGE_NAME with something like com.company.projectify and
    replace YOUR_APPLICATION_NAME with something like Projectify

  • Open /android/app/src/debug/AndroidManifest.xml and /android/app/src/profile/AndroidManifest.xml specify your:

    • YOUR_PACKAGE_NAME
    <manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="YOUR_PACKAGE_NAME">

    In the above code, replace YOUR_PACKAGE_NAME with something like com.company.projectify

  • Open /android/app/src/main/java/PACKAGE_NAME_FOLDERS/MainActivity.kt and change the package name

    package YOUR_PACKAGE_NAME;

    In the above code, replace YOUR_PACKAGE_NAME with something like com.company.projectify