Uno platform: MapControl in not UWP projects - c#

I have a quite big project developed in UWP, and I'm thinking of migrate to Uno Platform with Android, iOS and MacOS users in mind. The biggest and most important part of the project is a MapControl, but I don't know if when migrating the project, in Android, and other OS, the app will continue using BingMaps (with all the tools and things that brings) or will use OS default map provider and engine.
Will be possible to achieve something like that with Uno on other OS that is not Windows?

Direct support for Uno to use the UWP map control isn't available yet, but there are Native Android and iOS versions of the Bing maps SDK available which may be able to be called from Uno.
Here's the SDK getting started page: https://www.microsoft.com/en-us/maps/mobile

Related

Exporting my .NET 7 WinForms app to Linux?

For a project, I build a WinForms application using .NET 7.0. I noticed it must run on Linux so I made some research and found that it's possible to run .NET code with mono but it's not applicable to WinForms. Is there a solution to convert my project without having to make the design of the forms from scratch (like would be the case with mono development)?
Thanks.
What I tried: Installing mono and running my code. It says me that no CLI image was found.
No cross-platform desktop GUI exists in .NET out of the box.
To overcome this issue Microsoft created MAUI although it was announced Linux devices won't get official support.
Your best bet would be to migrate to Avalonia or UNO, both are great open-source, free and feature-rich frameworks built on top of .NET which works on any operating system, including Ubuntu, macOS and Windows.
Both frameworks use XAML dialect which should feel familiar for developers coming from WPF, UWP, or Xamarin Forms.
UNO can be developed using C# markup instead XAML
No XAML needed if you don’t want it – Enjoy a Flutter-like
UI development experience with C# and .NET Hot Reload
by using C# for Markup
Only .NET 7 console app runs (through .NET 7 runtime) on Linux, no WinForms, no WPF.
If you need a .NET desktop app running on Linux, and you are targeting GNOME desktop environment, you could give a try to gtk# based on mono.

How to Render OpenGL on Android with C#?

I have an existing application written in C# for .NET 6 that renders OpenGL with the lightweight OpenTK (v4) OpenGL bindings, which support .NET 5+, Open GL 3+, and OpenGL ES 2+.
According to the OpenTK FAQ:
OpenTK runs on Windows, Linux, and MacOS X.
(Older versions of OpenTK supported Android and iOS as well; current OpenTK might work on these, but it’s untested.)
I am excited by .NET 6's promise of one unified platform, but I have only seen cross-platform mobile projects that use Microsoft's new .NET Multi-platform App UI (.NET MAUI) framework. MAUI appears to be a web view shell that contains a Blazor Web App. I found the code for this shell in the src/Core/AndroidNative folder of the repository, but it seems very bloated for my purposes. I want to be able to access Android-specific functions without the bloat of Blazor and a web view. According to this blog post, Xamarin.Android might be the answer, but I am not sure how to introduce it into my existing project.
All I need is a simple shell that:
Creates an Activity with a GLSurfaceView
Obtains an OpenGL ES 2 context
Runs my current C# code with that context
I would prefer the shell to be in C#, since introducing Java code would complicate my build process and fragment my code base.
How can I introduce the needed Android-specific code?
How will this change my build process?
I know that I need to write OpenGL ES-compatible shaders and that I probably need to change how I save files. What other changes will I need to make to my current code to ensure Android compatibility?

Net Core 3.0 and desktop applications

I just read that there is possibility to develop Windows Forms using .NET Core 3.0. Unfortunetly designer is still under development and not available. I also read that even if Windows Forms can be done using Core 3.0 that doesn't mean that it can run on either MAC or OS (same with WPF). My question is what is then the sense of it if it cannot be deployed on diffrent systems besides Windows? What type of desktop application can i really develop to be able to deploy on various systems rather than Windows forms?
That's because Microsoft seems to plan to retire the original .net and just focus on developing .netcore. My suggestion is to build application using web technologies. This way you have the best of both worlds either build web application or develop cross platform apps using something like electron.js
there are so many great apps built with electron like Vs Code or Github
There are many use cases for Windows-only desktop applications, particularly in the corporate world where applications are for internal use.
If you need a cross platform application I would suggest either a web application, or you could consider Electron.
AvaloniaUI (A cross platform XAML Framework for .NET Framework, .NET Core and Mono) would be a perfect choice if you are familiar with WPF.
There are many other frameworks to develop cross-platform desktop apps. You can checkout my github repo electron-alternatives for more cross-platform desktop development options.

In Xamarin, does using a Portable Class Library mean you do not write platform specific code?

My understanding is the compiler directives in a Share Access Project (SAP) make use of platform specific code.
For SAP Xamarin has,
Application projects can include platform-specific references that the
shared code can utilize (such as using Community.CsharpSqlite.WP7 in
the Tasky sample for Windows Phone).
https://developer.xamarin.com/guides/cross-platform/application_fundamentals/building_cross_platform_applications/sharing_code_options/#Shared_Projects
I didn't see anything on this page for PCL about not writing platform specific code. If I include the Xamarin Android library in the PCL, is that not specific code that would be in a SAP?
Does it mean that I could tweak or have some feature on Android and Windows Phone that I couldn't on iOS (maybe iOS didn't support it?)
EDIT: What does it look like to access the camera, for example, from PCL via DI, vs accessing the camera in a SAP (platform doesn't matter; Android is fine.)

Is it possible to use WPF on unix?

I heard about Mono project but only in regards to winforms. Will it work with WPF?
WPF under Mono does not exist.
At this point, no group in the Mono project has plans to implement Windows Presentation Foundation APIs as part of the project.
The mono team propose using Silverlight/Moonlight instead:
Silverlight implement a subset of the WPF APIs and is available on Windows, MacOS X and through our own open source effort Moonlight it is available on Linux and other Unix systems.
There is a library called Silverform SDK that aims to provide cross-platform WPF and Silverlight implementation.
The library is implemented in managed code and currently works with OpenTK and Unity3D as render backends. Major functionality, such as binding, layout, main controls and primitives, has already been implemented (check Unity web player demos here). Initially it has been focused on Unity3d render, while support for standalone Mono applications will be added as a separate build in the future.
Disclaimer: I am one of the developers of the library.

Categories