Run Flutter builder runner in compiled app - android

I have an idiot question. is it possible to run the build runner in an application compiled for dynamic code generation?

In a Flutter application, no.
Flutter apps neither have the ability to dynamically evaluate Dart code, nor do they have access to the tools needed to parse and generate source code.

Related

What does android folder and gradle means in Flutter?

I've been using Flutter for almost a year now, I never used Android Studio or Android application development with Java/Kotlin. Most often I get these errors related to Gradle, changing classpaths and implementation and I don't seem to understand any of that.
Any app in the Flutter is created with the help of three languages Dart, C and C++. Here you can also tell that every flutter application is a combination of these three language’s code.
The Entire Flutter framework is created in Dart and it is also used by us to develop an app. Here also notice that we do not directly use C and C++ code to write apps, instead, C and C++ code is used in Graphic rendering engine and Dart Virtual machine to perform their tasks.
Let's dig deeper on how flutter compiles for Android
Graphics Engine’s C and C++ code are compiled with the help of
Android’s NDK (Native Development Kit).
The dart code both SDK’s and ours are compiled through AOT (Ahead-of-Time) compilation process to native ARM and x86 libraries.
After successful compilation, the APK file is generated.
Any widget rendering, input-output, event handling and so on is done by compiled app code.
Here notice that Debug mode builds use a Dart virtual machine to run Dart code in order to enable stateful hot reload.
So related to the folder structure, ios contains part of iOS code and uses CocoaPods to manage dependencies. The android contains part of Android code and uses Gradle to manage dependencies. The lib contains part of Dart code and uses pub to manage dependencies. Cocoapods in iOS corresponds to Podfile and Podfile.lock while pub corresponds to pubspec.yaml and pubspec.lock.
The iOS/Android project under Flutter is still essentially a standard iOS/Android project. Flutter only generates and embeds App.framework and Flutter.framework (iOS) by adding a shell to the BuildPhase. Flutter also adds flutter.jar and vm/isolate_snapshot_data/instr (Android) through gradle to compile Flutter-related code and embed them into a native App.
If you want more depth information about the compilation process see this article https://www.alibabacloud.com/blog/an-in-depth-understanding-of-flutter-compilation-principles-and-optimizations_597747

Can I debug flutter android plugins from within VSCode?

I expect the answer is 'no' from what I've already found, but thought I'd ask the specific question.
I have a Flutter app which via a channel calls into an android plugin the java source for which is in the app source tree. Since one can also do java development in VS Code, I thought there might be a way to step into the plugin code while debugging the Flutter app, but so far no luck - the app doesn't "see" that the source for the plugin it's using is open in a VSC editor. Is there a way to configure for this? I've already installed the Java coding support extensions for VSC.
I like VSC because it's so lightweight, but if I have to use Android Studio to be able to code & debug both flutter and java plugin code in the same app that's fine. In which case how to configure for that?
Thanks!

How to unit test a cordova plugin using Junit?

I've done some Cordova plugins and I would like to write unit tests on it. The idea is that, after I run cordova build android, for example, the test files would be moved to the correct folder on Android and I could run tests with Java. Is that possible?
I've seen some plugins to make possible to test a Cordova plugin, like cordova plugin test framework. The problem here is that it only tests the call and the callback. It's not possible to mock objects, for example. For instance, I have a plugin to track GPS and I would like to test it.
I also would like to test the iOS side as well.
You were right in your research that the current tests for the Cordova Core plugins are all using cordova-plugin-test-framework to implement tests that are run on the device with e.g. cordova-paramedic or cordova-mobile-spec (see the CI configuration in the GitHub repositories on how to trigger a build with cordova-paramedic for example).
The only Cordova projects where "normal" unit tests, written in Java for Android and Obj-C for iOS, are used are the platforms. For Android for example this folder exists: https://github.com/apache/cordova-android/tree/master/test These tests can be run via run_java_unit_tests.js, which is also available via npm as npm run java-unit-tests.
I am pretty sure the same concept could be applied to plugin tests.
(Please let me know if you try and this actually works!)

How to re"build" an already-working open source mobile app in IntelliJ?

I want to write a few unit tests in IntelliJ to test out an app I have found on F-Droid called AAT. I want to use the source code available on F-Droid to build the application in IntelliJ/run it on an emulator/test the application using a few unit tests that I've written in IntelliJ.
However, I'm confused about how I would upload the source code for an app in IntelliJ. How would I use the source code for an app to "build" it in IntelliJ? Also, how would I have to structure my project files to be able to run my unit tests on the application once its been built?
Please let me know if I'm not being clear enough, thank you.
I was able to do this by creating a new project from version control (Github) and specifying the url for the project repository on Github!

TFS automated build setup for android application

I am developing an android application. TFS is used for version control. Even the automated build also needs to setup for the android app on TFS server.
It would be great If anyone can guilde me on this.
This is a really broad question, so I'm giving you a really broad answer:
Install the Java SDK, the Android SDK, and whatever you need to build your application on your build agent(s).
Create a custom build process template (or find one online) that can execute an ANT or Maven script.

Categories

Resources