AvaloniaUI / Avalonia

Develop Desktop, Embedded, Mobile and WebAssembly apps with C# and XAML. The most popular .NET UI client technology
https://avaloniaui.net
MIT License
25.6k stars 2.21k forks source link

Android/iOS stability and scalability? #1602

Closed danwalmsley closed 2 years ago

danwalmsley commented 6 years ago

Issue moved from: https://github.com/VitalElement/AvalonStudio/issues/651

danwalmsley commented 6 years ago

@angelsix said: I have some open source projects I will be making Android/iOS apps on shortly, and I hate Xamarin, used it for many years now and its awful and full of bugs and has been all along. I do training videos and have quite a following now, and even though I will teach Xamarin as people want those lessons, I know how awful Xamarin is and would like to find a better cross platform solution. I've in fact been looking at making my own full cross-platform UI for Win/Linux/Mac/iOS as could not find any and then one of the guys who watches my videos pointed me to this project. It looks very promising. My question is more about the performance and scale-ability of this framework. For example what do you compile down to for Android/iOS and how are you doing the lists, virtualization, rendering etc... Is it something simple like a web browser hosted inside the app or is it compiled to native storyboards/layout files like you would build natively for the platforms? Also what support do you have for all the mobile specific features like background modes, notifications, sharing intents, lifecycle events and so on?

danwalmsley commented 6 years ago

@angelsix

Avalonia is just reaching a point where a few commercial projects are starting to adopt. We are now at a stage where we are in Beta and there are a few bugs, but on the whole the UI framework is stable and useable for all kinds of projects on the Desktop.

@kekekeks can provide more information regarding IOS / Android, although I believe these compile to .NET assemblies, with some .net runtime stuff need to make it run.

The rendering is native rendering, we use Direct2D /Skia on Windows, on Linux with use Skia, on Mac we use MonoMac (I think) we use GTK for window management on those platforms too.

Avalonia provides real applications (not a web browser pretending to be an app).

Avalonia is most closely related to WPF, then UWP, it uses lookless templated controls, so its a truly cross platform UI. You can achieve the exact same UI on all platforms, obviously you can customize UI to a specific platform too.

We don't use native controls, although some work has been done to allow embedding native controls on some platforms.

Regarding Mobile specific features, you can just use our UI with the Xamarin libraries or the native platform libraries directly for this kind of stuff.

Our mobile 'backends' as we call them are a little behind the Desktop, as we have fewer people contributing in that area, and are kind of considered experimental / alpha, whereas desktop apps are pretty much stable now.

It wouldn't take much to get the mobile backends up to scratch though, we mainly just need to add proper touch integration (we currently only have mouse pointers in the framework).

We would love to hear your feedback and it would be awesome to see a tutorial video on Avalonia from you at some stage if you wanted I could help get you started.

BTW I really like your WPF tutorial videos they are really high quality, I will start sending people there that come here with MVVM getting started type questions :)

angelsix commented 6 years ago

Cool thanks for the feedback. It sounds promising and perhaps something to finally bring not just desktop but mobile into one unified place. It has huge potential if done right and it was something I was going to make it nobody else did within the next year (I was holding out for MS to do it, and purchasing Xamarin was the first step in that direction). However, I see you have been working on this for a while now and it looks very nice and a lot of advanced and user-friendly features.

I will likely look at this in my spare time to get comfortable and a feel for it and if it seems good probably make a real simple application that will run on all 5 platforms and then if that works do videos on it. Pretty exciting stuff, keep up the good work

EndlessDelirium commented 5 years ago

We tried out the ControlCatalog on both Android and iOS. Apart from making a quick fix for #2228 we also had to add ReactiveUI to the startup projects and change the target version to 8.0 in the android project. Afterwards the app successfully launched on both mobile targets. There are multiple issues tough:

Things aren't yet as smooth as on the desktop platforms and there still seems to be quite a bit of work left to get there. I really like the concept of Avalonia but think that it is crucial for its success that the mobile targets aren't treated like second class citizens. Question likely is whether there are other parties that are interested in helping pushing the mobile targets forward.

image

image

kekekeks commented 5 years ago

For running properly on mobile platforms we still require the following:

General infrastructure:

Missing bits in mobile backends:

Not sure what happened to keyboard, but we were using some hacks for detecting if currently focused control is a TextBox.

EndlessDelirium commented 5 years ago

@kekekeks: are there any ballpark estimates what it would take to get first class mobile support?

kekekeks commented 5 years ago

I would say 2020 Q2 with our current scarce resources. The problem is that mobile support isn't currently actively worked on by anyone. I've made an updated roadmap which contains some features needed for mobile planned for 0.8 release (namely touch support and IM) that I'm planning to work on this year.

We could circumvent the need of IM support by reusing our old hack (iOS, Android), not sure why it doesn't work anymore. XAML compilation is nice to have but not exactly required.

But that's probably it. Help with mobile backends would be very appreciated.

EndlessDelirium commented 5 years ago

Unfortunately this is a bit of a hen-egg problem. A possible involvement from our side would require other backers that are committed to help considerably speed up things and ensure long term maintenance.

kekekeks commented 5 years ago

I'll take a shot at mobile backend re-animation after getting touch support this spring, since I'll need to update them to make sure I'm not missing anything touch-input related. The set of new features probably would be popup support for iOS and GPU acceleration.

DenisLanks commented 5 years ago

Hi guys, good job. How can I contribute to this project?

danwalmsley commented 5 years ago

best to get in touch via https://gitter.im/AvaloniaUI/Avalonia to see how best you can contribute :) welcome

lorean-devries commented 4 years ago

I want to suggest Avalonia to my company for a fully cross platform app, but I'm unsure if Android/iOS support has been fixed ?

kekekeks commented 4 years ago

There were several things in the core framework that needed to be done before further attempts to get mobile platforms working:

Until at least those are ready it's kinda pointless to "fix" the mobile platform support, since we won't be able to deliver a proper UX anyway. There are also ongoing work on performance optimizations which are kinda required for low-power devices.

There is a chance of getting it till the end of the year, but I can't promise that right now.

lastlink commented 4 years ago

I wonder if some of the drawing can be pulled over from the dart flutter project since it also uses skia for it's gui engine.

ILAgent commented 4 years ago

It would be great if you concentrated on mobile because the world is mobile-first today. Everybody wants to make a mobile app, not desktop. I don't like Flutter due to awful Dart but now is the best solution unfortunately.

MappingSteve commented 4 years ago

@lastlink - it sounds like drawing is not an issue.

@kekekeks - when .Net 5 releases, will that cover your issues with running on iOS and Android?

My brief reading of .NET 5 is that it includes the essential mobile parts of Xamarin: doing that well from C# is what made Xamarin valuable. In my experience, Xamarin as ".Net Core on mobile platforms" works very smoothly - if you write the UI using Xamarin's "native" bindings for each platform's UI. (The cross-platform UI - Xamarin Forms - is the part that needs to be replaced by Avalonia.)

My point being that your project should -soon- not have to write much Android and iOS specific code, if Microsoft has done their job fully.

Shayan-To commented 3 years ago

@kekekeks Will you give us an update on how things are going?

kekekeks commented 3 years ago

iOS: mostly working: some initialization issue that causes black screen until screen rotation, works completely fine in simulator, will probably ship a fixed version with 0.10.1 or something Android: no progress so far

ili commented 3 years ago

Android: no progress so far

Any plans/dates? :)

kekekeks commented 3 years ago

https://github.com/AvaloniaUI/Avalonia/pull/5328 https://github.com/AvaloniaUI/Avalonia/pull/5331 https://github.com/AvaloniaUI/Avalonia/pull/5337

danwalmsley commented 3 years ago

@ili quite a lot of progess. its probably ready for people to start beta testing... expecting a few rough edges to help find what still needs doing.

ili commented 3 years ago

@danwalmsley sounds really cool! I'll look forward to start porting my project to Avalonia!

FloridaMatt commented 3 years ago

I'd appreciate a clue or two about what I'm doing wrong here. I'm on a Mac running Big Sur 11.1. I need to figure out how to set up an Avalonia IOS project to I can recreate an ios app I created with Windows & Xamarin. I downloaded the Avalonia-Master, went to Samples/ControlCatalog.IOS, and double-clicked on the .sln file to start Visual Studio. Got the following:

Getting restore information for project /Users/t/Downloads/Avalonia-master/samples/ControlCatalog.iOS/ControlCatalog.iOS.csproj /Users/t/.nuget/packages/msbuild.sdk.extras/2.0.54/Sdk/Sdk.props(25,3) : warning MSB4011: "/usr/local/share/dotnet/sdk/5.0.102/Sdks/Microsoft.NET.Sdk.WindowsDesktop/targets/Microsoft.NET.Sdk.WindowsDesktop.props" cannot be imported again. It was already imported at "/usr/local/share/dotnet/sdk/5.0.102/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.props (147,3)". This is most likely a build authoring error. This subsequent import will be ignored. [/Users/t/Downloads/Avalonia-master/src/iOS/Avalonia.iOS/Avalonia.iOS.csproj] /usr/local/share/dotnet/sdk/5.0.102/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.EolTargetFrameworks.targets(28,5) : warning NETSDK1138: The target framework 'netcoreapp2.0' is out of support and will not receive security updates in the future. Please refer to https://aka.ms/dotnet-core-support for more information about the support policy. /usr/local/share/dotnet/sdk/5.0.102/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.EolTargetFrameworks.targets(28,5) : warning NETSDK1138: The target framework 'netcoreapp2.0' is out of support and will not receive security updates in the future. Please refer to https://aka.ms/dotnet-core-support for more information about the support policy. Running non-parallel restore. Reading project file /Users/t/Downloads/Avalonia-master/samples/ControlCatalog.iOS/ControlCatalog.iOS.csproj. The restore inputs for 'ControlCatalogiOS' have changed. Continuing restore. Restoring packages for /Users/t/Downloads/Avalonia-master/samples/ControlCatalog.iOS/ControlCatalog.iOS.csproj... Restoring packages for Xamarin.iOS,Version=v1.0... Resolving conflicts for Xamarin.iOS,Version=v1.0... Scanning packages for runtime.json files... Restoring packages for Xamarin.iOS,Version=v1.0/win... Resolving conflicts for Xamarin.iOS,Version=v1.0/win... Restoring packages for Xamarin.iOS,Version=v1.0/win-x64... Resolving conflicts for Xamarin.iOS,Version=v1.0/win-x64... Restoring packages for Xamarin.iOS,Version=v1.0/win-x86... Resolving conflicts for Xamarin.iOS,Version=v1.0/win-x86... Unable to find project information for '/Users/t/Downloads/Avalonia-master/samples/ControlCatalog/ControlCatalog.csproj'. If you are using Visual Studio, this may be because the project is unloaded or not part of the current solution so run a restore from the command-line. Otherwise, the project file may be invalid or missing targets required for restore. Unable to find project information for '/Users/t/Downloads/Avalonia-master/src/Avalonia.Animation/Avalonia.Animation.csproj'. If you are using Visual Studio, this may be because the project is unloaded or not part of the current solution so run a restore from the command-line. Otherwise, the project file may be invalid or missing targets required for restore. Unable to find project information for '/Users/t/Downloads/Avalonia-master/src/Avalonia.Base/Avalonia.Base.csproj'. If you are using Visual Studio, this may be because the project is unloaded or not part of the current solution so run a restore from the command-line. Otherwise, the project file may be invalid or missing targets required for restore. Unable to find project information for '/Users/t/Downloads/Avalonia-master/src/Avalonia.Controls/Avalonia.Controls.csproj'. If you are using Visual Studio, this may be because the project is unloaded or not part of the current solution so run a restore from the command-line. Otherwise, the project file may be invalid or missing targets required for restore. Unable to find project information for '/Users/t/Downloads/Avalonia-master/src/Avalonia.Diagnostics/Avalonia.Diagnostics.csproj'. If you are using Visual Studio, this may be because the project is unloaded or not part of the current solution so run a restore from the command-line. Otherwise, the project file may be invalid or missing targets required for restore. Unable to find project information for '/Users/t/Downloads/Avalonia-master/src/Avalonia.Input/Avalonia.Input.csproj'. If you are using Visual Studio, this may be because the project is unloaded or not part of the current solution so run a restore from the command-line. Otherwise, the project file may be invalid or missing targets required for restore. Unable to find project information for '/Users/t/Downloads/Avalonia-master/src/Avalonia.Interactivity/Avalonia.Interactivity.csproj'. If you are using Visual Studio, this may be because the project is unloaded or not part of the current solution so run a restore from the command-line. Otherwise, the project file may be invalid or missing targets required for restore. Unable to find project information for '/Users/t/Downloads/Avalonia-master/src/Avalonia.Layout/Avalonia.Layout.csproj'. If you are using Visual Studio, this may be because the project is unloaded or not part of the current solution so run a restore from the command-line. Otherwise, the project file may be invalid or missing targets required for restore. Unable to find project information for '/Users/t/Downloads/Avalonia-master/src/Avalonia.Styling/Avalonia.Styling.csproj'. If you are using Visual Studio, this may be because the project is unloaded or not part of the current solution so run a restore from the command-line. Otherwise, the project file may be invalid or missing targets required for restore. Unable to find project information for '/Users/t/Downloads/Avalonia-master/src/Avalonia.Themes.Default/Avalonia.Themes.Default.csproj'. If you are using Visual Studio, this may be because the project is unloaded or not part of the current solution so run a restore from the command-line. Otherwise, the project file may be invalid or missing targets required for restore. Unable to find project information for '/Users/t/Downloads/Avalonia-master/src/Avalonia.Visuals/Avalonia.Visuals.csproj'. If you are using Visual Studio, this may be because the project is unloaded or not part of the current solution so run a restore from the command-line. Otherwise, the project file may be invalid or missing targets required for restore. Unable to find project information for '/Users/t/Downloads/Avalonia-master/src/iOS/Avalonia.iOS/Avalonia.iOS.csproj'. If you are using Visual Studio, this may be because the project is unloaded or not part of the current solution so run a restore from the command-line. Otherwise, the project file may be invalid or missing targets required for restore. Unable to find project information for '/Users/t/Downloads/Avalonia-master/src/Markup/Avalonia.Markup.Xaml/Avalonia.Markup.Xaml.csproj'. If you are using Visual Studio, this may be because the project is unloaded or not part of the current solution so run a restore from the command-line. Otherwise, the project file may be invalid or missing targets required for restore. Unable to find project information for '/Users/t/Downloads/Avalonia-master/src/Markup/Avalonia.Markup/Avalonia.Markup.csproj'. If you are using Visual Studio, this may be because the project is unloaded or not part of the current solution so run a restore from the command-line. Otherwise, the project file may be invalid or missing targets required for restore. Unable to find project information for '/Users/t/Downloads/Avalonia-master/src/Skia/Avalonia.Skia/Avalonia.Skia.csproj'. If you are using Visual Studio, this may be because the project is unloaded or not part of the current solution so run a restore from the command-line. Otherwise, the project file may be invalid or missing targets required for restore. Committing restore... Assets file has not changed. Skipping assets file writing. Path: /Users/t/Downloads/Avalonia-master/samples/ControlCatalog.iOS/obj/project.assets.json Writing cache file to disk. Path: /Users/t/Downloads/Avalonia-master/samples/ControlCatalog.iOS/obj/project.nuget.cache Persisting dg to /Users/t/Downloads/Avalonia-master/samples/ControlCatalog.iOS/obj/ControlCatalog.iOS.csproj.nuget.dgspec.json Failed to restore /Users/t/Downloads/Avalonia-master/samples/ControlCatalog.iOS/ControlCatalog.iOS.csproj (in 383 ms).

NuGet Config files used: /Users/t/Downloads/Avalonia-master/NuGet.Config /Users/t/.config/NuGet/NuGet.Config

Feeds used: https://api.nuget.org/v3/index.json https://nuget.avaloniaui.net/repository/avalonia-devdeps/index.json

Unable to find project information for '/Users/t/Downloads/Avalonia-master/samples/ControlCatalog/ControlCatalog.csproj'. If you are using Visual Studio, this may be because the project is unloaded or not part of the current solution so run a restore from the command-line. Otherwise, the project file may be invalid or missing targets required for restore. Unable to find project information for '/Users/t/Downloads/Avalonia-master/src/Avalonia.Animation/Avalonia.Animation.csproj'. If you are using Visual Studio, this may be because the project is unloaded or not part of the current solution so run a restore from the command-line. Otherwise, the project file may be invalid or missing targets required for restore. Unable to find project information for '/Users/t/Downloads/Avalonia-master/src/Avalonia.Base/Avalonia.Base.csproj'. If you are using Visual Studio, this may be because the project is unloaded or not part of the current solution so run a restore from the command-line. Otherwise, the project file may be invalid or missing targets required for restore. Unable to find project information for '/Users/t/Downloads/Avalonia-master/src/Avalonia.Controls/Avalonia.Controls.csproj'. If you are using Visual Studio, this may be because the project is unloaded or not part of the current solution so run a restore from the command-line. Otherwise, the project file may be invalid or missing targets required for restore. Unable to find project information for '/Users/t/Downloads/Avalonia-master/src/Avalonia.Diagnostics/Avalonia.Diagnostics.csproj'. If you are using Visual Studio, this may be because the project is unloaded or not part of the current solution so run a restore from the command-line. Otherwise, the project file may be invalid or missing targets required for restore. Unable to find project information for '/Users/t/Downloads/Avalonia-master/src/Avalonia.Input/Avalonia.Input.csproj'. If you are using Visual Studio, this may be because the project is unloaded or not part of the current solution so run a restore from the command-line. Otherwise, the project file may be invalid or missing targets required for restore. Unable to find project information for '/Users/t/Downloads/Avalonia-master/src/Avalonia.Interactivity/Avalonia.Interactivity.csproj'. If you are using Visual Studio, this may be because the project is unloaded or not part of the current solution so run a restore from the command-line. Otherwise, the project file may be invalid or missing targets required for restore. Unable to find project information for '/Users/t/Downloads/Avalonia-master/src/Avalonia.Layout/Avalonia.Layout.csproj'. If you are using Visual Studio, this may be because the project is unloaded or not part of the current solution so run a restore from the command-line. Otherwise, the project file may be invalid or missing targets required for restore. Unable to find project information for '/Users/t/Downloads/Avalonia-master/src/Avalonia.Styling/Avalonia.Styling.csproj'. If you are using Visual Studio, this may be because the project is unloaded or not part of the current solution so run a restore from the command-line. Otherwise, the project file may be invalid or missing targets required for restore. Unable to find project information for '/Users/t/Downloads/Avalonia-master/src/Avalonia.Themes.Default/Avalonia.Themes.Default.csproj'. If you are using Visual Studio, this may be because the project is unloaded or not part of the current solution so run a restore from the command-line. Otherwise, the project file may be invalid or missing targets required for restore. Unable to find project information for '/Users/t/Downloads/Avalonia-master/src/Avalonia.Visuals/Avalonia.Visuals.csproj'. If you are using Visual Studio, this may be because the project is unloaded or not part of the current solution so run a restore from the command-line. Otherwise, the project file may be invalid or missing targets required for restore. Unable to find project information for '/Users/t/Downloads/Avalonia-master/src/iOS/Avalonia.iOS/Avalonia.iOS.csproj'. If you are using Visual Studio, this may be because the project is unloaded or not part of the current solution so run a restore from the command-line. Otherwise, the project file may be invalid or missing targets required for restore. Unable to find project information for '/Users/t/Downloads/Avalonia-master/src/Markup/Avalonia.Markup.Xaml/Avalonia.Markup.Xaml.csproj'. If you are using Visual Studio, this may be because the project is unloaded or not part of the current solution so run a restore from the command-line. Otherwise, the project file may be invalid or missing targets required for restore. Unable to find project information for '/Users/t/Downloads/Avalonia-master/src/Markup/Avalonia.Markup/Avalonia.Markup.csproj'. If you are using Visual Studio, this may be because the project is unloaded or not part of the current solution so run a restore from the command-line. Otherwise, the project file may be invalid or missing targets required for restore. Unable to find project information for '/Users/t/Downloads/Avalonia-master/src/Skia/Avalonia.Skia/Avalonia.Skia.csproj'. If you are using Visual Studio, this may be because the project is unloaded or not part of the current solution so run a restore from the command-line. Otherwise, the project file may be invalid or missing targets required for restore. Restore failed.

ili commented 3 years ago

@FloridaMatt please look at https://github.com/AvaloniaUI/Avalonia/blob/master/Documentation/build.md

Also check global.json near the Avalonia.sln there is an actual SDK used, you should either install provided version, or define one you installed

robloo commented 3 years ago

@ili quite a lot of progess. its probably ready for people to start beta testing... expecting a few rough edges to help find what still needs doing.

Really looking forward to seeing the outcome of this. I'm especially concerned about performance which no one seems to have gotten right at this point. XAML-tech is very resource intensive as you know.

Anyway, the status of iOS and other mobile backends may drastically tip the scales towards Avalonia very quickly. I hope the code is made public and integrated into the main repo soon.

kekekeks commented 3 years ago

@robloo somewhat functional iOS support is available in 0.10. It's a bit broken on actual devices (black screen until you rotate the screen for some reason), but everything works perfectly in emulator.

ili commented 3 years ago

Just a point about current experience. Avalonia requres significant memory & processor resources. For ex one of my test devices - Samsung J5 DUOS (J500H) fails to even start demo application (not control catalog, but one page demo app)....

XamarinForms applications worsk fine at the same time... Google Chrome too (i do suppose Chrome on Android uses Skia?).

robloo commented 3 years ago

Any updates on this?

  1. I last heard somewhere else that most of the iOS work was being done in a private repo somewhere. I assume that is for a commercial customer. I have a small concern that work will never actually get back into Avalonia publicly.
  2. It was planned to have the mobile backends complete for 0.11. I haven't seen a lot of progress on it and the year is already over halfway complete. I'm not sure if this will stabilize in time. Android was made to work again though no packages were released, iOS we hear is in better shape.
  3. x:Load (deferred loading of entire branches of the visual tree) is almost mandatory for mobile devices. I've so far heard no mention of something similar in Avalonia. This was learned with UWP and also is quite important with the Uno Platform. XAML performance on mobile is difficult and it is likely not possible to load the entire visual tree during initialization of a view as done on desktop.
maxkatz6 commented 3 years ago

@robloo that's true, that iOS and Android backends work now, although some planned functionality is still missed (such as IME, which only recently came to Linux and is coming to Windows). These backends are not considered as production ready, and that's the only reason why Avalonia.Android wasn't updated on nuget (but IMO it could be, just with preview tag). I am not sure about forked internal iOS implementation, and if it was merged back or does it make any difference. @kekekeks

Also, tbh, I wouldn't really push development of these backend until we have stable .NET 6 that can replace old MonoXamarin. But it's my personal opinion.

x:Load (deferred loading of entire branches of the visual tree) is almost mandatory for mobile devices

I would argue that it makes huge difference. But if developers use it everywhere it is possible and makes sense, in overall it actually might make that difference. Anyway, it should be discussed here https://github.com/AvaloniaUI/Avalonia/issues/1434

shanoaice commented 3 years ago

I'm curious if there is any guide about developing AvaloniaUI Apps for mobile device? Is there any special changes needed to be made in my code for it to work on mobile platforms, or should I just add Avalonia.Mobile package to my codebase and add corresponding build targets for it? Sorry for interruption if this question is Off-Topic.

kekekeks commented 3 years ago

@shanoaice

Note: mobile backends are not considered to be production-ready. E. g. iOS one has issues on some devices when screen is black until the first screen orientation change. If you are really interested in mobile support, contact us, we might figure something.

Answer: You can keep your entire app in a netstandard2.0 library (or keep it as is and use multitargeting with conditional compilation to remove the Program class and Avalonia.Desktop reference from your netstandard2.0 build) and reference it from Xamarin.iOS/Xamarin.Android project. Then you can just use any of your UserControl's as the main view. For iOS it's rather simple, you just create an empty app and replace the AppDelegate with

    [Register("AppDelegate")]
    public partial class AppDelegate : AvaloniaAppDelegate<App>
    {

    }

where App is the App class from your application. The IApplicationLifetime that you receive in OnFrameworkInitializationCompleted will implement ISingleViewApplicationLifetime rather than IClassicDesktopStyleApplicationLifetime, so your App.xaml.cs will have something like this

        public override void OnFrameworkInitializationCompleted()
        {
            if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktopLifetime)
                desktopLifetime.MainWindow = new MainWindow();
            else if (ApplicationLifetime is ISingleViewApplicationLifetime singleViewLifetime)
                singleViewLifetime.MainView = new MainView();

            base.OnFrameworkInitializationCompleted();
        }

Those are the only required changes to your application aside from the lack of Window class support on mobile platforms. If you are only using a single view like our control catalog, no other changes are required, you can keep the codebase nice and clean.

ili commented 3 years ago

Just FYI I'v checked Avalonia.AndroidTestApplication on my Samsung J5 DUOS (J500H) now it can start and even responsive. ControlCatalog.Android starts too but hungs (not responsive), i do suppose this is because of some error with libEGL i see in debug output (hundreds of them):

[libEGL] eglCreateWindowSurface: native_window_api_connect (win=0x7b0f5008) failed (0xffffffea) (already connected to another API?)
[libEGL] eglCreateWindowSurface:481 error 3003 (EGL_BAD_ALLOC)

Also I'v just finished small project where Avalonia was used for simple UI rendering on SCV500 device (Ubuntu Core, rendering to the framebuffer). Simple ui means TextBlocks, Images, Grids, and ProgressBar. Success! :)

I do writing this to make a point: 1) Some optimization was done for past months, and that is really cool! :) 2) In all the cases i do see long startup time (Skia or smth else takes a long time to initialize)

In general - things are comming better :))

ili commented 2 years ago

Things are coming better!

Coming back with my poor old test phone with the latest master. Control catalog app starts & responsive. I do see gaps on pages switching (in general problems are on pages with "many" controls, for ex, 6 seconds are needed to show calendar in date picker), also long startup (splash is shown for 10 seconds and then black screen for 30 seconds), but anyway it works and alive!

Super, great job is done!

PS also tried net6-android, from #6922 hangs as on previous test with plenty

[libEGL] eglCreateWindowSurface: native_window_api_connect (win=0x7b0f5008) failed (0xffffffea) (already connected to another API?)
[libEGL] eglCreateWindowSurface:481 error 3003 (EGL_BAD_ALLOC)
maxkatz6 commented 2 years ago

Mobile backends are now published on nuget. They are stable for net6, but some features are not there yet (file picker...). I am closing this issue. Please open a new one for specific issues/missing features, if there is no one existed.

Templates https://github.com/AvaloniaUI/avalonia-dotnet-templates/pull/79

And sample app https://github.com/AvaloniaUI/Wordle-onia

robloo commented 2 years ago

And plans for single project support to combine Android/iOS? I notice it is still all separate projects.

maxkatz6 commented 2 years ago

@robloo at least when Microsoft will complete them. And so far they seems to be very limited to the maui (in terms of resources/assets). Which means, not earlier than maui release, unless somebody will try to experiment.