Tag: forms

2020.12.17.

Xamarin.MQTT

https://github.com/officialdoniald/Xamarin.MQTT NuGet Gallery | Xamarin.MQTT 1.0.0 Usage: I created two contructors of the MQTTConnection class. You can init this object with a specific MqttClientOptions and a string array of your topics, or with username, passowrd, a string array of your topics, servername, port and clientid. https://github.com/officialdoniald/Xamarin.MQTT/blob/master/Xamarin.MQTT.Example/Xamarin.MQTT.Example/App.xaml.cs I created in the App.cs a static variable of the MQTTConnection class, so I can reach this object anywhere. […]

2020.12.16.

Xamarin.Forms.SaveOpenPDFPackage

Xamarin.Forms.Save.Open.PDF/README.md at master · officialdoniald/Xamarin.Forms.Save.Open.PDF (github.com) NuGet Package: https://www.nuget.org/packages/Xamarin.Forms.SaveOpenPDFPackage/ Download this Package just in your Standard Library. Platform specific things: Android: In the AndroidManifest.xml file, you have to add theese lines: https://github.com/officialdoniald/Xamarin.Forms.Save.Open.PDF/blob/master/Xamarin.Forms.Save.Open.PDF/Xamarin.Forms.Save.Open.PDF.Android/Properties/AndroidManifest.xml Create, if you don’t create yet, an “xml” folder into the “Resources” folder in the Android Project, and create an xml file, and call it: “provider_paths.xml”. The file should contain: https://github.com/officialdoniald/Xamarin.Forms.Save.Open.PDF/blob/master/Xamarin.Forms.Save.Open.PDF/Xamarin.Forms.Save.Open.PDF.Android/Resources/xml/provider_paths.xml Android ready, let’s go […]

2020.12.11.

Xamarin.Forms.DynamicSize

officialdoniald/Xamarin.Forms.DynamicSize (github.com) NuGet Package: NuGet Gallery | Xamarin.Forms.DynamicSize 1.0.0 What and when should this package be used? If you’re making a design plan and you only made it to one size and you gave everything a fixed size, so this little package is for you. This can dynamically increase the size no matter what resolution device you are running on. You don’t have to worry […]

2020.11.26.

Xamarin.Forms.MVVM

officialdoniald/Xamarin.Forms.MVVM This Package implement the https://docs.microsoft.com/en-us/xamarin/xamarin-forms/enterprise-application-patterns/dependency-injection TinyIoC Container. => You can use DI in your code. Naming convention is very important!!! MVVM: You have to create the common folders: Model, View and ViewModel. Model: Not nessessary to create this folder, but the nice thing would be to make a separate folder for UI models. If you want to Bind a model’s Property, you have to derive your […]

2020.09.01.

Xamarin.Forms – Using MQTT and Azure IoT Hub

If you have an Azure IoT Hub, you may also need a mobile app. You can communicate with Azure IoT Hub just like a regular MQTT. First step: create a Xamarin.Forms application (but very important, you can use this snippet in any native project, just copy this to the platform’s project). Right click on the Standard Library and click on Manage NuGet Packages. Add the […]

2020.09.01.

Xamarin.Forms – Mock Locations

This Project you can find at: https://github.com/officialdoniald/Xamarin.Forms.MockLocation. Download my NuGet Package: NuGet Gallery | Xamarin.MockLocationPlugin 1.0.0 Android: First, we have to request permissions in the Manifest and in the MainActivity (Runtime). Manifest: https://github.com/officialdoniald/Xamarin.Forms.MockLocation/blob/master/Xamarin.Forms.MockLocation.Mobile/Xamarin.Forms.MockLocation.Mobile.Android/Properties/AndroidManifest.xml MainActivity: https://github.com/officialdoniald/Xamarin.Forms.MockLocation/blob/master/Xamarin.Forms.MockLocation.Mobile/Xamarin.Forms.MockLocation.Mobile.Android/MainActivity.cs Sending mock lockation from Standard Library: DependencyService.Get().SendMockLocation(new IMockLocationPlugin.MockPosition() { Longitude = 24.234234, Latitude = 46.3213123, Accuracy = 1.0f, Altitude = 15, Bearing = 5f, Speed = 50f }); Deploy your […]

2020.09.01.

Xamarin.Forms Twilio implementation

This project you can find at: https://github.com/officialdoniald/Xamarin.Forms.Twilio Twilio created just for Android and iOS libs and not for Xamarin. So we need to create Bindings for Xamarin.Forms and native. First step: we need to create Android Binding Library(https://github.com/officialdoniald/Xamarin.Forms.Twilio/tree/master/Xamarin.Forms.Twilio.PoC/Xamarin.Android.Twilio.Client) and iOS Binding Library(https://github.com/officialdoniald/Xamarin.Forms.Twilio/tree/master/Xamarin.Forms.Twilio.PoC/Xamarin.iOS.Twilio.Client) in an Emptys Solution. We have to add the .aar/.jar file(to Jars folder to Android) and .a files (as native reference to iOS) […]

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 – 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() { } […]

2020.09.01.

Xamarin.Forms – change cursor’s color – Android

This code (https://github.com/officialdoniald/Xamarin.Forms.CustomControls/blob/master/XamarinForms.CustomControls/XamarinForms.CustomControls.Android/CustomRenderer/CustomEntryRenderer.cs ) : IntPtr IntPtrtextViewClass = JNIEnv.FindClass(typeof(TextView)); IntPtr mCursorDrawableResProperty = JNIEnv.GetFieldID(IntPtrtextViewClass, “mCursorDrawableRes”, “I”); will change the cursor’s color. If you want to really change the color of the cursor, you have to create in the Resources/Drawable folder a my_cursor.xml file: https://github.com/officialdoniald/Xamarin.Forms.CustomControls/blob/master/XamarinForms.CustomControls/XamarinForms.CustomControls.Android/Resources/drawable/my_cursor.xml <shape xmlns:android=”http://schemas.android.com/apk/res/android” android:shape=”rectangle”> <solid android:color=”@color/colorCursors”></solid> <size android:width=”2dp” /> </shape> @color/colorCursors is a color from the Resources/values/color.xml. If you don’t have this file, […]