How to edit plugin to make it working for Desktop Application - flutter

i'm working on a task for detecting USB connected devices (printers) for Flutter desktop application. I found many plugins but they are not working on desktop app. The code throws exception in detecting list of connected USB devices The exception it throws is
No implementation found for the method listDevices for the channel usb_serial
How i can change that plugin for desktop, to find USB connected devices/or any other solution?

By definition, a Flutter plugin has native code for each platform. That error is because you're using a plugin that has not been implemented for your platform.
The way you would change the plugin to make it work would be to write an implementation of that plugin's native code for each desktop platform you want to add support for.

You need to write some c++ code, and see if you can find some native usb lib to make calls on.

Related

Generate HarmonyOS (Huawei) build from Flutter project

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.

How use native code in desktop flutter app?

I wanted to ask you about the desktop part of the technology.
If the documentation is about how ordinary developers can inject native code into a desktop application (WPF, Mac, Linux) like buinding or as a custom plugin or something similar
Best regards, Vadim
You have all the same options for platform code on desktop that you do on mobile:
Adding it directly to the native runner app that's created by flutter create
Writing a plugin
FFI

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

AppWarp Unity SDK fails to connect with CONNECTION_ERROR error

I'm running into this basic issue while integrating the AppWarp Unity SDK (no version is specified, downloaded on 10 of March) with Unity 4.3.4 Android player.
The AppWarpVikingMobile sample fails with the same error.
"telnet appwarp.shephertz.com 12346" does connect to the server. Wireshark shows no packets (running with a filter "host appwarp.shephertz.com").
There is a similar issue asked here on February, but it is unresolved still.
Seems that it's SDK import/compatibility issue.
Any ideas?
When running in the player you have to use the AppWarpUnity.dll asset. Its only when building the apk to run on a physical device you need to build with AppWarpUnityMobile.dll asset (and NOT AppWarpUnity.dll) along with the native plugins provided.
It can be a bit confusing because Unity has different restrictions on different versions (Pro and Free) for different platforms with regards to plugins and sockets. AppWarp's goal is to give developers a way to use it with or without the Unity Pro on all platforms.
The interface exposed by the assets is the same so your application code need not change.

Chromium Embedded Framework (CEF) dependencies

Looking for a nice and efficient way to render GUI in a game engine I gave a look at the Chromium Embedded Framework (CEF). From what I've seen it is doing is job nicely but I'm wondering what are the requirement and dependencies for the CEF.
For each platform I've seen in the source code dependencies to a specific toolkit (gtk for Linux, Win32 API for Windows and so on) Would it run on platforms other than the desktop platforms ? Like Android, iOS, and consoles (Playstation, Xbox) ?
Chromium is switching to Aura UI. CEF on Windows is already using Aura, Linux will use Aura instead of GTK soon. You can read here on what is Aura. In short it's a non-native UI toolkit, the only native element is the toplevel window, everything inside is drawn by chrome.
CEF currently supports only Windows/Linux/OSX. CEF may support Android in the future but there is no schedule at this time. Try searching the CEF Forum for "android": http://www.magpcss.org/ceforum/search.php?keywords=android
For now, on Android you could use Chromview:
https://github.com/pwnall/chromeview