Essential Utilities for .NET MAUI Development
I’m excited to announce the release of MobileConcept.Core version 1.0.3, a core utility library designed to streamline .NET MAUI application development. This package provides essential helpers, base classes, and extension methods that every cross-platform mobile developer needs.
What is MobileConcept.Core?
MobileConcept.Core is a foundational library for .NET MAUI applications that simplifies common mobile development tasks. Whether you’re building for Android or iOS, this package offers cross-platform solutions that just work.
Key Features
📸 Advanced Image Processing
One of the standout features is the ImageRotationHelper class, which intelligently handles image processing with EXIF orientation support. This solves a common headache for mobile developers: photos taken on different devices often appear rotated incorrectly due to EXIF metadata.
🏗️ MVVM Foundation Classes
Built-in base classes follow MVVM architectural patterns, giving you a solid foundation for building maintainable mobile applications.
🛠️ Extension Methods
Common utilities and extension methods that reduce boilerplate code and improve developer productivity.
🔧 Platform-Specific Helpers
Android and iOS specific utilities that handle platform differences so you don’t have to.
Real-World Usage: Image Processing Made Easy
Let’s look at a practical example. When users capture or select photos in your app, you often need to resize them and ensure they’re properly oriented. Here’s how MobileConcept.Core simplifies this:
using MobileConcept.Maui.Core.Helpers;
private async Task MediaClickAsync(string mediaType)
{
var options = new MediaPickerOptions { SelectionLimit = 1 };
if (mediaType == "camera")
{
var result = await MediaPicker.CapturePhotoAsync(options);
if (result is not null)
{
var stream = await result.OpenReadAsync();
var processedStream = ImageRotationHelper.ResizeProportionalWithExifRotation(
stream,
maxWidth: 400,
maxHeight: 400
);
// Your processed image is ready to use!
}
}
else if (mediaType == "library")
{
var result = await MediaPicker.PickPhotosAsync(options);
if (result.Count == 1)
{
var stream = await result[0].OpenReadAsync();
var processedStream = ImageRotationHelper.ResizeProportionalWithExifRotation(
stream,
maxWidth: 400,
maxHeight: 400
);
// Photo from library, properly oriented and sized!
}
}
}Code language: JavaScript (javascript)
Why ResizeProportionalWithExifRotation?
This single method provides multiple benefits:
- EXIF Rotation: Automatically detects and applies the correct orientation from image metadata, ensuring photos always display correctly regardless of how they were taken
- Proportional Resizing: Maintains the original aspect ratio while fitting within your specified dimensions
- Memory Efficiency: Reduces image file sizes, crucial for mobile apps with limited resources
- Cross-Platform Consistency: Works identically on Android and iOS
Getting Started
Installation is simple using the .NET CLI:
dotnet add package MobileConcept.Core --version 1.0.3
Code language: CSS (css)
Or via NuGet Package Manager:
Install-Package MobileConcept.Core -Version 1.0.3
Code language: CSS (css)
Requirements
- .NET 9.0 or later
- .NET MAUI 9.0 or later
The package uses SkiaSharp (version 3.119.1) for high-performance image processing operations.
Part of the MobileConcept.Maui Suite
MobileConcept.Core is the foundation of a broader ecosystem of packages designed for .NET MAUI development. Stay tuned for more specialized packages that build upon this core functionality.
Open Source and Community
This project is open source and available under the MIT license. I welcome contributions, bug reports, and feature requests from the community.
Links:
What’s Next?
I’m actively developing additional features and utilities based on real-world .NET MAUI development needs. If you have suggestions or would like to see specific functionality added, please open an issue on GitHub or reach out.
Try It Today
Whether you’re starting a new .NET MAUI project or looking to improve an existing one, MobileConcept.Core provides the essential tools you need. Install it today and experience cleaner, more maintainable mobile code.
Happy coding! 🚀
Questions or feedback? Leave a comment below or reach out via the GitHub repository. I’d love to hear how you’re using MobileConcept.Core in your projects!
