NuGetXamarinXamarin.AndroidXamarin.Forms

Best NuGet Packages

Contents

As you know, you cannot use any third party library directly in your project. Firstly you need to extract the package as a zip file and add the necessary assemblies to the references and files. If updating is required, you have to repeat these processes manually. Fortunately, NuGet does all these things automatically. Using NuGet to install packages reduces the process of configuring these third-party libraries.

The NuGet package is a single ZIP file with the extension .nupkg. It contains compiled source code (DLLs) and other related files (scripts, images, package version number). Developers create packages and publish them on a host computer. Package consumers then take these packages from the host computer and add them to their projects. And they call the functionality of a package in their project.That’s why you should use NuGet packages in your projects to reduce the complex workload.

At the end of this article, you will learn how to install and launch the most useful NuGet packages to your projects. You will also have a better understanding of how to use these plugins with many sample projects. So let’s start with how to install a NuGet package.

How to Install a NuGet Package?

There are a number of ways to install NuGet packages in your projects. You can install the plugin you want to install by searching it in NuGet Package Manager. It is simple to use. Alternatively, you can install it by running PowerShell commands in Package Manager Consol. Or you can manually upload the zip files. This is the most demanding way.

In my article titled Install and Manage NuGet Packages, I explained in detail how to install and use NuGet packages.

1) Newtonsoft.Json

Newtonsoft.Json Plugin Installation
Newtonsoft.Json NuGet Package

Newtonsoft.Json is the most downloaded NuGet package. That’s why I wanted to include this plugin in the first place. Most used plugin to serialize and deserialize JSON files. It also converts JSON to XML, XML to JSON, and LINQ to JSON.

If you are getting data from a web API in JSON or XML format, you should deserialize this data. Or, if you are sending data to a service, you should send this data by serializing. You can easily serialize and deserialize with the Newtonsoft.Json plugin. Otherwise, you should spend a lot of time for these operations.

In addition, the Newtonsoft.Json plugin converts JSON to XML, XML to JSON, and LINQ to JSON. If you need to convert between these files in an application you develop, Newtonsoft.Json does it for you with a few lines.

LicenseMIT
Authors: James Newton-King
Project Site: https://www.newtonsoft.com/json

Enter the following code in Package Manager Console to install the Newtonsoft.Json plugin.

Install-Package Newtonsoft.Json -Version 12.0.3

Also, to be able to use it in classes, you have to import it as follows:

using Newtonsoft.Json;

Check out the article below for a better understanding of the usage of the Newtonsoft.Json plugin.

https://www.serkanseker.com/xamarin-forms-openweathermap-rest-api/

2) Xamarin.Essentials

Xamarin.Essentials NuGet Package
Xamarin.Essentials NuGet Package

Xamarin.Essentials allows application developers to use many features without having to create them from scratch. It provides cross-platform APIs. It works not only in Xamarin.Forms but also in native applications.

LicenseMIT
Authors: Microsoft
Project Site: https://github.com/xamarin/Essentials

You can install from Package Manager Console by typing the code below:

Install-Package Xamarin.Essentials -Version 1.5.3.2

Add a reference to use in the class.

using Xamarin.Essentials;

Installation is required for each platform. For Android:

protected override void OnCreate(Bundle savedInstanceState)
{
    base.OnCreate(savedInstanceState);
    Xamarin.Essentials.Platform.Init(this, savedInstanceState);
}

public override void OnRequestPermissionsResult(int requestCode, string[] permissions, Android.Content.PM.Permission[] grantResults)
{
    Xamarin.Essentials.Platform.OnRequestPermissionsResult(requestCode, permissions, grantResults);
    base.OnRequestPermissionsResult(requestCode, permissions, grantResults);
}

3) Xamarin.Forms.PancakeView

Xamarin.Forms.PancakeView NuGet Package
Xamarin.Forms.PancakeView NuGet Package

As you know, the customizations we can do with existing Xamarin.Forms controls are limited. That’s why we usually can’t get the views we want with Xamarin.Forms controls. If you want a view with a simple user interface, these controls meet your wishes. However, if you want to get a nice design, the PancakeView plugin will do the trick.

If you need gradients, borders, rounded corners and shadows when designing a mobile app, the PancakeView plugin is for you. You can make many great designs that you cannot do with the Xamarin.Forms controls available.

License: MIT
Authors: Steven Thewissen
Project Site: https://github.com/sthewissen/Xamarin.Forms.PancakeView

Enter the following code in Package Manager Console to install the PancakeView plugin.

Install-Package Xamarin.Forms.PancakeView -Version 1.4.2

In the .xaml file you will use, you need to define as follows:

xmlns:pv="clr-namespace:Xamarin.Forms.PancakeView;
assembly=Xamarin.Forms.PancakeView"

Check out the article below for a better understanding of the usage of the Xamarin.Forms.PancakeView plugin.

https://www.serkanseker.com/xamarin-forms-pancakeview-plugin-usage/

4) MediaManager

Plugin.MediaManager.Forms NuGet Package
Plugin.MediaManager.Forms NuGet Package

MediaManager plugin developed by Baseflow is a cross platform media plugin for Xamarin and Windows. It allows us to easily perform many operations such as play, pause, progress from the link address or media files on our device. You can access many features of a music player or video player application with this extension.

License: MIT
Authors: Martijn van Dijk
Project Site: https://github.com/sthewissen/Xamarin.Forms.PancakeView

Enter the following code in Package Manager Console to install the MediaManager plugin.

Install-Package Plugin.MediaManager.Forms -Version 0.9.8-alpha2

To use this plugin you need to call the Init () method on local platforms. For Android you can initialize like below:

CrossMediaManager.Current.Init(this);

In addition, you need to import for each class that use the plugin.

using MediaManager;

Check out the article below for a better understanding of the usage of the MediaManager plugin.

5) Com.Airbnb.Xamarin.Forms.Lottie

Com.Airbnb.Xamarin.Forms.Lottie NuGet Package
Com.Airbnb.Xamarin.Forms.Lottie NuGet Package

The Lottie plugin parses Adobe After Effects animations with Bodymovin and displays them on the mobile device. It provides high resolution and low size animations for applications.

Lottie plugin is perfect for design customization. Let’s say you have a mobile app. And you want to increase the user experience of this application with a nice UI. Then Lottie plugin is for you. You can create animated splash screens, onboarding screens and buttons with Lottie plugin.

License: Apache-2.0
Authors: Martijn van Dijk
Project Site: https://github.com/Baseflow/LottieXamarin

Enter the following code in Package Manager Console to install the Lottie plugin.

Install-Package Com.Airbnb.Xamarin.Forms.Lottie -Version 3.1.2

Using this plugin, you can get an animation like below.

Check out the article below for a better understanding of the usage of the Lottie plugin.

6) sqlite-net-pcl

sqlite-net-pcl NuGet Package
sqlite-net-pcl NuGet Package

While developing mobile applications, we sometimes need a database. We need to keep some of the users’ data in one place. Large database tools such as MySQL or MSSQL are suitable for big data. However, there is no need for a large database for applications such as a message, contacts or music player. With its many features, SQLite meets the local database needs for mobile applications.

SQLite is a small and fast database engine. SQLite source code is publicly available and free for anyone to use for any purpose. Therefore, it has been the choice of many developers in mobile applications.

License: Free
Authors: SQLite-net
Project Site: https://github.com/praeclarum/sqlite-net

Enter the following code in Package Manager Console to install the sqlite-net-pcl plugin.

Install-Package sqlite-net-pcl -Version 1.8.0-beta

Check out the this article for a better understanding of the usage of the sqlite-net-pcl plugin.

https://www.serkanseker.com/xamarin-using-sqlite-mvvm-structure/

Conclusion

In summary, NuGet packages reduce the process of configuring third-party libraries. NuGet Package Manager automatically performs the necessary operations to use the packages in any project. Thus, software developers save a lot of time. Imagine installing each package individually in the project. And update it if necessary. What a waste of time, right?

In this article I showed you how to install the best NuGet packages. I have also included it in many sample projects to better understand the use of these plugins. I hope it was useful.

If you’re still not sure what to do, then I suggest you use the comment section below and let me know! I am here to help!

Serkan

Software Engineer. Problem solver. Music practitioner. Thinker. Industrious.

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button