2020.09.01.

Xamarin.Forms send and receive SMS

This project you can find it at: https://github.com/officialdoniald/Xamarin.Forms.SendAndReceiveSMS We can easily send SMS from various platforms, but we can’t read SMSs so easily. Android: Receive SMS: In Android we can send and receive/read SMSs with just few line of code. We have to implement a BroadcastReceiver and gain permission in the AndroidManifest.xml. 1. AndroidManifest.xml(https://github.com/officialdoniald/Xamarin.Forms.SendAndReceiveSMS/blob/master/SendAndReceiveSMS/SendAndReceiveSMS.Android/Properties/AndroidManifest.xml): We have to gain permission to RECEIVE_SMS, READ_SMS, SEND_SMS and WRITE_SMS. […]

2020.09.01.

Xamarin.Forms using Mqtt

We can using of course mqtt in Xamarin.Form via dependency service / Xamarin.Forms.MessagingCenter, event or simply create a class instance. We are following the last option. First step, we need to install the MQTTnet NuGet Package for the Solution. (So in each project.) .NET Standard Library: We need to create an MqttClientRepository class in the .NET Standard Library. Next step the platform specific implementations. Android: […]

2020.09.01.

Xamarin.Forms Runtime Permission Handling above Android 6.0

After Android 6.0, we have to using Runtime Persmissions. No more enaugth to create an Android.Manifest file. How can we correctly use it? Step 1: Android.Manifest file Still we have to create an Android.Manifest file, but a little bit otherwise. We have to use this way: https://developer.android.com/training/permissions/requesting#java. So, if we have used it so far as “uses-permission” before, from now we have to use it […]

2020.09.01.

Xamarin.Forms save and open PDF file

This project you can find at: https://github.com/officialdoniald/Xamarin.Forms.Save.Open.PDF. It could be a real situation that your app need to save or open a pdf file. How can it possible? Throught DependencyService. There are many companies, who deal with generationg PDF Document in Xamarin.Forms. We need to create a PDF Document first and than save it. But if you want to open an exists document, just read […]

2020.09.01.

Xamarin.Forms get user location when it change

This project you can find at: https://github.com/officialdoniald/Xamarin.Forms.DetectUserLocationCange When you need to update the user’s location when it change you can make it in Xamarin.Forms too via DependencyService or using Xamarin.Essentials and create a Timer and get the actual Location per seconds (don’t do that :D). Before coding, we have to satisfy the users permissons. Andorid: (https://github.com/officialdoniald/Xamarin.Forms.DetectUserLocationCange/blob/master/Xamarin.Forms.DetectUserLocationCange/Xamarin.Forms.DetectUserLocationCange.Android/Properties/AndroidManifest.xml) Turn ACCESS_COARSE_LOCATION on. iOS: (https://github.com/officialdoniald/Xamarin.Forms.DetectUserLocationCange/blob/master/Xamarin.Forms.DetectUserLocationCange/Xamarin.Forms.DetectUserLocationCange.iOS/Info.plist) ATTENTION: if you will […]

2020.09.01.

Xamarin.Forms change ListView SelectedItemColor

This project you can find at: https://github.com/officialdoniald/Xamarin.Forms.ChangeListviewSelectedColor We have to create a Custom Renderer for a ViewCell. So let’s create a class in the .NET Standard,/PCL Project: https://github.com/officialdoniald/Xamarin.Forms.ChangeListviewSelectedColor/tree/master/Xamarin.Forms.ChangeLvSelectedColor/Xamarin.Forms.ChangeLvSelectedColor/CustomControl/ListViewCustomViewCell.cs/ We created a property for the SelectedItem’s color. Don’t forget: this enum is a cutom enum, we have to create it: https://github.com/officialdoniald/Xamarin.Forms.ChangeListviewSelectedColor/blob/master/Xamarin.Forms.ChangeLvSelectedColor/Xamarin.Forms.ChangeLvSelectedColor/Helper/Enums.cs Let’s create the platform specific code. Android: we have to change the Android’s Theme at […]

2020.09.01.

Xamarin.Forms – Android – change the Theme at runtime

This project you can find at: https://github.com/officialdoniald/Xamarin.Forms—Change-Android-Theme-at-runtime In the .NET Standard/PCL Project we can’t say that, please change the Theme right now, because wehave to implement some platform specific implementation in the Android project. How can the two project communicate? Now, we will see another way, unlike the previous ones, we will use events, not dependency service. So, let’s create our event class in the […]

2020.09.01.

Xamarin.Android.SerialPort

This project you can find at: https://github.com/officialdoniald/Xamarin.Android.SerialPort. Serial Port wrapper for Xamarin.Android. If you want to change some feature of the Serial Port, just clone this repo and change it. In the SerialPort project you have to go to the SerialPortWrapper folder and the SerialPort.cs. After the update you have to Rebuild, and if you want to use the recently updatet SerialPort class, you have […]

2020.09.01.

Xamarin.Android.CanBus

This project you can find at: https://github.com/officialdoniald/Xamarin.Android.Canbus. Usage: Don’t forget to copy the lib folder to your project! First step: copy the lib folder to you project. You have to change the Properties of theese files: libcanbus.so: AndroidNativeLibrary canbus_helper.jar: AndroidJavaLibrary canbus_micro_fixed.jar: AndroidJavaLibrary Create Canbus: Canbus _canbus = _canbus = new Canbus(250000); _canbus.PackageReceive += Canbus_PackageReceive; _canbus.CanbusStatusChanged += Canbus_CanbusStatusChanged; _canbus.CanbusExceptionOccour += Canbus_CanbusExceptionOccour; Read from the Canbus: Sending […]

2020.09.01.

Xamarin.Forms – CustomMasterDetailPage – change navigation icon(back button and “hamburger” menu button) – Android

This project, you can find at: https://github.com/officialdoniald/Xamarin.Forms.CustomControls We have to create some platforms specific code (custom NavigationPage Renderer), because in the base Xamarin.Forms code, we can’t find this implementation. So first step, we have to create a class in the .NET Standard/PCL project: CustomMasterDetailPage( https://github.com/officialdoniald/Xamarin.Forms.CustomControls/blob/master/XamarinForms.CustomControls/XamarinForms.CustomControls/MasterDetailPage/CustomMasterDetailPage.cs ). using Xamarin.Forms; using XamarinForms.CustomControls.Enums; namespace XamarinForms.CustomControls.MasterDetailPage { public class CustomMasterDetailPage : Xamarin.Forms.MasterDetailPage { public CustomMasterDetailPage() : base() { } […]