Posts

Showing posts with the label #ios

Push Notifications in .NET MAUI: A Comprehensive Guide

Image
Please, support my blog by clicking on our sponsors ad! IF you need this project DM me on whatsaap "9724784544" What are Push Notifications? Push notifications are messages sent directly to a user's mobile device from a server, even when the app is not actively being used. They are a crucial part of mobile app development, enabling real-time communication with users. Notifications can inform users about new content, updates, reminders, or other important information, thus enhancing user engagement and retention. Watch video to understand code: Implementing Push Notifications in Android and iOS using .NET MAUI In this blog, we'll explore how to implement push notifications in a .NET MAUI application for both Android and iOS platforms. We'll start by setting up a Firebase account, configuring the necessary dependencies, and writing the required code for Android and iOS.  Setting Up a Firebase Account Go to Firebase Console: Navigate to the Firebase ...

Turbocharging .NET MAUI Performance on Android and iOS: Unleashing the Full Potential

Introduction: As a .NET MAUI developer, building high-performance applications for Android and iOS is vital. This blog post aims to provide an in-depth guide on strategies and code optimizations to elevate the performance of your .NET MAUI apps. We'll explore common pitfalls and demonstrate improved coding practices to ensure a snappy and responsive user experience. Please, support my blog by clicking on our sponsors ad! Understanding .NET MAUI Performance Considerations: Before diving into optimizations, let's gain insights into performance considerations specific to .NET MAUI. This includes handling platform differences, optimizing resource usage, and leveraging the MauiGraphics API for custom drawing. Optimizing XAML Layouts for .NET MAUI: Before: <StackLayout> <Label Text="Welcome to My App" /> <Image Source="icon.png" /> <CollectionView ItemsSource="{Binding Items}" /> </StackLayout> After: ...

Interacting with file and folder dialogs in .NET MAUI using CommunityToolkit.

Image
  Interacting with file and folder dialogs in .NET MAUI using CommunityToolkit. Please, support my blog by clicking on our sponsors ad! File and folder interactions are routine for many applications, often requiring the creation of cumbersome, platform-specific code. The good news is that CommunityToolkit.Maui version 5.0 now includes enhanced FolderPicker and FileSaver classes, simplifying the process of selecting target folders and saving files across all .NET MAUI platforms. FileSaver Implementing FileSaver allows your application to present users with a user-friendly dialog for choosing a destination folder. With just a few lines of code, you can save various file types, such as documents, images, videos, and more. Example in C#: using var stream = new MemoryStream(Encoding.Default.GetBytes("Hello from the Community Toolkit!")); var fileSaveResult = await FileSaver.Default.SaveAsync("sample.txt", stream, cancellationToken); if (fileSaveResult.IsSuccess...

Animation in .net MAUI

Image
 Animation will add more good looking UI of the mobile application. Let's see how to add animation using lottie file. Lottie is a mobile library for andriod and IOS that prases Adobe After Effects animations exported as JSON. Lottie Animation in .NetMaui You can go through the lottie website. This lottie provide pently of cool animation and also you can create own animation. Please, support my blog by clicking on our sponsors ad! Let's get started First add install "SkiaSharp.Extended.UI.MAUI" in your project using nugget manager. This nugget is prerelease so please check "Include Prerelease". Lottie animation in .net Maui Next step is to Bootstrap Skiasharp plugin in MAUIProgram file and add UseSkiaSharp() to the app builder.  Below is the code: public static class MauiProgram { public static MauiApp CreateMauiApp() { var builder = MauiApp.CreateBuilder(); builder ...

Part 8 - Absolute Layout in Xamarin form

Image
 Absolute layout is used to position and size children using explicit values. The position is specified by the upper-left corner of the child relative to the upper-left corner of the AbsoluteLayout, in device independent units.Absolute Layout also implement proportional positioning and sizing feature. Please, support my blog by clicking on our sponsors ad! The Absolute Layout has two properties: LayoutBounds LayoutFlags Layout Bounds The default value is (0,0,Autosize,Autosize). The Parameter is as X,Y,Width,Height. LayoutFlags The default value of this property is AbsoluteLayoutFlags.None. This property indicates that the position and size are interpreted proportionally. Proportional values are from 0-1. 0 indicates 0% and 1 indicates 100%. If you want to use 50% then value will be 0.5 Values are as follow: None This is default value. this is autosize/fixed value. XProportional Indicates that what percentage X of parent should use, while other are absolute value...

Xamarin Tutorial Part 6 - Grid in code

Image
 Before you start with this blog, go to this syntax and tutorial blog. It will easy to understand the code of this blog. Grid through cs code Grid in xaml Please, support my blog by clicking on our sponsors ad! Below code for grid in c# Code. This is recommended when it has to add at runtime. By default you can add grid through xaml, Because xaml is easy to code and understand. var grid = new Grid(); var autoRow = new RowDefinition() { Height = new GridLength(1, GridUnitType.Auto) }; var fixRow = new RowDefinition() { Height = new GridLength(200) }; var starRow = new RowDefinition() { Height = new GridLength(1, GridUnitType.Star) }; var col1 = new ColumnDefinition() { Width = new GridLength(1, GridUnitType.Star) }; var col2 = new ColumnDefinition() { Width = new GridLength(1, GridUnitType.Star) }; var col3 = new ColumnDefinition() { Width = new GridLength(1, GridUnitType.Star) }; var col4 = new ColumnDefinition() { Width = new GridLen...