Convert Figma logo to code with AI

jamesmontemagno logoXamarin.Plugins

Cross-platform Native API Access from Shared Code!

1,292
375
1,292
1

Top Related Projects

Xamarin.Forms is no longer supported. Migrate your apps to .NET MAUI.

Xamarin Forms popup plugin

Quick Overview

Xamarin.Plugins is a collection of cross-platform plugins for Xamarin and Windows applications. These plugins provide easy access to common functionality across iOS, Android, and Windows devices, allowing developers to write shared code that works seamlessly across platforms.

Pros

  • Simplifies cross-platform development by providing consistent APIs for common tasks
  • Regularly updated and maintained by the community
  • Extensive documentation and sample projects available
  • Supports a wide range of functionality, from device settings to media plugins

Cons

  • Some plugins may have platform-specific limitations or inconsistencies
  • Dependency on third-party libraries may increase app size
  • Learning curve for developers new to Xamarin or cross-platform development
  • Not all plugins are updated at the same frequency, leading to potential version mismatches

Code Examples

  1. Using the Connectivity Plugin to check network status:
using Plugin.Connectivity;

if (CrossConnectivity.Current.IsConnected)
{
    // Device is connected to the internet
}
else
{
    // Device is not connected to the internet
}
  1. Accessing device information with the Device Info Plugin:
using Plugin.DeviceInfo;

var deviceId = CrossDeviceInfo.Current.Id;
var deviceModel = CrossDeviceInfo.Current.Model;
var deviceManufacturer = CrossDeviceInfo.Current.Manufacturer;
  1. Using the Media Plugin to pick a photo from the device:
using Plugin.Media;

await CrossMedia.Current.Initialize();

if (CrossMedia.Current.IsPickPhotoSupported)
{
    var file = await CrossMedia.Current.PickPhotoAsync();
    if (file != null)
    {
        // Use the picked photo
    }
}

Getting Started

  1. Install the desired plugin via NuGet Package Manager:

    Install-Package Xam.Plugin.Connectivity
    
  2. Add the following to your AssemblyInfo.cs file:

    [assembly: UsesPermission(Android.Manifest.Permission.AccessNetworkState)]
    
  3. Initialize the plugin in your app's startup code:

    CrossConnectivity.Current.ConnectivityChanged += (sender, args) =>
    {
        // Handle connectivity changes
    };
    
  4. Use the plugin in your code as shown in the examples above.

Competitor Comparisons

Xamarin.Forms is no longer supported. Migrate your apps to .NET MAUI.

Pros of Xamarin.Forms

  • Comprehensive framework for cross-platform mobile development
  • Extensive documentation and official support from Microsoft
  • Large community and ecosystem of third-party libraries

Cons of Xamarin.Forms

  • Steeper learning curve for developers new to the framework
  • Larger app size compared to native development
  • Performance can be slower than native apps for complex UIs

Code Comparison

Xamarin.Forms (XAML):

<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             x:Class="MyApp.MainPage">
    <StackLayout>
        <Label Text="Welcome to Xamarin.Forms!" />
    </StackLayout>
</ContentPage>

Xamarin.Plugins (C#):

using Plugin.Permissions;
using Plugin.Permissions.Abstractions;

public async Task<bool> CheckPermissions()
{
    var status = await CrossPermissions.Current.CheckPermissionStatusAsync<LocationPermission>();
    return status == PermissionStatus.Granted;
}

The Xamarin.Forms code snippet shows a basic XAML page structure, while the Xamarin.Plugins example demonstrates how to check for location permissions using a plugin. Xamarin.Forms provides a complete UI framework, whereas Xamarin.Plugins offers specific functionality to enhance Xamarin applications.

Xamarin Forms popup plugin

Pros of Rg.Plugins.Popup

  • Specialized focus on popup functionality for Xamarin.Forms
  • Lightweight and easy to implement for specific popup needs
  • Active development and frequent updates

Cons of Rg.Plugins.Popup

  • Limited scope compared to the broader range of plugins in Xamarin.Plugins
  • May require additional plugins for other functionalities
  • Less integrated with other Xamarin features

Code Comparison

Rg.Plugins.Popup:

public partial class MyPopupPage : PopupPage
{
    public MyPopupPage()
    {
        InitializeComponent();
    }
}

Xamarin.Plugins (using Settings plugin):

CrossSettings.Current.AddOrUpdateValue("key", "value");
var value = CrossSettings.Current.GetValueOrDefault("key", "defaultValue");

Summary

Rg.Plugins.Popup is a specialized plugin for handling popups in Xamarin.Forms applications. It offers a focused solution for developers needing robust popup functionality. On the other hand, Xamarin.Plugins provides a wider range of plugins covering various aspects of mobile development.

Rg.Plugins.Popup is ideal for projects requiring advanced popup features, while Xamarin.Plugins offers a more comprehensive toolkit for diverse mobile development needs. The choice between the two depends on the specific requirements of your project and whether you need a specialized popup solution or a broader set of plugins.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

Plugins for .NET, Xamarin, and Windows

Here is my essential list of official and community plugins and libraries for applications. You will find a lot of Xamarin and Xamarin.Forms libraries, but also great libraries for .NET that can help power your apps. If you have a favorite library or are the creator of one, please send a PR!

Xamarin.Essentials: The stuff your app needs

Xamarin.Essentials gives developers essential cross-platform APIs for their mobile applications. Xamarin.Essentials exposes over 60 native APIs in a single cross-platform package for developers to consume in their iOS, Android, UWP, or Xamarin.Forms application. Browse through the documentation on how to get started today.

The repository for Xamarin.Essentials can be found at https://github.com/xamarin/Essentials. If you have any suggestions or feature requests, or if you find any issues, please open a new issue.

If you have bene using my plugins, I will continue to support the ones that aren't in Xamarin.Essentials, but I recommend you transition using my guide.

Shiny: That complex stuff made easy

Shiny is an amazing project from Allan Ritchie, Microsoft MPV and long time Xamarin developer, that makes really complex native functionality easy. This includes things such at Bluetooth LE, Background Jobs, HTTP Transers, Push Notifications, NFC, and more.

Community Provided Open Source Plugins

Plugins for Xamarin are community built NuGet and Components that add cross-platform functionality or abstracts platform specific functionality to a common API. These are both completely cross-platform and extremely small (i.e., they do 1 or 2 things really well with minimal-to-no dependencies). The Plugin API can be accessed on each platform, however, you will most likely only use the common API in a .NET Standard project.

Notice: Plugins for Xamarin featured here are produced by the amazing open source community of Xamarin developers. Xamarin does not provide official support for these plugins, please contact their creator with any issues.

Browse through the most popular plugins out there today!

NameDescriptionNuGetDocs & SourceCreator
Audio RecorderRecord audio on a device's microphone input.NuGetGitHub@NateRickard
Barcode ScannerScan and create barcodes with ZXing.NET.Mobile.NuGetGitHub@Redth
Breach DetectorDetect root, emulation, debug mode and other security concerns.NuGetGitHub@nmilcoff
CalendarQuery and modify device calendarsNuGetGitHubCaleb Clarke
ConfigDefine the settings of the application for each environment in which it will run.NuGetGitHub@abonilla93
Custom VisionRuns CoreML and TensorFlow models from https://CustomVision.ai on deviceNuGetGitHub@JimBobBennett
File PickerPick and save files.NuGetGitHub@studyxnet
File UploaderUpload files using multipart request.NuGetGitHub@rdelrosario
FingerprintAccess Fingerprint sensor on iOS, Android, and Windows.NuGetGitHub@smstuebe
GeolocatorEasily detect GPS location of device.NuGetGitHub@JamesMontemagno
Identity Document ScanningEnable scanning of various identity documents in your app.NuGetGitHub@microblink
In-App BillingMake, Query, and get In-App Purchases and Subscriptions.NuGetGitHub@JamesMontemagno
MediaTake or pick photos and videos.NuGetGitHub@JamesMontemagno
Media ManagerPlayback for Audio and Video.NuGetGitHub@mhvdijk
Multilingual PluginSimple cross platform plugin for handling language localization.NuGetGitHub@CrossGeeks
ScreenshotGet and save a screenshot of your apps.NuGetGitHub@wilson_vargasm
Speech RecognitionSpeech to Text.NuGetGitHub@allanritchie911
Simple Audio PlayerPlay multiple MP3 or wave files from a shared library.NuGetGitHub@adrianstevens
Store ReviewAsk for store review or launch app store page.NuGetGitHub@jamesmontemagno
ToastA simple way of showing toast/pop-up notifications.NuGetGitHub@AdamPed & @EgorBo
User DialogsMessage box style dialogs.NuGetGitHub@allanritchie911

Data Caching & Databases

NameDescriptionNuGetDocs & SourceCreator
AkavacheAn asynchronous, persistent (i.e. writes to disk) key-value store.NuGetGitHub@paulcbetts
Cosmos DBAzure Cosmos DB is a globally distributed, multi-model database service.NuGetGitHub@azurecosmosdb
LiteDBLiteDB - A .NET NoSQL Document Store in a single data fileNuGetGitHub@mbdavid
🐒 Monkey CacheCache any data structure for a specific amount of time with minimal dependencies.NuGetGitHub@jamesmontemagno
Mono.Data.SqliteAdd Mono.Data.Sqlite to any Xamarin or Windows .NET app.NuGetGitHub@mattleibow
RealmRealm is a mobile database: a replacement for SQLite and ORMs.NuGetGitHub@realm
SQLite-netSimple, powerful, cross-platform SQLite client and ORM for .NETNuGetGitHub@praeclarum

Awesome .NET Libraries For Apps

These are just some awesome libraries that work in any .NET app!

NameDescriptionNuGetDocs & SourceCreator
AnyBindEasily bind ViewModel to one or more Models.NuGetGitHubAlexander Kvenvolden
ExpressiveExpression parsing and evaluation frameworkNuGetGitHubShawn Lawrence
HttpTracerSimple tracing library to capture HTTP request/responses.NuGetGitHubBSi Labs
MvvmHelpersCollection of small MVVM helpers for app devs.NuGetGitHubCreator
Portable RazorLightweight implemenation of ASP.NET MVC APIs for mobile.NuGetGitHub@JosephHill
SocketsTCP & UDP Listeners and Clients + UDP multicast.NuGetGitHub@rdavis_au
TinyInsightsAbstraction for one or more analytics providers from shared code.NuGetGitHubTinyStuff Team

MVVM Frameworks

Xamarin.Forms and Windows has MVVM built right, but perhaps you want to go farther and need more. Checkout these great libraries to help you out:

  • FreshMvvm - A super light Mvvm Framework designed specifically for Xamarin.Forms. It's designed to be Easy, Simple and Flexible.
  • MvvmAtom - Provides the middle ground by providing the base classes and wiring for most commonly used MVVM feature.
  • MvvmCross - Build clean, pixel perfect, native UIs. Share behavior and business logic in a single codebase across supported platforms, using the Model-View-ViewModel (MVVM) design pattern.
  • MvvmLight - The main purpose of the toolkit is to accelerate the creation and development of MVVM applications in Xamarin.Android, Xamarin.iOS, Xamarin.Forms, Windows 10 UWP, & Windows Presentation Foundation (WPF).
  • Prism - Prism is a framework for building loosely coupled, maintainable, and testable XAML applications in WPF, Windows 10 UWP, and Xamarin.Forms.
  • Xamarin.Forms Mvvm Adaptor - ViewModel-first mvvm framework for Xamarin.Forms. Lightweight, it adapts Xamarin's existing mvvm engine.

UI Controls - Vendors

Looking for controls for your apps? These vendors have absolutely everything that you need. Many offer free trials, community editions or a free version.

Checkout the awesome trailer for these controls on YouTube.

UI Controls - Community

Here are some awesome UI controls for your Xamarin.Forms apps!

NameDescriptionNuGetDocs & SourceCreator
AutoFormsAuto generated Xamarin.Forms UI from your Domain ModelsNuGetGitHubPatrick Abadi, Daniel Packard
AutoSuggestBoxAuto-complete/suggestion textbox controlNuGetGitHubdotMorten
Bit controlsMulti calendar date time picker based on noda time and a few other controls.NuGetGitHubBit foundation
BreadcrumbAutomatically generated breadcrumb navigation control for Xamarin.Forms.NuGetGitHubIeuan Walker
Color PickerAn interactive and responsive Color Picker Control for Xamarin.Forms based on SkiaSharp!NuGetGitHubUdara Alwis
Debug RainbowsOverlay grids to help manage layouts.NuGetGitHubSteven Thewissen
FFImageLoadingImage loading with caching, placeholders, transformations and moreNuGetGitHub@molinch, @daniel-luberda
Glidex.FormsGlidex.Forms is a library using Glide for faster Xamarin.Forms images on Android.NuGetGitHub@jonathanpeppers
FloatingActionMenuFloating action menu, inspired by the material design floating action button.NuGetGitHubDIPS AS Team
MagicGradientsGradients everywhere! Powered by SkiaSharpNuGetGitHubMarcin Gierlasiński
Material Design Controls for Xamarin.FormsThe suite of Material Design controls with a feature-rich. Create fast, beautiful, and cross-platform mobile apps.NuGetGitHubHorus Studio
MtAdmobAdd Google Admob banners, interstitials and rewarded videos to Android and iOS with a single line of code.NuGetGitHub@marcojak
PancakeViewAn extended ContentView for Xamarin.Forms with rounded corners, borders, shadows and more.NuGetGitHubSteven Thewissen
PopupCustom popups with a nice modality feed to it.NuGetGitHubDIPS AS Team
Shared TransitionsDesNuGetGitHubGiampaolo Gabba
SheetSliding bottom / top sheet control.NuGetGitHubDIPS AS Team
SharpnadoCollection of controls including Tabs, TaskLoaderVIew, and more.NuGetGitHubJean-Marie Alfonsi
Skeleton for Xamarin.FormsThe latest trend for loading approaches in Xamarin Forms apps.NuGetGitHubHorus Studio
SkiaSharpCross-platform 2D graphics API for .NET powered by SkiaNuGetGitHubMono Team
SkiaSharp for Xamarin.FormsCross-platform 2D graphics API for Xamarin.Forms powered by SkiaNuGetGitHubMono Team
StateButtonWith this control you are able to create any style of button. This is possible as it acts as a wrapper to your XAML and provides you the events/ commands and properties to bind too.NugetGitHubIeuan Walker
StateSquidTurn any layout into an individual state-aware elementNugetGitHubSteven Thewissen
SwitchA switch control that allows you to design/ create any switch you wantNugetGitHubIeuan Walker
TouchEffectMake Xamarin.Forms views touch-responsive without TapGestureRecognizer.NuGetGitHubAndrei Misiukevich
TrendGraphDisplay a trend graph in your mobile app.NuGetGitHubDIPS AS Team
XamanimationAn awesome animation library for Xamarin.FormsNuGetGitHubCreator
XamllyControl library featuring progress, switch, toggle button, and more.NuGetGitHubMohamed Elshawaf

Great Utilities

These are things that your app needs, but aren't UI or normal libraries such as Visual Studio extensions or other magic build time things.

NameDescriptionNuGetDocs & SourceCreator
Mobile Tasks for Azure DevOpsTasks to update version numbers & package informationVS MarketplaceGitHubJames Montemagno
Mobile.BuildToolsHandle Project Secrets, Process SCSS to Xamarin.Forms CSS, Cross platform image management, White-Labeling and more powered by MSBuild.NuGetGitHubDan Siegel
ResizetizerNTAdd & Resize SVGs and PNGs to your shared projects.NuGetGitHubJon Dick
VSMac-CodeCoverageGather code coverage results for your unit test projects from Visual Studio for Mac.mpack installGitHubArthur Demanuele
VSMac-CodeDistributionA Visual Studio for Mac extension that visualises code distribution between projects. Particularly useful for Xamarin projects to understand the amount of code shared between platforms.mpack installGitHubArthur Demanuele

Create a Plugin for Xamarin

If you are looking to create a plugin be sure to browse through NuGet first and ensure that the plugin doesn't exist. If one does join in on the fun and collaborate. If it doesn't and you want to start building a Plugin here are some tools and guidelines to get you started.

Tools to get Started

Requirements of a Plugin

  • Open source on GitHub
  • Documentation on GitHub's README file
  • Name: "FEATURE_NAME Plugin for Xamarin and Windows"
  • Namespace: Plugin.FEATURE_NAME
  • App-store friendly OSS license (we like MIT)
  • No dependency on Xamarin.Forms
  • Have a list of supported and unsupported OSs in its GitHub wiki

License

Licensed under MIT see License file. Each plugin licensed under parent license unless stated in it's readme file.

Want To Support This Project?

All I have ever asked is to be active by submitting bugs, features, and sending those pull requests down! Want to go further? Make sure to subscribe to my weekly development podcast Merge Conflict, where I talk all about awesome Xamarin goodies and you can optionally support the show by becoming a supporter on Patreon.