Tag: forms

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. Forms: We can detect Location changing in the Forms Project: https://github.com/officialdoniald/Xamarin.Forms.MockLocation/blob/master/Xamarin.Forms.MockLocation.Mobile/Xamarin.Forms.MockLocation.Mobile/MainPage.xaml.cs. If we will get a Mock Location this will detect it. The two platforms need to be discussed separately. In Android we can make an Implementation for Mock Location, but in iOS, we have to use a script file and we have to add to the emulator, […]

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, […]

2020.09.01.

Xamarin.Forms – CustomSearchBar

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: CustomSearchBar ( https://github.com/officialdoniald/Xamarin.Forms.CustomControls/blob/master/XamarinForms.CustomControls/XamarinForms.CustomControls/SearchBar/CustomSearchBar.cs ). using Xamarin.Forms; namespace XamarinForms.CustomControls.SearchBar { public class CustomSearchBar : Xamarin.Forms.SearchBar { public static readonly BindableProperty BorderColorProperty = BindableProperty.Create(nameof(BorderColor), […]

2020.09.01.

Xamarin.Forms – CustomEntry (BorderWidth, BorderColor and TextPadding)

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: CustomEntry ( https://github.com/officialdoniald/Xamarin.Forms.CustomControls/blob/master/XamarinForms.CustomControls/XamarinForms.CustomControls/Entry/CustomEntry.cs ). using Xamarin.Forms; namespace XamarinForms.CustomControls.Entry { public class CustomEntry : Xamarin.Forms.Entry { public static readonly BindableProperty BorderColorProperty = BindableProperty.Create(nameof(BorderColor), […]

2020.09.01.

Xamarin.Forms – ListView – CustomTextCell

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: CustomTextCell ( https://github.com/officialdoniald/Xamarin.Forms.CustomControls/blob/master/XamarinForms.CustomControls/XamarinForms.CustomControls/ListView/CustomTextCell.cs ). using Xamarin.Forms; namespace XamarinForms.CustomControls.ListView { public class CustomTextCell : TextCell { public static readonly BindableProperty TextFontSizeProperty = BindableProperty.Create(“TextFontSize”, […]

2020.09.01.

Xamarin.Forms – NavigationPage Horizontal Alignment Center Title on 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: CustomNavigationPage ( https://github.com/officialdoniald/Xamarin.Forms.CustomControls/blob/master/XamarinForms.CustomControls/XamarinForms.CustomControls/NavigationPage/CustomNavigationPage.cs ). using Xamarin.Forms; using XamarinForms.CustomControls.Enums; namespace XamarinForms.CustomControls.NavigationPage { public class CustomNavigationPage : Xamarin.Forms.NavigationPage { public CustomNavigationPage() : base() { […]