/r/xamarindevelopers

Photograph via snooOG

A space for Xamarin developers to ask questions or discuss their latest projects.

Welcome to the Xamarin subreddit!

/r/xamarindevelopers

5,820 Subscribers

1

Getting calendar service

Hey while I am technically using Maui I was wondering what is the best way to get write access to the user’s calendar and write to it for iOS and Android.

0 Comments
2024/11/28
23:37 UTC

1

Sending mails with TLS 1.2 from a Xamarin Forms app (Android)

Hi,

I've developed an Android app with Xamarin which sends out an email to a customer address. This works fine so far by using SmtpClient through servers which accept older TLS protocols like 1.0 or 1.1. But it fails when connecting to i.e. smtp-mail.outlook.com .

So far I tried to set the following but still no luck with TLSv1.2:

                //Enable suport TLS1.2
                ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
                SmtpServer.EnableSsl = true;

Any ideas? My app targets Android 13 with a minimum of Android 6.0. This should activate TLSv1.2 automatically by default but it doesn't.

1 Comment
2024/11/18
16:40 UTC

2

Android 14 Foreground Service Issue - Freezing on Splash Screen

I'm trying to run my app on an Android 14 phone and the splash screen appears, but it just hangs there and does nothing else until I force it closed. The app doesn't crash and there is no exception in Visual Studio.

I've done the following:

Added this permission to the manifest:

<uses-permission android:name="android.permission.FOREGROUND_SERVICE_LOCATION" />

Added this to BackgroundService.cs

StartForeground(NOTIFICATION_SERVICE_ID, builder.Build(), Android.Content.PM.ForegroundService.TypeLocation);

Added this within <application> in the manifest:

<service android:name=".BackgroundService" android:foregroundServiceType="location" android:exported="false"></service>

Location always permission has been allowed in the app settings.

Can anyone help?

0 Comments
2024/10/15
15:10 UTC

1

Azure pipelines failing

I'm having an issue with building Xamarin Forms apps through Azure Piplines. When it gets to the step to install Xamarin in the build agent the URL requested returns at 404. software.xamarin.com Is anyone else experiencing this and found a workaround? I'm afraid that Microsoft has killed the ability to build through Pipelines.

Querying https://software.xamarin.com/Service/Updates?v=2&pv964ebddd-1ffe-47e7-8128-5ce17ffffb05=0&pv4569c276-1397-4adb-9485-82a7696df22e=0&pvd1ec039f-f3db-468b-a508-896d7c382999=0&pv0ab364ff-c0e9-43a8-8747-3afb02dc7731=0&level=Stable
Retry attempt 1: System.Net.Http.HttpRequestException: Response status code does not indicate success: 404 (Not Found).

4 Comments
2024/09/30
13:49 UTC

1

Updates for TinyInsights, what is new for NET MAUI developers that want to use Application Insights!

0 Comments
2024/09/23
09:03 UTC

0

Facing Freeze Bug in Xamarin.Forms iOS SDK 14.0 After iOS 18 Update

I'm experiencing a freeze issue in Xamarin.Forms iOS SDK version 14.0 after updating to iOS 18. When I open the app, a modal for notifications appears. I can interact with the modal just fine, but once I close it, the app freezes and becomes unresponsive. I can't click anywhere. The only workaround I've found is switching to landscape mode and back to portrait, which unfreezes the app. However, the issue persists each time I relaunch the app. Has anyone else encountered this, or know of a fix?

2 Comments
2024/09/18
11:13 UTC

7

why is Xamarin not as popular as React native and Flutter?

why is Xamarin not as popular as React native and Flutter?
basically it does same as React native and Flutter and was on market before them

but somehow market share is very less for xamarin

10 Comments
2024/09/17
21:58 UTC

1

Beginner Online Question

This is a super basic question but can you create online apps using xamarin? Like can you make apps that can connect and share information with eachother like in a lobby system or such?

1 Comment
2024/09/17
04:34 UTC

0

SDK issues

Working on a xamarin project in .net 7 and i'm getting this error
The TargetFrameworkVersion (Android API level 33) is lower than the targetSdkVersion (34). Please increase the `$(TargetFrameworkVersion)`
Attempted to add targetSdk as 34 in my manifest file but it didn't work

5 Comments
2024/08/27
09:59 UTC

0

Android 14

I have a xamarin project that im trying to update to Android 14 to release to the google play store. In the AndroidManifest editor i can quite happily select android 14. But in the Android.csproj properties, it only goes up to Android 13 - any ideas why? my SDK manager is all up to date, and has Android 14 installed.

2 Comments
2024/08/23
09:00 UTC

0

What is the equivalent of .Net Embedded in .Net 8 / MAUI?

0 Comments
2024/08/21
11:51 UTC

1

Android Devices running Android 13 and earlier cannot reach backend due to SSL issues after migrating backend firewall to Cloudflare. Any ideas?

Over the weekend we migrated our firewall and security to Cloudflare. Ever since, on Android devices running Android OS 13 or older, requests to the backend from my Xamarin Forms app drop immediately. Switching networks, uninstall/ reinstall, and restarting device does not help.

Upon sending the request, it throws a System.Net.HttpException with the message “the SSL connection could not be established, see inner exception. Full stack trace below.

System.Net.Http.HttpRequestException: The SSL connection could not be established, see inner exception. --->   System.Security.Authentication.AuthenticationException: Authentication failed, see inner exception. --->   Mono.Btls.MonoBtlsException: Ssl error:1000007d:SSL routines:OPENSSL_internal:CERTIFICATE_VERIFY_FAILED   at /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/external/boringssl/ssl/handshake_client.c:1132   at Mono.Btls.MonoBtlsContext.ProcessHandshake () [0x00042] in /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/mcs/class/System/Mono.Btls/MonoBtlsContext.cs:220   at Mono.Net.Security.MobileAuthenticatedStream.ProcessHandshake (Mono.Net.Security.AsyncOperationStatus status, System.Boolean renegotiate) [0x000da] in /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/mcs/class/System/Mono.Net.Security/MobileAuthenticatedStream.cs:715   at (wrapper remoting-invoke-with-check) Mono.Net.Security.MobileAuthenticatedStream.ProcessHandshake(Mono.Net.Security.AsyncOperationStatus,bool)   at Mono.Net.Security.AsyncHandshakeRequest.Run (Mono.Net.Security.AsyncOperationStatus status) [0x00000] in /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/mcs/class/System/Mono.Net.Security/AsyncProtocolRequest.cs:289   at Mono.Net.Security.AsyncProtocolRequest.ProcessOperation (System.Threading.CancellationToken cancellationToken) [0x000fc] in /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/mcs/class/System/Mono.Net.Security/AsyncProtocolRequest.cs:223    --- End of inner exception stack trace ---   at Mono.Net.Security.MobileAuthenticatedStream.ProcessAuthentication (System.Boolean runSynchronously, Mono.Net.Security.MonoSslAuthenticationOptions options, System.Threading.CancellationToken cancellationToken) [0x0025c] in /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/mcs/class/System/Mono.Net.Security/MobileAuthenticatedStream.cs:310   at System.Net.Http.ConnectHelper.EstablishSslConnectionAsyncCore (System.IO.Stream stream, System.Net.Security.SslClientAuthenticationOptions sslOptions, System.Threading.CancellationToken cancellationToken) [0x0007b] in /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/external/corefx/src/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/ConnectHelper.cs:165    --- End of inner exception stack trace ---

1 Comment
2024/08/08
21:16 UTC

2

Weird iOS issue

I have taken over maintenance of a B2B Xamarin app. as far as I can see, not much work has been done on it for 3 years or so.

Running on Android (or at least an android emulator) works like a dream.

When I try to run/debug this on my iPhone, it goes quite weird in a number of places.

One specific issue - theres an if check:

if(Uri != null) {...}

When I get to that point, Uri is definitely null, according to my debugger, so it should skip this block. It doesnt, it goes straight in there. Does anyone have any ideas at all why this would happen?

3 Comments
2024/07/22
10:43 UTC

1

What are your thoughts on generating a mobile application from a description?

0 Comments
2024/07/22
09:45 UTC

1

iOS badge issue

hello, i have a problem with ios badge notifications. it regular show the badge when a notification arrives but when there's no notification it still show the badge "1"

what is the problem and how can i handle it?

0 Comments
2024/07/10
20:36 UTC

2

Converting Xamarin to .NET 8 I ran into a problem

I'm converting my Xamarin app (for Android) to .NET 8. The app source code in Resources/values has these files:

colors.xml:

<resources> <color name="colorPrimary">#DD5706</color> <color name="colorPrimaryDark">#1B3147</color> <color name="colorAccent">#8167E6</color>
  <color name="white">#ffffff</color>
  <color name="darkwhite">#EFFFFE</color>
  <color name="transparent">#00ffff</color>
  <color name="semitransparent">#880000</color>
  <color name="orange">#ff8800</color>
  <color name="light_orange">#e27d18</color>
  <color name="light_blue">#87CEEB</color>
  <color name="black">#000000</color>
  <color name="menuButtonColor">#ea8e44</color>
  <color name="btn_normal">#ea8e44</color>
  <color name="pressed_color">#e27d18</color>
  <color name="default_color">#f8f1e7</color>
  <color name="selected">#f8dcd3</color>
</resources>

And in the drawable folder is background.xml:

<selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:drawable="@android:color/background_light" android:state_pressed="false" android:state_selected="false"/> <item android:drawable="@color/orange" android:state_pressed="true" android:state_selected="true"/> <item android:drawable="@color/light_blue" android:state_pressed="false" android:state_selected="true"/> </selector>

Yet when I build the app I see a series of errors like this:

resource color/orange (aka com.xyz.MyApp:color/orange) not found.

Any help is greatly appreciated.

3 Comments
2024/06/29
00:12 UTC

2

AppCenter is retiring! This is how to use Application Insights for your .NET MAUI apps!

0 Comments
2024/06/17
08:49 UTC

7

Experiences migrating xamarin forms to .net Maui?

Hello devs, just looking to hear your experiences migrating a cross platform xamarin forms app to .net Maui

  1. what problems did you have, what would you do different?
  2. Did you use the assistant or did it manually?
  3. Did you convert to single project style or not, and why?
17 Comments
2024/06/11
14:05 UTC

1

Android debugger not starting in Visual Studio

I have an application in Xamarin for android. When I try to start the android emulator in debug mode from Visual Studio in debug mode, the application is launched on the emulator after a few minutes of build. But it shows a screen showing "Waiting for debugger to attach", and after some time the debug session ends abruptly with the following message in the output window:
warning: could not connect jdwp. system.exception: process not found.
Can someone please help me figure out the issue?

3 Comments
2024/06/03
10:59 UTC

4

Migrating from Xamarin

I'm really new to .NET and Xamarin and I need to migrate an app that was written (not by me) for Xamarin.iOS and Xamarin.Android to something that's still supported. Right now there's a Visual Studio solution with a project for shared classes, and Xamarin.iOS and Xamarin.Android projects for platform specific code. It's a native Xamarin project but a lot of classes still have using Xamarin.Forms. I don't even know what I'm supposed to upgrade to, apparently .NET for android and .NET for iOS is what you're supposed to migrate to from native Xamarin, but also Maui is what you're supposed to migrate to if you're using Xamarin.Forms, but also Maui is hard to migrate to from native Xamarin? Does anyone know what I'm supposed to migrate to and how to do that?

11 Comments
2024/05/31
00:04 UTC

3

New stable release Plugin.Maui.AppRating

Hi everyone, I just wanted to let you know that I have released a new stable version of the Plugin.Maui.AppRating package.

  • Added .Net8 support to all platforms.
  • Updated libraries.
  • Added FakeReviewManager to Android.
  • Fixed Windows implementation.

Check it out!

https://github.com/FabriBertani/Plugin.Maui.AppRating

0 Comments
2024/05/20
16:55 UTC

3

New to Xamarin

Hello all I am a college student who has been tasked with learning Xamarin, this is my first mobile/crossplatform language how would uou go about learning it?

24 Comments
2024/04/28
12:42 UTC

3

How to create a thread in background and not affect the main thread?

I’m working on a project in my company, but a difficulty arose in creating threads to verify communication with WebService and update the UI. Currently, this thread is hindering the proper functioning of the application. Has anyone ever had a similar problem? If so, how can I solve it?

10 Comments
2024/04/19
12:35 UTC

1

Convert to a Blazor Hybrid app in Visual Studio Code for Mac

Im considering porting some of my XF apps over to Blazor Hybrid. Is it possible to do so on a Mac with Visual Studio code? I don't see anything about Blazor Hybrid with visual studio code when I google.

thanks in advance

2 Comments
2024/04/18
20:42 UTC

1

I want to improve the performance of my app.

0 Comments
2024/04/18
04:04 UTC

7

Xamarin app in the future

Does anyone know what will happen with my Xamarin Forms app when Apple are ending support for Xcode 15 next year? Will my app still be available on App Store for devices above IOS 17? Since a lot of people mention that Maui is still not ready for production, I was hoping to wait 8-12 months before converting, but if my app will be unusable when a new IOS version is released, I have to start researching for alternatives.

6 Comments
2024/04/02
15:58 UTC

Back To Top