JNA VS Introducing .NET Multi-platform App UI (MAUI)

Compare JNA vs Introducing .NET Multi-platform App UI (MAUI) and see what are their differences.

JNA

Java Native Access (by java-native-access)

Introducing .NET Multi-platform App UI (MAUI)

.NET MAUI is the .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop. (by dotnet)
Our great sponsors
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • WorkOS - The modern identity platform for B2B SaaS
  • SaaSHub - Software Alternatives and Reviews
JNA Introducing .NET Multi-platform App UI (MAUI)
22 273
8,247 21,536
0.7% 1.1%
7.8 9.9
21 days ago 2 days ago
Java C#
GNU General Public License v3.0 or later MIT License
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.

JNA

Posts with mentions or reviews of JNA. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2023-12-10.
  • FFM (Foreign Function and Memory API) Goes Final
    3 projects | news.ycombinator.com | 10 Dec 2023
    As far as I understand it, with JNA, all calls into C code go through libffi: https://github.com/java-native-access/jna/blob/master/www/Fu...

    This means that every call sets up some libffi data structures and libffi uses this information to perform the native call. Likewise in the other direction for return values. With JNI (and Panama), Hotspot can directly emit the argument/return code a the call, not too dissimilar from what a C or C++ compiler would do. There is still some overhead from maintaining JVM invariants. For example, I think a thread blocked in an FFI call can still participate in a safepoint. But that applies to JNI as well.

  • Projetos em Java -- Por que você ou sua equipe escolheram a linguagem Java?
    1 project | /r/brdev | 8 Jun 2023
  • Are there any Non-Mobile Kotlin Native libraries wrapping C libraries like libhidapi/opengl?
    3 projects | /r/Kotlin | 6 Aug 2022
    If you were prepared to go to the JVM you might try JNA. https://github.com/java-native-access/jna
  • How to create fundamental libraries for my language?
    2 projects | /r/ProgrammingLanguages | 22 Jul 2022
    Other good example, but for Java platform is JNA library. Do not mix it with Java's JNI, which is a bad example of how it could be done.
  • Rust vs Java for simple small GUI apps
    1 project | /r/learnrust | 22 May 2022
    In case you haven't used it (assuming that you already know about JNI, for comparison) - https://github.com/java-native-access/jna is about as easy as it gets for native interop. Also, as mentioned in another comment, with the Java FFM (Foreign Function and Memory) API already in preview mode, pretty soon, there will be no external dependencies at all, and Java should be able to interop with any language that can talk to C.
  • Kotlin/Native
    1 project | /r/Kotlin | 28 Apr 2022
  • Does Java 18 finally have a better alternative to JNI?
    5 projects | dev.to | 11 Apr 2022
    The complexity of JNI has given rise to some community-driven libraries that make it simpler to do FFI in Java. Java Native Access (JNA) is one of them. It's built on top of JNI and at least makes FFI easier to use, especially as it removes the need to write any C binding code manually and reduces the chances of memory safety issues. Still, it has some of the disadvantages of being JNI-based and is slightly slower than JNI in many cases. However, JNA is widely used and battle-tested, so definitely a better option than using JNI directly.
  • JEP 419: Foreign Function and Memory API
    4 projects | news.ycombinator.com | 29 Mar 2022
    This is about calling into any native operating system APIs, as long as they are callable via C or C++ (which these days means "all" operating system APIs).

    JNI is somewhat harder to use, because you need custom glue on both sides of the border: Some custom classes in Java and some custom code on the C (and C++) side.

    This proposal would remove the need for the glue on the C side and would allow a pure java solution.

    Something like this has existed in third-party form for a while as JNA (https://github.com/java-native-access/jna), but now it's going to be built into the JRE itself (if the proposal passes through review)

  • How run ToS on MacOSX as a java command?
    1 project | /r/thinkorswim | 6 Dec 2021
  • Choosing Java as your language for a Machine Learning project
    2 projects | /r/java | 4 Nov 2021
    I use JNA https://github.com/java-native-access/jna , as you can write the entire interface in Java faster as well as easier without the need of messing with the complexities of JNI.

Introducing .NET Multi-platform App UI (MAUI)

Posts with mentions or reviews of Introducing .NET Multi-platform App UI (MAUI). We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2023-11-14.
  • Developers are not happy with .NET MAUI, but nobody in the team cares about it
    1 project | /r/hackernews | 27 Nov 2023
  • Android predictive back support
    1 project | /r/dotnetMAUI | 25 Nov 2023
    I am migrating XF app into MAUI and writing a simple Navigation framework because Prism doesn't work well and I didn't use anything advanced anyway. So, I am surfing the code of MAUI to intercept all the back buttons, etc. I haven't found a single mention of apis related to predictive back "RegisterOnBackInvokedCallback", "OnBackInvokedDispatcher", "OnBackPressedDispatcher", "AddCallback", "android:enableOnBackInvokedCallback" Also I don't see any issue on github that would say "Support Android Predictive back". Only one kinda related https://github.com/dotnet/maui/issues/8680
  • Group List View And Collection View are not working In .NET MAVI For IOS
    1 project | /r/dotnetMAUI | 25 Nov 2023
    Below issue is still reproducing in Maui .net7.0 version also. #10163
  • .NET 8 – MAUI
    1 project | news.ycombinator.com | 14 Nov 2023
    Maui is Open Source, MIT License

    https://github.com/dotnet/maui

    .NET is Open Source

    https://dotnet.microsoft.com/en-us/platform/open-source

    I do share your skepticism of Microsoft, but it looks like the economics and cash flow dynamics have changed drastically after the advent of the cloud.

    Microsoft is more focused on getting developers onto its ecosystem and help them with open source projects with the hope that they will use its Azure cloud services and bring in the money.

    My skepticism is a bit relaxed now and I have no qualms using .NET.

    I hope I am not wrong.

  • .NET 8 – .NET Blog
    12 projects | news.ycombinator.com | 14 Nov 2023
    It's a bit of a hit and miss as of today. CLI, back-end and natively compiled libraries (think dll/so/dylib or even .lib/.a - you can statically link NAOT binaries into other "unmanaged" code) work best, GUI - requires more work.

    Avalonia[0] and MAUI[1] have known working templates with it, but YMMV.

    [0] https://github.com/lixinyang123/AvaloniaAOT / https://github.com/AvaloniaUI/Avalonia/ / honorable mention https://github.com/VincentH-Net/CSharpForMarkup

    [1] https://github.com/dotnet/maui (try out with just true in csproj - it is known to work e.g. on iOS)

  • What's New in Final RC for .NET 8, .NET MAUI, Asp.net Core and EF8
    2 projects | news.ycombinator.com | 12 Oct 2023
    While this is the quite endorsed by the community: https://github.com/dotnet/maui/discussions/339

    I think the fundamental issue is that desktop Linux is way too fragmented. Not only just GTK2/3 and Qt but you have GNOME, KDE, XFCE, Cinnamon and then you have X11, Xorg, Wayland...

    To be honest, all those craps are why desktop Linux never took off. I'm very safe to say MAUI for Linux will eventually renders components off its own using framebuffer and hardware acceleration APIs such as OpenGL or Vulkan just because of the market fragmentations...

    If desktop Linux truly wants to get the attention, it will need to unify. Fixing dependency hell using Flatpak is the right direction.

    There is an existing old fork of MAUI for Linux that uses GTK: https://github.com/jsuarezruiz/maui-linux

  • MSFTbot: “We've moved this issue to the Backlog milestone”
    1 project | news.ycombinator.com | 29 Sep 2023
  • Every other tab in Shell doesn't show Shell.TitleView on Android
    1 project | /r/dotnetMAUI | 31 Jul 2023
    First I came across this Github issue: https://github.com/dotnet/maui/issues/9687 - According to this issue, this is a known bug for MAUI iOS, but it works OK for MAUI Android. As I said, I target Android only and I have the exact same issue. It's apparantly fixed with some of the latest versions for MAUI but the problem still occurs to me even with MAUI version:
  • Bindable properties issue with Custom controls
    1 project | /r/dotnetMAUI | 12 Jun 2023
    I saw this and tried to imitate (ofc my lack of experience wouldn't allow me to do it in the exact way). Already found some documentation that allowed to understand better. Thanks for the insigh.
  • ASP.NET Core - how to create an IdentityUser account from an external login
    1 project | /r/csharp | 31 May 2023
    I implemented the Auth controller following this sample code from Microsoft.

What are some alternatives?

When comparing JNA and Introducing .NET Multi-platform App UI (MAUI) you can also consider the following projects:

JNR - Java Abstracted Foreign Function Layer

Flutter - Flutter makes it easy and fast to build beautiful apps for mobile and beyond

JavaCPP - The missing bridge between Java and native C++

Avalonia - Develop Desktop, Embedded, Mobile and WebAssembly apps with C# and XAML. The most popular .NET Foundation community project.

SWIG - SWIG is a software development tool that connects programs written in C and C++ with a variety of high-level programming languages.

WPF - WPF is a .NET Core UI framework for building Windows desktop applications.

panama-foreign - https://openjdk.org/projects/panama

maui-linux - .NET MAUI is the .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop.

rust-bindgen - Automatically generates Rust FFI bindings to C (and some C++) libraries.

Uno Platform - Build Mobile, Desktop and WebAssembly apps with C# and XAML. Today. Open source and professionally supported.

win32metadata - Tooling to generate metadata for Win32 APIs in the Windows SDK.

react-native-windows - A framework for building native Windows apps with React.