Xamarin Forms Android – How to Enable Proguard Shrinker in Visual Studio for Mac 2019

All we need is a simple explanation of the problem, which is provided below. I am trying to invoke Proguard Code Shrinker for my XF 5.x Android Application in Visual studio for Mac 2019. It looks like I need the Windows version from the Documentation. Is that true? https://docs.microsoft.com/en-us/xamarin/android/deploy-test/release-prep/proguard?tabs=macos Let’s Solve it: This is a … Read more

Android Foreground Location Service stops after some time

All we need is a simple explanation of the problem, which is provided below. Im using this code to get location updates for my Xamarin Android app. I have 2 questions. How to make this foreground service to run forever? I’ve tried to change return StartCommandResult.NotSticky; to return StartCommandResult.Sticky; and remove anything from OnDestroy() method, … Read more

Why has SpeechRecognizer suddenly stopped working?

All we need is a simple explanation of the problem, which is provided below. My Android app (Xamarin) uses speech recognition. This has worked fine on smartphones with Android 8, 11 and 12. Since a few weeks the speech recognition of my app has stopped working with Android 11 (2 different smartphones tested). It still … Read more

Xamarin app shows blank page while looping

All we need is a simple explanation of the problem, which is provided below. I’m making an Android application on Xamarin and I want this code to be looped over and over. But when it’s looping it shows literally nothing public MainPage() { InitializeComponent(); for (int i = 0; i < 100; i++) { Thread.Sleep(2000); … Read more

Cant create an alarm in Xamerin Android C#

All we need is a simple explanation of the problem, which is provided below. Copied my teacher’s simplified code in order to see if the code i wrote was wrong or somthing yet even her’s isnt working. Here is it: private void BtnAlarm_Click(object sender, EventArgs e) { Intent intentAlarm = new Intent(this, typeof(AlarmReceiver)); // #2 … Read more

Debugging MAUI app on Android after manual launch

All we need is a simple explanation of the problem, which is provided below. I have a MAUI app on Android which works perfectly when launched from Visual Studio with the debugger attached. If I published an APK and install it on the device manually, the application crashes as soon as I use the AppShell … Read more

Trust additional CAs and make use of the Android certificate store in a net6 MAUI solution

All we need is a simple explanation of the problem, which is provided below. System.Net.WebException: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found.’ This is an error that occurs in my VS2022 solution when working with a self signed certificate and Android. The case is the following: It is an android app that runs on … Read more

Xamarin Forms Connect to Wifi >= API Level 29

All we need is a simple explanation of the problem, which is provided below. I try to connect to a specific Wifi but everytime I get a System.NullReferenceException: ‘Object reference not set to an instance of an object.’ (commented in code) Here is my method public static Task ConnectToWifi(Wifi wifi) { var wifiSpecififier = new … Read more