android
52 TopicsMaui How to upload a file to web API in .NET 9
Hi, everyone I'm trying to upload an image to an API from a maui project. But when I send the file, the response is always BadRequest. However the API works if I use Postman. I create a client in a console project and it worked. So I don't know why the same code in .NET MAUI it doesn't work. Problem is not in URI or something. I hope you could help me. Reegrets. Victor Cueto API throws the next exception: Microsoft.AspNetCore.Http.BadHttpRequestException: Required parameter "IFormFile image" was not provided from form file. at lambda_method3(Closure, Object, HttpContext, Object) at Microsoft.AspNetCore.Http.RequestDelegateFactory.<>c__DisplayClass103_2.<<HandleRequestBodyAndCompileRequestDelegateForForm>b__2>d.MoveNext() --- End of stack trace from previous location --- at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddlewareImpl.Invoke(HttpContext context) code Minimal API: error:39Views0likes0CommentsVersioning my Maui Android App
Previously the way to define version code for Android in Maui .csproj file was like this: <!-- Versions --> <ApplicationVersion>3.1.2</ApplicationVersion> <AndroidVersionCode>3</AndroidVersionCode> With the new release of Visual Studio Preview, this has changed to: <ApplicationVersion>3</ApplicationVersion> It works, from Visual Studio, I can bundle a new .aab package (see image below). We see the version code is defined to 3. Unfortunately the version is defined to 1.0.0 and I don't know how to change this. ...when imported on the Google Play Console, it look like this: Unfortunately, when imported I only see the versionCode 3 (which is defined in the .csproj file as ApplicationVersion). What about the versionName (in parentheses) ? Nothing is planned in the .csproj file ? When imported on the Google Play Console, I don't want to have 3 (1.0.0) but I want 3 (3.1.2)... https://developer.android.com/studio/publish/versioning versionCode — A positive integer used as an internal version number. versionName — A string used as the version number shown to users.25KViews0likes8Comments- 60Views0likes2Comments
MAUI APP does not run, android-API34 issue ?
Hi everyone, i'm facing a problem using dotnet 8.0 and Maui. I read that an android api is automatically associated to a dotnet version. So for .Net 8.0 the android api is 34.0 I installed the Maui workload and created a new project, then i ran(build) it without any modifications and all the necessay packages installed without issues But when i go to the generated bin folder and run windows app it does'nt even show up, For android part i installed the signed-apk in virtual device and here is what i get : I found somewhere that this was the api 34 issue, i tried to install .Net 7.0-API 33 and .Net 9.0-API 35.0 but facing the same problem. What should i do now... please help me THNKS!!!420Views0likes2CommentsMaui app with multiple Android activities
Really dumb question: How do I create a dot net Maui app with multiple Android activities? I want to create an SMS app, and such an app requires an activity to handle an intent to compose a new sms message. I would like that activity to launch the Maui page used to compose SMS messages, and maybe change the shell navigation tree so that that page is considered the root for that activity. I can't seem to find a simplr description go how to do this.190Views0likes0Commentsbinding property shadows net maui android
Buongiorno a tutti, scusate ma sono molto molto inesperto e non so nemmeno come fare le domande giuste. Volevo chiedere se esiste la possibilità di creare un binding per le proprietà ombra di un controllo (ad esempio un pulsante) Qualcosa che potrebbe assomigliare a questo. Grazie a tutti. Classe: public class Shadows { public string Brush { get; set; } = "Black"; public string Offset { get; set; } = "50,50"; public string Radius { get; set; } = "10"; public string Opacity { get; set; } = "0.7"; } Codice XAML: <Button x:Name="CounterBtn" Text="Click me" SemanticProperties.Hint="Counts the number of times you click" Clicked="OnCounterClicked" BorderColor="DarkBlue" BorderWidth="1" HorizontalOptions="Fill" > <Button.Shadow> <Shadow Brush="{Binding ControlShadow.Brush}" Offset="{Binding ControlShadow.Offset}" Radius="{Binding ControlShadow.Radius}" Opacity="{Binding ControlShadow.Opacity}" /> </Button.Shadow> </Button> Pagina principale: public partial class MainPage : ContentPage { int count = 0; public Shadows ControlShadow { get; set; } public MainPage() { InitializeComponent(); ControlShadow = new Shadows(); BindingContext = this; } } Non funziona come l'ho pubblicato. Grazie molto.138Views0likes0CommentsUnique Device Identifier in MAUI
I am looking for a way to get a device identifier in NET MAUI that is cross platform compliant between Android/iOS/Windows. I originally had this code working in Xamarin Forms with the following: Android Context context = Application.Context; id = Settings.Secure.GetString(context.ContentResolver, Settings.Secure.AndroidId); iOS UIDevice.CurrentDevice.IdentifierForVendor.AsString().Replace("-", ""); Is there anything currently or planned in the future for use in NET MAUI. Thanks In Advance, Stuart Ferguson11KViews3likes1Comment.NET8 MAUI Image "gif" animation Debug vs. Release
Has anyone figured out how to get a MAUI Image "gif" animation to work in Release mode? Using Visual Studio 2022's Android Device Manager, Emulator set to Tablet M-DPI 10.1in - API34, Android 14.0 - API 34, the MAUI Image animation in Debug mode works every single time! Awesome! However, when I switch the Build to Release mode and Deploy to the Emulator, the application responds just fine but I see a Image control presenting a FROZEN "gif" and I don't know how to solve the problem. I experience the same FROZEN "gif" problem if the Emulator is running Pixel 6 Pro Android 14 - API 34. Using the Debug build, Pixel 6 Pro Android 14 - API 34 Emulator shows the Image control animating the "gif" perfectly! However, switching Build to Release mode and Deploying to the Pixel 6 Pro Emulator, again I experience the application responding just fine, but the Image control presents a FROZEN "gif". Here's my XAML definition for my Image element: <Image x:Name="ClintHatGif" Source="clinteastwood.gif" IsAnimationPlaying="True" Aspect="AspectFit" VerticalOptions="Center" HeightRequest="180" /> When I select my Project and visit "Manage NuGet Packages" and select the "Updates" tab, no updates appear. So, I think I've got the latest. Maybe you know of a NuGet Package or a Build Release setting that solves the problem? I'm unsure how to proceed. Thanks for reading this post.377Views0likes0Comments