aui icon indicating copy to clipboard operation
aui copied to clipboard

Android + iOS

Open Alex2772 opened this issue 1 year ago • 6 comments

This is an epic issue to track AUI's support on mobile platforms to catch up Windows/Linux.

  • [x] #369
  • [ ] #370
  • [ ] #371

Alex2772 avatar Dec 04 '24 02:12 Alex2772

(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.

Alex2772 avatar Feb 13 '25 13:02 Alex2772

I've created a sample Flutter project. The project generator made directories on a per-platform basis. Each directory contains platform-specific projects.

Image

  • 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 flutter CLI tool and IDE extensions that do the job. We have a CMakeLists.txt only. Maybe we can reuse -DAUI_BUILD_FOR= flag somehow.
  • how to provide common functionality with aui_app such 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.

Alex2772 avatar Apr 18 '25 01:04 Alex2772

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

Alex2772 avatar Apr 21 '25 03:04 Alex2772

https://docs.flutter.dev/packages-and-plugins/using-packages

Alex2772 avatar May 14 '25 07:05 Alex2772

State of things at the moment.

https://aui-framework.github.io/develop/md_docs_2App_01Build_01Overview.html

Image

Alex2772 avatar May 16 '25 02:05 Alex2772

React autolinking

Image

Alex2772 avatar Nov 07 '25 10:11 Alex2772