All Projects → jonathanpeppers → Glidex

jonathanpeppers / Glidex

Licence: mit
glidex.forms is a library using Glide for faster Xamarin.Forms images on Android. Find out more about Glide at https://github.com/bumptech/glide

Projects that are alternatives of or similar to Glidex

Open Source Xamarin Apps
📱 Collaborative List of Open Source Xamarin Apps
Stars: ✭ 318 (+96.3%)
Mutual labels:  hacktoberfest, xamarin
Uno
Build Mobile, Desktop and WebAssembly apps with C# and XAML. Today. Open source and professionally supported.
Stars: ✭ 6,029 (+3621.6%)
Mutual labels:  hacktoberfest, xamarin
32feet
Personal Area Networking for .NET
Stars: ✭ 395 (+143.83%)
Mutual labels:  hacktoberfest, xamarin
Mobile.buildtools
The Mobile.BuildTools makes it easier to develop code bases in a clean, consistent, secure, and configurable way. Determine at Build which environment your app needs to run on, and what Client Secrets it should have. Plus many more amazing features!
Stars: ✭ 162 (+0%)
Mutual labels:  hacktoberfest, xamarin
Uno.ch9
Ch9 - Uno Reference Implementation project
Stars: ✭ 45 (-72.22%)
Mutual labels:  hacktoberfest, xamarin
Skiasharp
SkiaSharp is a cross-platform 2D graphics API for .NET platforms based on Google's Skia Graphics Library. It provides a comprehensive 2D API that can be used across mobile, server and desktop models to render images.
Stars: ✭ 2,493 (+1438.89%)
Mutual labels:  hacktoberfest, xamarin
Net6 Mobile Samples
Xamarin .NET 6 *early* preview. Not for production use.
Stars: ✭ 445 (+174.69%)
Mutual labels:  hacktoberfest, xamarin
Xamarin.forms.mocks
Library for running Xamarin.Forms inside of unit tests
Stars: ✭ 179 (+10.49%)
Mutual labels:  hacktoberfest, xamarin
Xtoolkit.whitelabel
Modular MVVM framework for fast creating powerful cross-platform applications with Xamarin.
Stars: ✭ 22 (-86.42%)
Mutual labels:  hacktoberfest, xamarin
Reactiveui
An advanced, composable, functional reactive model-view-viewmodel framework for all .NET platforms that is inspired by functional reactive programming. ReactiveUI allows you to abstract mutable state away from your user interfaces, express the idea around a feature in one readable place and improve the testability of your application.
Stars: ✭ 6,709 (+4041.36%)
Mutual labels:  hacktoberfest, xamarin
Hotreload
Xamarin.Forms XAML hot reload, live reload, live xaml
Stars: ✭ 407 (+151.23%)
Mutual labels:  hacktoberfest, xamarin
Opentok Xamarin.forms
Vonage | TokBox | OpenTok: Video/Audio Chat library for Xamarin.Forms
Stars: ✭ 78 (-51.85%)
Mutual labels:  hacktoberfest, xamarin
Xamarin.forms
Xamarin.Forms Official Home
Stars: ✭ 5,485 (+3285.8%)
Mutual labels:  hacktoberfest, xamarin
React Native Spaceviewer
See and search upcoming and previous rocket space launches! Built with React Native, using Detox E2E tests, Fastlane and Github Actions for app store deployment.
Stars: ✭ 61 (-62.35%)
Mutual labels:  hacktoberfest, glide
Essentials
Essential cross platform APIs for your mobile apps.
Stars: ✭ 1,344 (+729.63%)
Mutual labels:  hacktoberfest, xamarin
Manual React
Manual do React - 📗 📒 (PT-BR Tradução) 2020 Edition
Stars: ✭ 161 (-0.62%)
Mutual labels:  hacktoberfest
Datascience Pizza
🍕 Repositório para juntar informações sobre materiais de estudo em análise de dados e áreas afins, empresas que trabalham com dados e dicionário de conceitos
Stars: ✭ 2,043 (+1161.11%)
Mutual labels:  hacktoberfest
React Native Network Logger
An HTTP network request monitor for React Native with in-app interface for iOS and Android with no native code
Stars: ✭ 161 (-0.62%)
Mutual labels:  hacktoberfest
Graphite
Development repository for the graphite cookbook
Stars: ✭ 160 (-1.23%)
Mutual labels:  hacktoberfest
Anitya
A cross-distribution upstream release monitoring project
Stars: ✭ 161 (-0.62%)
Mutual labels:  hacktoberfest

glidex.forms (or just glidex)

Google recommends Glide for simplifying the complexity of managing Android.Graphics.Bitmap within your apps (docs here).

glidex.forms is small library we can use to improve Xamarin.Forms image performance on Android by taking a dependency on Glide. See my post on the topic here.

Download from NuGet:

glidex.forms
NuGet

Learn more on this episode of the Xamarin Show:

Super Fast Image Loading for Android Apps with GlideX | The Xamarin Show

If you have a "classic" Xamarin.Android app that is not Xamarin.Forms, it could be useful to use the Xamarin.Android.Glide NuGet package. If you want to improve the Xamarin binding for Glide, contribute to it on Github!

glidex.forms is currently using the 4.9.0 release of Xamarin.Android.Glide

How do I use glidex.forms?

To set this library up in your existing project, merely:

  • Add the glidex.forms NuGet package
  • Add this one liner after your app's Forms.Init call:
Xamarin.Forms.Forms.Init (this, bundle);
//This forces the custom renderers to be used
Android.Glide.Forms.Init (this);
LoadApplication (new App ());

How do I know my app is using Glide?

On first use, you may want to enable debug logging:

Android.Glide.Forms.Init (this, debug: true);

glidex.forms will print out log messages in your device log as to what is happening under the hood.

If you want to customize how Glide is used in your app, currently your option is to implement your own IImageViewHandler. See the GlideExtensions class for details.

Comparing Performance

It turns out it is quite difficult to measure performance improvements specifically for images in Xamarin.Forms. Due to the asynchronous nature of how images load, I've yet to figure out good points at which to clock times via a Stopwatch.

So instead, I found it much easier to measure memory usage. I wrote a quick class that runs a timer and calls the Android APIs to grab memory usage.

Here is a table of peak memory used via the different sample pages I've written:

NOTE: this was a past comparison with Xamarin.Forms 2.5.x

Page Loaded by Peak Memory Usage
GridPage Xamarin.Forms 268,387,112
GridPage glidex.forms 16,484,584
ViewCellPage Xamarin.Forms 94,412,136
ViewCellPage glidex.forms 12,698,112
ImageCellPage Xamarin.Forms 24,413,600
ImageCellPage glidex.forms 9,977,272
HugeImagePage Xamarin.Forms 267,309,792
HugeImagePage glidex.forms 9,943,184

NOTE: I believe these numbers are in bytes. I restarted the app (release mode) before recording the numbers for each page. Pages with ListViews I scrolled up and down a few times.

Stock XF performance of images is poor due to the amount of Android.Graphics.Bitmap instances created on each page. Disabling the Glide library in the sample app causes "out of memory" errors to happen as images load. You will see empty white squares where this occurs and get console output.

To try stock Xamarin.Forms behavior yourself, you can remove the references to glidex and glidex.forms in the glide.forms.sample project and comment out the Android.Glide.Forms.Init() line.

Features

In my samples, I tested the following types of images:

  • ImageSource.FromFile with a temp file
  • ImageSource.FromFile with AndroidResource
  • ImageSource.FromResource with EmbeddedResource
  • ImageSource.FromUri with web URLs
  • ImageSource.FromStream with AndroidAsset

For example, the GridPage loads 400 images into a grid with a random combination of all of the above:

GridPage

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].