Android + iOS
This is an epic issue to track AUI's support on mobile platforms to catch up Windows/Linux.
- [x] #369
- [ ] #370
- [ ] #371
(Offtop)
Gtk recently merged a PR that introduces initial Android support.
- There's a bundler script that generates Android Studio project, similar to
aui.buid.android.cmake - Their implementation lack IME as well
Generally, I think their Android support state is relatively at the same level as in AUI.
I've created a sample Flutter project. The project generator made directories on a per-platform basis. Each directory contains platform-specific projects.
- Windows: a C++ CMake project with WinAPI
- Linux: a C++ CMake project with GTK
- macOS: an Xcode project with AppKit
- Android: an Android Studio project with MainActivity extending some FlutterActivity (not Compose)
- iOS: an Xcode project with UIKit
- Web: just an html page with some bootstrap JS script (I kinda expected another C++ project with Emscripten)
I sort of like the idea of such project structure. The current approach of generating respective platform project does the job, but its limited to plain simple applications. If you want to make a native extension in Flutter or open Xcode/Android Studio, it's elegantly simple because you have a project already.
There are several problems to solve:
- how to deploy a platform specific project? Flutter provides
flutterCLI tool and IDE extensions that do the job. We have aCMakeLists.txtonly. Maybe we can reuse-DAUI_BUILD_FOR=flag somehow. - how to provide common functionality with
aui_appsuch as specifying application name and icon and yet support native-specific things (i.e., Android's multilayer icons). Flutter leaves those things up to the user. So, if you want to update an icon, you'd have to do that for all platforms manually, handling platform specific things as well. If we were talking about desktop platforms, it's a relatively easy problem; but the complexity and differences on mobile OSes simply don't allow us to provide a unified way to handle this. Again, I like the simplicity of Flutter's solution, but it leaves me unsatisfied.
We can't handle everything. We can't cover everyone's use case. The best way to implement some platform specific thing on a mobile is to implement it natively (Kotlin/Swift, respectively). As such, we need a convenient way to allow our users to implement things natively. AUI can provide C++ bindings for some things but considering the fact Flutter didn't do this with all their manpower leading me to the decision we must do the same way.
I was thinking about safe areas and edge to edge mode and came to conclusion it should be implemented as global margin property you can embed in your UI.
Qt 6.9 has released providing this feature which implemented exactly the same how I wanted. https://www.qt.io/blog/expanded-client-areas-and-safe-areas-in-qt-6.9
https://docs.flutter.dev/packages-and-plugins/using-packages
State of things at the moment.
https://aui-framework.github.io/develop/md_docs_2App_01Build_01Overview.html
React autolinking