Integrating Mapbox with .NET MAUI - xamarin.forms

I am currently developping an native Android app using Mapbox with Visual Studio (using some Mapbox nugets). I have to do the whole dev to address iOS customers but Xamarin.Forms nuget version of Mapbox is out of date, both Android & iOS SDKs have been updated since.
As Microsoft has just released the first .NET MAUI Release Candidate RC1, i.e. the successor of Xamarin.Forms, I would like to start over a new project so I can manage one development pipeline to deploy on either Android or iOS afterwards.
So I open this thread in order to share help to embbed Mapbox in a fresh new .NET MAUI project.
How should we proceed to simply display a Mapbox map view with a .NET MAUI project?
Thank you!

The best way for now is implementing a Maui Blazor app and using a BlazorWebView to put a MapBox in your page.
See Build a .NET MAUI Blazor app documentation

Related

.NET MAUI: How MAUI Will it impact on Xamarin Native applications?

I have come to know that Microsoft will not support Xamarin anymore by the end of this year (Nov 2021) in favour of MAUI and .NET MAUI is the next generation of Xamarin Forms as well, so what will happen to Xamarin.Native apps. Will they also be upgraded to MAUI or the change will only have impact on Xamarin Forms, but if it will have on Xamarin Native apps then will we be required to change the complete structure of existing app to the MAUI framework. Please guide in this regard.
Here is an extract of the MS announcement blog post :
As part of our .NET unification, Xamarin.iOS and Xamarin.Android will become part of .NET 6 as .NET for iOS and .NET for Android. Because these bindings are projections of the SDKs shipped from Apple and Google, nothing changes there, however build tooling, target framework monikers, and runtime framework monikers will be updated to match all other .NET 6 workloads. Our commitment to keeping .NET developers up-to-date with the latest mobile SDKs is foundational to .NET MAUI and remains firm. When .NET 6 ships, we expect to ship a final release of Xamarin SDKs in their current form that will be serviced for a year. All modern work will at that time shift to .NET 6.
Your comment on Xamarin support is incorrect. Once MAUI comes out (November 2021), Xamarin will be supported for one full year, that is, until November 2022.

How do i add UWP to xamarin forms in VS2019?

I try to create a new project(xamarin form) in vs2019, and discovered that the UWP template is missing.
I created the project in vs2017 yet it did not work. now I have added a UWP project to the xamarin form app created using vs2019, how do I link them, how do I connect(refrence) the UWP to the portable library?
I want to make use of the portable library in xamarin forms that ha UWP in it, like vs2017 versions
In VS 2019 version 16.0.0 UWP head project have been removed from the Xamarin.Forms app template. However, if you install latest version of VS 2019 (16.0.1) that option should be available to you. According to the release notes:
Add option for Windows (UWP) platform when creating new Xamarin.Forms project from 'Mobile App (Xamarin.Forms)' project template.
Other then that you could just simply add UWP as a separate project and set it up for Xamarin.Forms.

cannot run prism xamarin with Xamarin.Forms 3.5.0.62956-pre2 or 4.0 pre2

been trying to play with the new stuff that will soon coming out from xamarin form
I create a new Prism xamarin app
I upgrade the nuget packages to point to xamarin 3.5 or 4.0
but I cannot get the solution to run.
It just hangs!!
It works when I do the same thing with a standard xamarin form template
I know its just preview but I would like to know if somebody has tried to compile and run any app using prism xamarin and the preview xam forms.
many thanks
As far as I am aware there should not be any issues with Prism when targeting Xamarin Forms 3.5+.
That said if you're wanting to target one of the pre-releases I would suggest either installing the current preview on NuGet which targets 4.0-pre1, or the latest CI build which targets 3.5-pre2 and has a number of great new features including a more robust API for IContainerRegistry as well as support for Tuples in INavigationService.

Xamarin Forms how to check it contains the latest Api for Android and iOS

Hi newbie on Xamarin Forms.
I am a bit of confuse on using Xamarin forms.
With the following questions, I hope you can help me to understand to use it for development.
Currently I am using VS2015 Community version
1) If I have done the Settings on Cross Platform development to include C#/.Net(Xamarin v4...), do I still need to download the Xamarin at Xamarin.com?
2) Understand Android and iOS have different Api level (Sdk ver) and iOS ver8,9,10 respectively.
So, When google releases new api or Apple releases new iOS ver, How do I update Xamarin to use them? what I need to and How I handle Android and iOS new update respectively? What are the steps to take?
3) If I have Updated Xamarin, is this means it has included all the latest Api for Android and iOS
4) Can I use Xamarin for VS2017 as compare to VS2015 is more matured?
Thanks
You can and should use latest and greatest tools available, unless you have some limitations. Use Visual Studio 2017, it provides an easy installation of Xamarin.
When a new version of platform SDK is released by Google or Apple for example, you will have to:
Download & install new platform SDK for Android / iOS
Update Xamarin.Forms nuget package in the project
Additionally in case of iOS you may need to update Xcode
Xamarin.Forms documentation can answer all of your questions, so I suggest to get familiar with it.
I think you'll need to add some steps.
First - try create Xamarin Forms project and buil it(for Android). If you have errors - please read this manual
You need to check the update in several places.
2.1. About the new version Xamarin you will be informed Visual Studio.
For VS 2015 Check next setting - Service - Parametrs - Update Xamarin(checked).
For VS 2017 - You'll see the checkbox on the top right.
2.2 About update Android Api -You must learn manually. Check in VS
Service - Android - Package manager SDK Android. The new AIPI is a great event in the world of android - but you need to sit behind the news.
2.3 Also packages(Xamarin Forms and other) are updated - you need check nuget packages for your solution.
2.4. You must manual run update Xamarin for your mac. This is an extensive topic. Please read this article.
No is it. You need some manual actions(see item 2).
VS 2017 Has new features and new bugs ). I use VS 2017.

How to add json.net to Xamarin Forms, on the native projects or on the PCL?

I'm developing an App with Xamarin Forms, I need to add json.net to the project from Nugat (I think) do I need to do it on every native project or can I do it on the PCL project
Thanks Shimon
You should just need to add it to your core PCL project.

Resources