Delpin Susai Raj Friday 23 October 2020

Xamarin.Forms - Mobile Network Speed Check(Slow or Fast) in Android

In this blog post, you will learn how to check you mobile network speed(slow or speed) using android native in Xamarin.Forms.



Introduction

Xamarin.Forms code runs on multiple platforms - each of which has its own filesystem. This means that reading and writing files is most easily done using the native file APIs on each platform. Alternatively, embedded resources are a simpler solution to distribute data files with an app.

Prerequisites

  • Visual Studio 2017 or later (Windows or Mac)

Setting up a Xamarin.Forms Project

 Start by creating a new Xamarin.Forms project. You wíll learn more by going through the steps yourself.

Create a new or existing Xamarin forms(.Net standard) Project. With Android and iOS Platform. 


Create a Interface

Create a NetworkConnectivity

Following code will check the Mobile network connection and Check the Network status whether speed or slow.

NetworkConnectivity.cs

Android Implementation

Here, Implement the Interface and return the network status.

NetworkHelper.cs


Consume the Network helper

Here, you will call the Network helper class and you will get the network speed.

MainPage.Xaml


Here I shows the result in toast. 

MainPage.xaml.cs


Run



I hope you have understood you will learn how to check you mobile network speed(slow or speed) using android native in Xamarin.Forms.

Thanks for reading. Please share your comments and feedback. 

Happy Coding :)

Delpin Susai Raj Wednesday 21 October 2020

Xamarin.Forms - Network Speed Monitor

 In this blog post, you will learn how to monitor you network speed in Xamarin.Forms.

Introduction

Xamarin.Forms code runs on multiple platforms - each of which has its own filesystem. This means that reading and writing files is most easily done using the native file APIs on each platform. Alternatively, embedded resources are a simpler solution to distribute data files with an app.

Prerequisites

  • Visual Studio 2017 or later (Windows or Mac)

Setting up a Xamarin.Forms Project

Start by creating a new Xamarin.Forms project. You wíll learn more by going through the steps yourself.

Create a new or existing Xamarin forms(.Net standard) Project. With Android and iOS Platform.


 Network Monitor 

Now, create a network helper class for check network connectivity in xamarin.froms.

NetworkHelper.cs


Consuming Network helper

Here, you will call the Network helper class and you will get the network speed.

MainPage.Xaml


Here I shows the result in toast. 

MainPage.xaml.cs


Run



I hope you have understood you will learn how to check network speed in Xamarin.Forms.

Thanks for reading. Please share your comments and feedback. 

Happy Coding :)

Delpin Susai Raj Monday 12 October 2020

Enable Dark Mode in iOS Simulator

 

Make sure your iOS version should be iOS 13 or Later

Goto Settings in your iOS Simulator.

Now scroll down in settings, you're able to see the Developer in the list. Click Developer.

Now, Enable the Dark Appearance toggle. Your simulator will behave dark mode.

Your simulator is Dark Mode.

I hope you have understood how to enable the dark mode in iOS Simulator.

Thanks for reading. Please share your comments and feedback. Happy Coding :)

Xamarin.Forms - Support Dark Mode

In this blog post, you will learn how to give support Dark Mode in Xamarin.Forms.

Introduction

Xamarin.Forms code runs on multiple platforms - each of which has its own filesystem. This means that reading and writing files is most easily done using the native file APIs on each platform. Alternatively, embedded resources are a simpler solution to distribute data files with an app.

Dark Mode


Nowadays iOS and Android apps should support both Dark and Light Theme.

Prerequisites

  • Visual Studio 2017 or later (Windows or Mac)

Setting up a Xamarin.Forms Project

 Start by creating a new Xamarin.Forms project. You wíll learn more by going through the steps yourself.

Create a new or existing Xamarin forms(.Net standard) Project. With Android and iOS Platform. 

Create a Theme

Create a ResourceDictionary for both Light and Dark Theme.

DarkTheme.xaml

LightTheme.xaml


Set App Theme

In app.xaml you can set the default theme.

App.xaml

Now, Create a Enum in App.xaml.cs

Create a Interface

Create a interface for set Theme at runtime.


iOS Implementation

Below code to change the Theme at runtime.

ThemeHelper.cs



Android Implementation

Below code to change the Theme at runtime.

ThemeHelper.cs



Consuming the Styles


Now, you can use the resource "DynamicResource BackgroundColor" like this.




Click the "Play" button to try it out.

Dark Mode


Light Mode

I hope you have understood you will learn how to give support Dark Mode in Xamarin.Forms..

Thanks for reading. Please share your comments and feedback. 

Happy Coding :)