• Home
  • Insight
  • Blog
  • Business
  • Entertainment
  • Health
  • Politics
  • Shop
    • Gift Shop
    • Value Shop
    • Store
    • Bargain Shop
    • Discount
  • Sports
  • Tech
  • Travel
  • USA
  • Video
  • World
    • Asia
    • Africa
    • South America
    • North America
    • Europe
    • Oceania
Thursday, July 30, 2026
No Result
View All Result
Subscribe Now
  • Home
  • Insight
  • Blog
  • Business
  • Entertainment
  • Health
  • Politics
  • Shop
    • Gift Shop
    • Value Shop
    • Store
    • Bargain Shop
    • Discount
  • Sports
  • Tech
  • Travel
  • USA
    TX Rep. Brandon Gill Mocks James Talarico Over Fauci Action Figure Post

    TX Rep. Brandon Gill Mocks James Talarico Over Fauci Action Figure Post

    NBA players are ‘being taught’ to flop

    NBA players are ‘being taught’ to flop

    Industry was warned for years about chemical ‘runaway’ dangers. Then came near-catastrophe in O.C.

    Industry was warned for years about chemical ‘runaway’ dangers. Then came near-catastrophe in O.C.

    Trump administration seeks government-wide NDAs to stop leaks : NPR

    Trump administration seeks government-wide NDAs to stop leaks : NPR

    Dog discharges shotgun inside truck, striking woman at Nebraska traffic light

    Dog discharges shotgun inside truck, striking woman at Nebraska traffic light

    Toshifumi Suzuki, Japan’s ‘God’ of Convenience Stores, Dies at 93

    Toshifumi Suzuki, Japan’s ‘God’ of Convenience Stores, Dies at 93

     Judge Sanctioned CoreCivic for Destroying Video in ICE Death Suit

     Judge Sanctioned CoreCivic for Destroying Video in ICE Death Suit

    Suspect dead after opening fire near White House security checkpoint, Secret Service says

    Suspect dead after opening fire near White House security checkpoint, Secret Service says

    Trump trashes Colbert’s high-rated finale as “no ratings”

    Trump trashes Colbert’s high-rated finale as “no ratings”

  • Video
  • World
    • Asia
    • Africa
    • South America
    • North America
    • Europe
    • Oceania
The Insight Post
  • Home
  • Insight
  • Blog
  • Business
  • Entertainment
  • Health
  • Politics
  • Shop
    • Gift Shop
    • Value Shop
    • Store
    • Bargain Shop
    • Discount
  • Sports
  • Tech
  • Travel
  • USA
    TX Rep. Brandon Gill Mocks James Talarico Over Fauci Action Figure Post

    TX Rep. Brandon Gill Mocks James Talarico Over Fauci Action Figure Post

    NBA players are ‘being taught’ to flop

    NBA players are ‘being taught’ to flop

    Industry was warned for years about chemical ‘runaway’ dangers. Then came near-catastrophe in O.C.

    Industry was warned for years about chemical ‘runaway’ dangers. Then came near-catastrophe in O.C.

    Trump administration seeks government-wide NDAs to stop leaks : NPR

    Trump administration seeks government-wide NDAs to stop leaks : NPR

    Dog discharges shotgun inside truck, striking woman at Nebraska traffic light

    Dog discharges shotgun inside truck, striking woman at Nebraska traffic light

    Toshifumi Suzuki, Japan’s ‘God’ of Convenience Stores, Dies at 93

    Toshifumi Suzuki, Japan’s ‘God’ of Convenience Stores, Dies at 93

     Judge Sanctioned CoreCivic for Destroying Video in ICE Death Suit

     Judge Sanctioned CoreCivic for Destroying Video in ICE Death Suit

    Suspect dead after opening fire near White House security checkpoint, Secret Service says

    Suspect dead after opening fire near White House security checkpoint, Secret Service says

    Trump trashes Colbert’s high-rated finale as “no ratings”

    Trump trashes Colbert’s high-rated finale as “no ratings”

  • Video
  • World
    • Asia
    • Africa
    • South America
    • North America
    • Europe
    • Oceania
No Result
View All Result
No Result
View All Result
Home Mobile

Efficiently develop Flutter on existing Android app

by Theinsightpost
August 13, 2022
in Mobile
0 0
0
Efficiently develop Flutter on existing Android app


Written by Pooja Bhaumik

This article was first published on Medium

Since the last 6 months, I have been focused on a big migration project, where we have been migrating a production app from native to Flutter, feature by feature.
Initially, I started experimenting with Android, and adding Flutter features to an existing Android application.

In this article, I will go over steps on how we can easily setup an existing Android application to accept Flutter code, and how Codemagic also helps in creating shippable artefacts for such an arrangement.

PS. I started this experiment back in June-July last year, and definitely, “easy” was not an adjective to describe the process. It also made sense, because Add2App was in a very early stage then, and there were ongoing experiments happening. Often there would be breaking changes in each update for Add2App. Today, it is much easier in comparison.

Step 1: Add Flutter Module to your existing Android app

When you know, you are writing Flutter code for an existing native app, you have to make sure, you are creating a Flutter module instead of a full Flutter application.

The major difference between Flutter application and Flutter module, is that Flutter module has .android and .ios folders instead of android and ios folders. These are hidden folders that are regenerated every time you do flutter pub get
About adding the Flutter module to your project, check out the documentation on the official site here.

If you are using Android Studio, simply right-click on the Android project, and do File -> New -> New Module and then choose Flutter Module.

You can try these steps to open a Flutter screen from an Android activity. And you can simply run your host app (Android app) and it’s ready to run Flutter code inside an existing Android app. Ways of integrating Flutter screens in Android app is out of scope of this article.

Step 2: Hot reload from an Android app

Currently, you are directly depending on your project’s source-code, due to the setup added in settings.gradle (if you followed the tutorials from the Flutter site)

setBinding(new Binding([gradle: this]))
evaluate(new File(
  settingsDir,
  '../flutter_module/.android/include_flutter.groovy'
))

Note: If the compiler complains of not finding include_flutter.groovy, make sure to regenerate the .android folder in your flutter_modul project by doing flutter clean and flutter pub get again.

Now, there are two ways to develop on the Flutter codebase.

Easy way: If you don’t have too many back and forth between Android activities and Flutter screens, you can simply run the flutter_module as your standalone app, and use the magic of hot reload the way you like. You might have to do some setups in your .android ‘s AndroidManfiest.xml and build.gradle files for some cases. For e.g, if you want to make Google Maps run in a Flutter module, you will have to temporarily add the Gmaps Keys in AndroidManifest.xml to make it run in standalone Flutter module app. Basically mimic the settings of your Android host app in your .android folder as well.


Slightly more annoying way: You do have a lot of back and forth between Android activities and Flutter screens and you can’t mimic all the settings in your .android app, and it makes more sense to run both Android and Flutter together. But you also want hot reload.

To make it happen, you run the Android app just how you normally do, but before you open any Flutter screen, do the following:

or move to wherever your flutter_module is.

In your terminal, type

flutter attach -d <deviceId>

deviceId is the identifier attached to your physical device/simulator/emulator. Then, the terminal will read something like the below:

Waiting for a connection from Flutter on Android SDK built for x86 64...

Once you open a Flutter screen in the app, the next message will pop up in your terminal.

Syncing files to device Android SDK built for x86 64...                 
 5,693ms (!)
?  To hot reload changes while running, press "r". To hot restart (and rebuild state), press "R".
An Observatory debugger and profiler on Android SDK built for x86 64 is available at: http://127.0.0.1:56997/xxxxxx/

That’s all. Use r to hot reload and R to restart Flutter screens. But this is only effective, if you have changes in the Flutter code. If you have changes on the native side, you will have to rerun the app, and do the steps above to be able to hot reload on Flutter side.

Step 3: Create a shippable app

Once you are done with the development, we must create a snapshot of the Flutter code and release it with the host Android app. The approach I take is by creating an AAR of the Flutter code, and add it as a library to the Android app.
There are two ways of creating the AAR —

Locally built AAR

In your directory of your flutter_module, type the following

and a successful operation will create the AAR files for your plugins and codebase in your build/host/outputs/repo folder.
I simply copy this repo folder to my Android app’s app/ folder

If you are using Android Studio 3.6+, you can also update your Flutter plugin, and use the Build -> Flutter -> Build AAR option.

Build AAR with Codemagic

Instead of creating locally, you can also let CI build it for you. And Codemagic is perfect when it comes to CI for Flutter.
To make it work, create a configuration file codemagic.yaml.

workflows:
  default-workflow:
    name: AARBuilds
    environment:
      flutter: stable
      xcode: latest
      cocoapods: default
    scripts:
      - flutter packages pub get
      - flutter build aar -v
    artifacts:
      - build/host/outputs/repo

Once you push the file, go to Codemagic and find your repository and Start a New Build, select your preferred branch and select workflow from codemagic.yaml.

And by the end of the successful build, a similar zip file containing of all the AAR files will be created that you can add to the Android project.
Once you have added the library to the Android project, do the following steps to access the new Flutter library.

  1. In your build.gradle , add the following code
repositories {
    mavenLocal()
    maven { url "flutter_repo" } //name of the repo folder
    maven {
        url 'http://download.flutter.io'
    }
}
  1. Add the dependencies for the flutter plugins used in your Flutter codebase

dependencies {
...
    implementation('com.poojabhaumik.fluttermodule:flutter_release:1.0') { transitive = true } //AAR of your flutter code
    implementation('io.flutter.plugins.imagepicker:image_picker_release:1.0') { transitive = true } //Plugins used by the code
...    
}

Now, run and deploy!

And that’s all the steps to integrate Flutter into an Android app, and the different ways of development and deployment that I practice in my projects!
I have a sample Android host project here and sample Flutter module app here, that you can use to test the above steps.


Pooja Bhaumik is Senior Developer at Bounce. Google Developer Expert, Mobile Developer, Public Speaker, Technical Blogger, Mentor MentorCruise and Co-founder/Organizer of WomenDroid. Keep eye on her @pblead26





Source link

ShareTweetSend
Previous Post

Africa Super League: Is it good news for Africa?

Next Post

Macron signs protocols on accession of Finland and Sweden to NATO

Related News

Announcing Codemagic Patch: an open-source CodePush rebuild for React Native
Mobile

Announcing Codemagic Patch: an open-source CodePush rebuild for React Native

July 30, 2026
React Native OTA Updates: What You Can (and Can’t) Deploy Over the Air
Mobile

React Native OTA Updates: What You Can (and Can’t) Deploy Over the Air

May 28, 2026
Your phone drawer hides an app designed to “exploit developing brains”
Mobile

Your phone drawer hides an app designed to “exploit developing brains”

May 27, 2026
iPhone 16 has a secret charging upgrade Apple didn’t even mention
Mobile

iPhone 16 has a secret charging upgrade Apple didn’t even mention

May 26, 2026
Next Post
Macron signs protocols on accession of Finland and Sweden to NATO

Macron signs protocols on accession of Finland and Sweden to NATO

Discussion about this post

Subscribe To Our Newsletters

    Customer Support


    1251 Wilcrest Drive
    Houston, Texas
    77042 USA
    Call-832.795.1420
    e-mail – news@theinsightpost.com

    Subscribe To Our Newsletters

      Categories

      • Africa
      • Africa-East
      • African Sports
      • American Sports
      • Arts
      • Asia
      • Australia
      • Business
      • Business Asia
      • Business- Africa
      • Canada
      • Defense
      • Education
      • Egypt
      • Energy
      • Entertainment
      • Europe
      • European Soccer
      • Finance
      • Germany
      • Ghana
      • Health
      • Insight
      • International
      • Investing
      • Japan
      • Latest Headlines
      • Life & Living
      • Markets
      • Mobile
      • Movies
      • New Zealand
      • Nigeria
      • Politics
      • Scholarships
      • Science
      • South Africa
      • South America
      • Sports
      • Tech
      • Travel
      • UK
      • USA
      • Weather
      • World
      No Result
      View All Result

      Recent News

      Free Cloud Computing Course | AWS Re/Start Program 

      Free Cloud Computing Course | AWS Re/Start Program 

      July 30, 2026
      Thirty Years Later

      Thirty Years Later

      July 30, 2026
      Announcing Codemagic Patch: an open-source CodePush rebuild for React Native

      Announcing Codemagic Patch: an open-source CodePush rebuild for React Native

      July 30, 2026
      Following Expansion in China, Regional Private Equity Faces New Scrutiny in Southeast Asia – The Diplomat

      Following Expansion in China, Regional Private Equity Faces New Scrutiny in Southeast Asia – The Diplomat

      July 30, 2026
      • Home
      • Advertise With Us
      • About Us
      • Corporate
      • Consumer Rewards
      • Forum
      • Privacy Policy
      • Social Trends

      Theinsightpost ©2026 | All Rights Reserved. Theinsightpost is an Elnegy LLC company, registered in Texas, USA

      Welcome Back!

      Login to your account below

      Forgotten Password?

      Retrieve your password

      Please enter your username or email address to reset your password.

      Log In

      Add New Playlist

      We are using cookies to give you the best experience on our website.

      You can find out more about which cookies we are using or switch them off in .

      No Result
      View All Result
      • Home
      • Insight
      • Blog
      • Business
      • Entertainment
      • Health
      • Politics
      • Shop
        • Gift Shop
        • Value Shop
        • Store
        • Bargain Shop
        • Discount
      • Sports
      • Tech
      • Travel
      • USA
      • Video
      • World
        • Asia
        • Africa
        • South America
        • North America
        • Europe
        • Oceania

      Theinsightpost ©2026 | All Rights Reserved. Theinsightpost is an Elnegy LLC company, registered in Texas, USA

      The Insight Post
      Powered by  GDPR Cookie Compliance
      Privacy Overview

      This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.

      Strictly Necessary Cookies

      Strictly Necessary Cookie should be enabled at all times so that we can save your preferences for cookie settings.

      Cookie Policy

      More information about our Cookie Policy