Generate HarmonyOS (Huawei) build from Flutter project - flutter

I am working on one Flutter project. In which, We want to generate builds of Android, iOS, and HarmonyOS (Huawei). But I am not sure does Flutter supports this OS or not. I went through some of the stuff on the internet but was unable to figure out how to generate and what kind of commands were needed. Here, Anyone has previously generated HarmonyOS compatible build from the Flutter project. Please share your thoughts.

For now it is not possible directly from Flutter. Because of the change in architecture brought by Huawei with HarmonyOS it is not anymore an "Android device" and it doesn't run "Android applications".
Now what you can call "native HarmonyOS applications" are *.app files (not *.apk or *.aab)
Most recent answer on Quora to:
Will Harmony OS run Android apps?
Gives the following response:
Answered Jun 4, 2021 by Mahdi Parastech, Software Engineer
Nope, because:
The structure of the APIs are different.
Hongmeng (HarmonyOS) apps are in *.app, Android apps are *.apk
The structure of pages (activities) are different, Hongmeng uses some additional json files and puts pages inside *.har files.
Hongmeng uses Javascript too, and that's the only option in Wearable Hongmeng devices, but Android apps are just written in Java.
source
Apparently you should be able to migrate your native android application to HarmonyOS by using their IDE but the thing is that Flutter was not build for this architecture.
Except if the Flutter team decides for some reason to support HarmonyOS I don't think it will be possible to develop HarmonyOS applications by using Flutter.

Related

Android Studio: should I upgrade to Android embedding v2?

I am actively learning dart/flutter, and using Android Studio. Just practicing to learn as much dart as possible. For now, I manly test my code by outputting into console. When I run the code, I get the warning message below (about upgrading to Android embedding v2), see picture. For now, I am not interested in developing apps for Android nor IOS, I am focusing mainly on web apps.
Is the warning below something I should consider upgrading now to Android embedding v2? Or can it wait until I decide to start testing Android apps?
The main reason why I didn't upgrade, it's because I read the Android embedding v2 upgrade instructions, and it requires to edit some files, and I don't want to risk messing up Android Studio, nor Dart, nor Flutter files. Also, this is the first time I use this IDE.
Warning
──────────────────────────────────────────────────────────────────────────────
Your Flutter application is created using an older version of the Android
embedding. It's being deprecated in favor of Android embedding v2. Follow the
steps at
https://flutter.dev/go/android-project-migration
to migrate your project.

Is there a way to import and run a Flutter app as a dependency of another package?

So, I'm thinking of creating a CLI application that could also be used with UI, developed in Flutter.
The idea is that there would be 3 different packages, one for the business logic, one for the CLI and one for the Flutter app. Is there a way to import the Flutter app as a dependency in my CLI package, so I could open the Flutter app from the CLI? If so, how would I do it?
Seems like you want to use 1 library containing the business logic for 2 different applications: Desktop CLI app and mobile app (android/iOS).
It's very much possible with flutter. By default flutter installs only the android and iOS platform supports but by changing few configurations in installed flutter SDK we can extend the same setup to Web and Desktop apps (Windows, MacOS or linux) as well.
Check this official doc for enabling desktop support
Check this official doc for enabling Web support
You can enable these settings in your existing application only.

Flutter Without Emulator

I cannot install the Android Emulator in my working environment, therefore I wondered whether it is possible to code/learn Flutter without any mobile device (or emulator). For example, is it possible to run/test the code by using the browser?
There are two non-mobile options, both of which are currently in development stages but could be used for learning Flutter:
flutter-desktop-embedding, particularly the example which you can check out and flutter run with minimal setup, and then modify.
The Flutter for web technical preview.
Flutter Desktop Launcher for Mac OS/Linux, support hot reload via VS Code
GitHub Link: https://github.com/putraxor/flutter_desktop_launcher

Telerik Nativescript for Blackberry

We know that Blackberry 10 can run Android app. Does somebody tried Telerik Nativescript for Android and make it run for Blackberry 10?
If so, is it possible to explain the steps to be able to do it? Does Webworks gives any help?
Telerik NativeScript for Android does indeed work on BlackBerry OS 10 I've tried on (10.3.2.2474). I'll list some tips to get you started, but please keep in mind that NativeScript doesn't officially support BlackBerry OS.
Deployment with the {N} CLI tool (tns) might be problematic - it produces an apk for the app, but it can't deploy it on the device itself, so you need to transfer it somehow and install it on the device.
Alternatively you can use Telerik AppBuilder to build the app (either version will work - VS plugin, CLI tool, Windows or Web clients) and deploy it on the device via QR code scan and install. However, apk installation is a bit slow process on a BB10, so you may choose to use the NativeScript companion app for development. Deployment to the companion app is done via QR codes - it has an integrated QR code reader - and since no installation is necessary, development cycle is faster. There is a small issue with the app - it may seem to crash on the first run, but you can still find the Sync and Scan buttons in the BlackBerry Hub, which you can use to scan the code and start your app.
Releasing the app in the BlackBerry store is out of my scope, but you can check these documents:
https://developer.blackberry.com/android/documentation/rpkg_with_bb_plugin_for_android_stdio.html
https://developer.blackberry.com/android/documentation/publsh_your_app_to_appworld.html
Make sure you've built the app for release as mentioned.
Let me know if this helps.

Android Wear Deployment VS. Mobile Deployment

I have 2 modules in my project Mobile & Wear because I eventually want to add wear support. I have not done any work to the Wear project, it is just whatever Android Studio generates as part of the project creation template.
I noticed Android Studio creates 2 separate APKs when you do a signed build. I see 1 mobile APK and 1 Wear APK upon signed build.
If I would like to publish only the mobile Module now, and Wear later. Do I just upload the Mobile APK and that's it? Or are there any additional config / code changes necessary?
Thanks.
When you're developing, there's two different apk's as you said, because each one is used to test the app while we are developing.
Once that you want to submit your app to the market, these two .apk will become just one, calling this process "packaging wearable app".
So, if you want have just your mobile .apk, please go to build.gradle(mobile), and comment the code:
wearApp project(':wear')
Basically this line is telling to your compiler, to pack your wear app into your mobile app.