Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all 77050 articles
Browse latest View live

Android Rg.Plugins.Popup not working

$
0
0

I just recently converted a PCL project to Netstandard. I'm slowly trying to work through issues. Since our popup code no longer works, a derivative of XLabs, I'm trying to use this new plugin.

Download the demo project and running it works fine. When I use the exact same code in our project all I get is a dimming of the screen. I can tap on the edge of the screen and it goes away. So its doing something. OnAppearing is being hit so it's rendering. I'm using the same xaml and code behind from the demo, specifically the LoginPopupPage.xaml

The project is using master/detail if that matters. Rg is being initialized in OnCreate in MainActivity.cs. I have it referenced in the droid and netstandard project.

Any ideas?


Secondary ToolbarItems under Android replaced by vertical more (ellipsis) icon

$
0
0

Using Xamarin.Forms 4.4.0 in a Shell application. When I add a secondary ToolbarItem (text or image) on Android it is replace by a vertical more icon (3 dots vertically). Touching the icon shows a dropdown that contains the actual ToolbarItem. It there any way to prevent this from happening

Xamarin forms pinch and pan gesture together

$
0
0

Hi,
I spent too much time to check all the post and for searching for code who permit pinch and pan gesture in same time. All the time, for me, there is a bug or a problem with the code. I changed the Microsoft code for have a pinch and pan that work really great.

Create a Content Page
Add the reference :
xmlns:local="clr-namespace:applicationname"

Add image on your form, I put FillAndExpand to be sure that all the layers take all the screen place :

<local:PinchPanContainer.Content HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand">

</local:PinchPanContainer.Content>

Create a class name PinchPanContainer.cs. The OnPinchUpdated is a copy-paste in the Microsoft code but I added a bool blnDisableMove to disable the first pan move after a pinch move. On real device, not on simulator, when you pinch gesture some time you pan in same time. This result to pinch gesture that work very well, but at the end your image goes to the wrong location because the panning motion run afterwards. Anyway, on real device you don't see any delay with the pan move. The OnPanUpdated is a combinaison of the Microsoft code and the code in this post : I can't publish a url because I'm a new user and I what to share my code to help others one. I add the scale factor to the Microsoft code and I add my bool blnDisableMove to set this one to false to permit the pan move after the first completition. I also replace the App.ScreenWidth on the Microsoft code because this code doesn't seem to exist anymore. I replace with this Application.Current.MainPage.Width. In my initial code the Application.Current.MainPage.Width and Application.Current.MainPage.Height was Content.Width and Content.Height because I set the to take all the screen and it work really great.

using System;
using Xamarin.Forms;

namespace jardins
{
public class PinchPanContainer : ContentView
{
double currentScale = 1;
double startScale = 1;
double xOffset = 0;
double yOffset = 0;
bool blnDisableMove = false;

    public PinchPanContainer()
    {
        var pinchGesture = new PinchGestureRecognizer();
        pinchGesture.PinchUpdated += OnPinchUpdated;
        GestureRecognizers.Add(pinchGesture);

        var panGesture = new PanGestureRecognizer();
        panGesture.PanUpdated += OnPanUpdated;
        GestureRecognizers.Add(panGesture);
    }

    void OnPanUpdated(object sender, PanUpdatedEventArgs e)
    {
        if (Content.Scale == 1)
        {
            return;
        }

        switch (e.StatusType)
        {
            case GestureStatus.Running:

                if (!blnDisableMove)
                {
                    Content.TranslationX = Math.Max(Math.Min(0, xOffset + (e.TotalX * Scale)), -Math.Abs((Content.Width * Content.Scale) - Application.Current.MainPage.Width));
                    Content.TranslationY = Math.Max(Math.Min(0, yOffset + (e.TotalY * Scale)), -Math.Abs((Content.Height * Content.Scale) - Application.Current.MainPage.Height));
                }

                break;

            case GestureStatus.Completed:

                if (blnDisableMove)
                {
                    blnDisableMove = false;
                    return;
                }
                // Store the translation applied during the pan
                xOffset = Content.TranslationX;
                yOffset = Content.TranslationY;
                break;
        }
    }

    void OnPinchUpdated(object sender, PinchGestureUpdatedEventArgs e)
    {
        if (e.Status == GestureStatus.Started)
        {
            // Store the current scale factor applied to the wrapped user interface element,
            // and zero the components for the center point of the translate transform.
            startScale = Content.Scale;
            Content.AnchorX = 0;
            Content.AnchorY = 0;
            blnDisableMove = true;
        }
        if (e.Status == GestureStatus.Running)
        {
            // Calculate the scale factor to be applied.
            currentScale += (e.Scale - 1) * startScale;
            currentScale = Math.Max(1, currentScale);

            // The ScaleOrigin is in relative coordinates to the wrapped user interface element,
            // so get the X pixel coordinate.
            double renderedX = Content.X + xOffset;
            double deltaX = renderedX / Width;
            double deltaWidth = Width / (Content.Width * startScale);
            double originX = (e.ScaleOrigin.X - deltaX) * deltaWidth;

            // The ScaleOrigin is in relative coordinates to the wrapped user interface element,
            // so get the Y pixel coordinate.
            double renderedY = Content.Y + yOffset;
            double deltaY = renderedY / Height;
            double deltaHeight = Height / (Content.Height * startScale);
            double originY = (e.ScaleOrigin.Y - deltaY) * deltaHeight;

            // Calculate the transformed element pixel coordinates.
            double targetX = xOffset - (originX * Content.Width) * (currentScale - startScale);
            double targetY = yOffset - (originY * Content.Height) * (currentScale - startScale);

            // Apply translation based on the change in origin.
            Content.TranslationX = targetX.Clamp(-Content.Width * (currentScale - 1), 0);
            Content.TranslationY = targetY.Clamp(-Content.Height * (currentScale - 1), 0);

            // Apply scale factor.
            Content.Scale = currentScale;

            blnDisableMove = true;
        }
        if (e.Status == GestureStatus.Completed)
        {
            // Store the translation delta's of the wrapped user interface element.
            xOffset = Content.TranslationX;
            yOffset = Content.TranslationY;

            blnDisableMove = true;
        }
    }
}

}

Background Thread

$
0
0

Hi,

I searched but couldn't find it. That's why I had to ask here. My question is:

I have a thread. While the thread is running and the application is in sleep mode, some phones terminate the program and thread but some phones don't. What can I do in this situation?

XF-Material

$
0
0

hi
Is it supported? XF-Material in uwp?

iOS - Cannot cal API when app is running background

$
0
0

Hi everyone, hope you can take a moment to read the issue I describe below and help me fix it. Sorry for my bad English.

I am developing an application that allows users to enter surveys. Application can work when offline/online.

Here is the concept:
1. In case of online: When user enter survey and click on submit button, the app will call api (use httpClient) to send survey info to server.
2. In case of offline: When user enter survey and click on submit button, the app will save survey info in local. After the mobile device connected network, it will call api to send survey info from local to server.

Workflow:
For android, it works for these cases:
When online:
1. Create survey, survey will be sent to server.
When offline:
1. Create survey => survey is saved at local.
1.1. Keep app is still opening and then connect network => survey is sent to server.
1.2. Touch home button so app run background => Connect network => survey is sent to server.
1.3. Users force-quit app => Connect network (in this case survey wont be sent to server) => Open app (survey will be synced to server)

For iOS, it works for these cases:
When online:
1. Create survey, survey will be sync to server (need to wait about 5 seconds before closed app. Because if closed immediately, it will error when calling api).
When offline:
1. Create survey=> survey is saved at local.
1.1. Keep app is still opening and then connect network => survey is sent to server.
1.2. Touch home button so app run background => Connect network (in this case survey wont be sent to server) => Open app (survey will be sent to server)
1.3. Users force-quit app => Connect network (in this case survey wont be sent to server) => Open app (survey will be sent to server)

So I see that everything works fine on Andoird.
However, there was a problem if the app run the background on iOS. Survey is only sent to the server if users open the app.
For iOS, I'm using Silent Notification. Will push Notification to the app every 5 minutes to trigger calling API (send survey to server) when the app is running background. For now, the app can call API when app receive notification but there is an error occurred while calling api.

  • I have used my iPhone and tested on Facebook Messenger, in case I send a message while offline and then touch the Home button to run background (not force-quit app). After network was connected, the message will be sent without having to open the app.

Here is the error:
NSLocalizedDescription=The network connection was lost., NSErrorFailingURLStringKey=[URL], NSErrorFailingURLKey=[URL], _kCFStreamErrorDomainKey=4}
--- End of inner exception stack trace ---
at System.Net.Http.NSUrlSessionHandler.SendAsync (System.Net.Http.HttpRequestMessage request, System.Threading.CancellationToken cancellationToken) <0x104e298d0 + 0x0091f> in <e7de71939f4649d9bdfb2e2411afa951#ca5a74421adead0e302c060b720be5bb>:0
at System.Net.Http.HttpClient.SendAsyncWorker (System.Net.Http.HttpRequestMessage request, System.Net.Http.HttpCompletionOption completionOption, System.Threading.CancellationToken cancellationToken) <0x104de7dd0 + 0x00423> in <51ea6b8d5ff1420888885e4cb6c720e9#ca5a74421adead0e302c060b720be5bb>:0
at SurveyApp.Service.RestClient.PostAsync[T,TP] (System.String url, TP t, System.Nullable1[T] token) <0x105c15460 + 0x00984> in <b617b7a5ed5c409182b773f98768e9a9#ca5a74421adead0e302c060b720be5bb>:0 at SurveyApp.Service.SyncService.Push (System.Collections.Generic.IList1[T] synchronizations) <0x105c1d7a0 + 0x001e7> in <b617b7a5ed5c409182b773f98768e9a9#ca5a74421adead0e302c060b720be5bb>:0
at SurveyApp.Service.SyncService.PushSurveys () <0x105c1d1b0 + 0x0028b> in <b617b7a5ed5c409182b773f98768e9a9#ca5a74421adead0e302c060b720be5bb>:0 ","System.Net.Http.HttpRequestException The network connection was lost. at System.Net.Http.NSUrlSessionHandler.SendAsync (System.Net.Http.HttpRequestMessage request, System.Threading.CancellationToken cancellationToken) <0x104e298d0 + 0x0091f> in <e7de71939f4649d9bdfb2e2411afa951#ca5a74421adead0e302c060b720be5bb>:0
at System.Net.Http.HttpClient.SendAsyncWorker (System.Net.Http.HttpRequestMessage request, System.Net.Http.HttpCompletionOption completionOption, System.Threading.CancellationToken cancellationToken) <0x104de7dd0 + 0x00423> in <51ea6b8d5ff1420888885e4cb6c720e9#ca5a74421adead0e302c060b720be5bb>:0
at SurveyApp.Service.RestClient.PostAsync[T,TP] (System.String url, TP t, System.Nullable1[T] token) <0x105c15460 + 0x00984> in <b617b7a5ed5c409182b773f98768e9a9#ca5a74421adead0e302c060b720be5bb>:0 at SurveyApp.Service.SyncService.Push (System.Collections.Generic.IList1[T] synchronizations) <0x105c1d7a0 + 0x001e7> in <b617b7a5ed5c409182b773f98768e9a9#ca5a74421adead0e302c060b720be5bb>:0
at SurveyApp.Service.SyncService.PushSurveys () <0x105c1d1b0 + 0x0028b> in <b617b7a5ed5c409182b773f98768e9a9#ca5a74421adead0e302c060b720be5bb>:0
Foundation.NSErrorException Error Domain=NSURLErrorDomain Code=-1005 ""The network connection was lost."" Use

Here is code that I'm handling for calling API (use httpClient):
public async Task PostAsync<T, TP>(string url, TP t, CancellationToken? token = null)
{
try
{
ServicePointManager.ServerCertificateValidationCallback += (sender, cert, chain, sslPolicyErrors) => true;
ServicePointManager.SecurityProtocol |= SecurityProtocolType.Tls | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12;

                        var content = JsonConvert.SerializeObject(t);
                        HttpContent httpContent = new StringContent(content);
                        httpContent.Headers.ContentType = new MediaTypeHeaderValue("application/json");

                        using (var httpClient = new HttpClient { Timeout = TimeSpan.FromMinutes(5), DefaultRequestHeaders = { ConnectionClose = true } })
                        {
                            HttpResponseMessage responseMessage;

                            if (token != null)
                            {
                                responseMessage = await httpClient.PostAsync(url, httpContent, token.Value);
                            }
                            else
                            {
                                var cancellationTokenSource = new CancellationTokenSource(TimeSpan.FromMinutes(5));
                                responseMessage = await httpClient.PostAsync(url, httpContent, cancellationTokenSource.Token);
                            }

                            if (responseMessage.IsSuccessStatusCode == false)
                            {
                                throw new Exception("Request has problem");
                            }

                            var responseContent = await responseMessage.Content.ReadAsStringAsync();
                            return JsonConvert.DeserializeObject<T>(responseContent, DefaultSerializerSettings);
                        }
                    }
                    catch (TaskCanceledException)
                    {
                        await Task.Delay(5000);
                        return await PostAsync<T, TP>(url, t, token);
                    }
                    catch (Exception e)
                    {
                        _logger.Error(e);
                        throw;
                    }
                }

        public async Task<T> PostSurveyPhotoWithDataAsync<T>(string url, string file, SurveyPhoto surveyPhoto)
                {
                    try
                    {
                        ServicePointManager.ServerCertificateValidationCallback += (sender, cert, chain, sslPolicyErrors) => true;
                        ServicePointManager.SecurityProtocol |= SecurityProtocolType.Tls | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12;

                        using (var formData = new MultipartFormDataContent())
                        {
                            using (var httpClient = new HttpClient { Timeout = TimeSpan.FromMinutes(10), DefaultRequestHeaders = { ConnectionClose = true } })
                            {
                                using (var streamReader = new StreamReader(file))
                                {
                                    formData.Add(new StreamContent(streamReader.BaseStream), "File", file);
                                    formData.Add(new StringContent(surveyPhoto.KeyId), "KeyId");
                                    formData.Add(new StringContent(surveyPhoto.FileName), "FileName");
                                    formData.Add(new StringContent(surveyPhoto.SurveySyncId), "SurveyId");

                                    var cancellationTokenSource = new CancellationTokenSource(TimeSpan.FromMinutes(5));
                                    var responseMessage = await httpClient.PostAsync(url, formData, cancellationTokenSource.Token);

                                    streamReader.Close();

                                    if (responseMessage.IsSuccessStatusCode == false)
                                    {
                                        throw new Exception("Request has problem");
                                    }

                                    var responseContent = await responseMessage.Content.ReadAsStringAsync();
                                    return JsonConvert.DeserializeObject<T>(responseContent, DefaultSerializerSettings);
                                }
                            }
                        }
                    }
                    catch (TaskCanceledException)
                    {
                        await Task.Delay(5000);
                        return await PostSurveyPhotoWithDataAsync<T>(url, file, surveyPhoto);
                    }
                    catch (Exception e)
                    {
                        _logger.Error(e);
                        throw;
                    }
                }

Therefore, Are there any solution, document or sample code help me solved this issue?

Thanks for take a look at this question. Hope everyone can help me.

How to create a foreground service for Android below Oreo 8.0?

$
0
0

I have created a foreground service using the following code which is in the override method OnStartCommand inside a service class called DemoIntentService.cs.
`base.OnStartCommand(intent,flags,startId);
if (Build.VERSION.SdkInt >= BuildVersionCodes.O)
{
Intent notificationIntent = new Intent(this, Java.Lang.Class.FromType(typeof(DemoIntentService)));
PendingIntent pendingIntent = PendingIntent.GetActivity(this, 0, notificationIntent, 0);

            Notification.Builder notificationBuilder = new Notification.Builder(this, "Example_Service_Channel")
            .SetSmallIcon(Resource.Drawable.AlertLightFrame)
            .SetContentTitle(Resources.GetString(Resource.String.DialogAlertTitle))
            .SetContentText(Resources.GetString(Resource.String.SelectTextMode))
            .SetContentIntent(pendingIntent);

            Notification notificationAfterBuild = notificationBuilder.Build();

            StartForeground(123, notificationAfterBuild);

            InitializeAlarmManager();
            setAlarm();
 }

return StartCommandResult.RedeliverIntent;

Obviously, the code above is only for Android Oreo 8.0 and above, the service works fine and the notification will not be cleared even though I close the app manually. (That's good, that's what I want !). However, when I use the above code to test on Android Nougat 7.1.1, it would not work.

Firstly, I have researched online they said there is no need to create a notification channel for Android below 8.0, so I remove the "Example_Service_Channel" which is the channelID. The app was deployed successfully, but the notification gone when I kill the app. Second thing, when I removed the channelID, Xamarin throw me a warning said "Notification.Builder.Builder(Context) is obsolete : deprecated" and the line has turn yellow. I ignore the error and deploy the app. The service did run as it is visible in the running service inside the developer options. But when I killed the app, the service and notification gone together. Is there any other way to create a foreground notification service that will never end for Android below 8.0? Thanks for any comment and idea.

Schedule local notification

$
0
0

Hi,

I have a question about local notification in Xamarin.
I need to be able schedule more than one local notification in different hours.

What I mean ...

day 1
notification 1 - h 10 am - remember appointment 1
notification 2 - h 02 pm - remember appointment 2
notification 3 - h 08 pm - remember appointment 3

day 2
notification 1 - h 08 am - remember appointment 1
notification 2 - h 11 am - remember appointment 2
notification 3 - h 03 pm - remember appointment 3

I read this article nnish.com/2014/12/16/scheduled-notifications-in-android-using-alarm-manager/ but the implementation with SetInexactRepeating doesn't work in my case because the manager rememeber only one notification (example appointment 1) and not anything else.

Does Xamarin allow to create this scenario? And if yes, can anyone help me?


How to share an url to my app?

$
0
0

I want to share an url, the url of page where I am, to my Xamarin Forms App (Android and iOS).

And when I',m going to share this url...

I want that my app appears into the share options list, to send this url to my app to a specific page, beacause I want to use this url strings into the app.

Android Emulator does not launch from Debug

$
0
0

I just tried to run the VS 2019 Xamarin tutorial. When I run the Debug the Android Device Manager launches but then closes. In the output menu there is a message: The debug was canceled. Please create an android emulator to debug the application.

Braintree Integration Xamarin forms

$
0
0

Hello I'm new in xamarin form and learning xamarin forms. Please guide me if there is any easy way to integrate braintree in xamarin form. i am following this project (...github.com/Dakicksoft/braintree-xamarin-forms-sample) settled keys like public/pvt key which i got from sandbox account but i got stuck when i start and click add payment method it gave me errors in xamarin.android

after crossing below row i got error!

this is the error

Thanks!

How to display custom layout multiple times in Xamarin Forms

$
0
0

I have a Custom Rating bar layout in Xamarin, I want to display it multiple times in my form but it is displaying only once even though i have declared it multiple times but is showing only one time & last layout.

<?xml version="1.0" encoding="UTF-8"?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             Title="Reviews"
             xmlns:customcontrol="clr-namespace:MyApp.NestedLayouts"
             x:Class="MyApp.Pages.Reviews">
    <ContentPage.Content>
        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="110"/>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="100"/>
                <RowDefinition Height="Auto"/>
            </Grid.RowDefinitions>
            <Label Text="4.5" FontSize="30" VerticalOptions="CenterAndExpand" HorizontalOptions="CenterAndExpand"
                   FontAttributes="Bold"/>
            <StackLayout Grid.Column="1">
                <customcontrol:RattingBar x:Name="layout1" ImageWidth="20" ImageHeight="20" RequiredStarValue="5"
                                          SelectedStarValue="5" FillStarImage="StarF.png" EmptyStarImage="star.png" />
                <Label Text="2 Reviews"/>
            </StackLayout>

            <Grid Grid.ColumnSpan="2" Grid.Row="1">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="110"/>
                    <ColumnDefinition Width="*"/>
                    <ColumnDefinition Width="40"/>
                    </Grid.ColumnDefinitions>

                <Grid.RowDefinitions>
                    <RowDefinition Height="*"/>
                    <RowDefinition Height="*"/>
                    <RowDefinition Height="*"/>
                    <RowDefinition Height="*"/>
                    <RowDefinition Height="*"/>
                </Grid.RowDefinitions>
                <!-- Row 0 -->
                <customcontrol:RattingBar ImageWidth="18" ImageHeight="18" RequiredStarValue="5" x:Name="layout2"
                                          SelectedStarValue="5" FillStarImage="StarF.png" EmptyStarImage="star.png" />
                <BoxView Grid.Column="1" HeightRequest="1" VerticalOptions="CenterAndExpand"
                         BackgroundColor="{DynamicResource gray}"/>
                <Label Grid.Column="2" Text="1" HorizontalOptions="CenterAndExpand"/>

                <!-- Row 1 -->
                <customcontrol:RattingBar ImageWidth="18" ImageHeight="18" RequiredStarValue="4" Grid.Row="1" x:Name="layout3"
                                          SelectedStarValue="4" FillStarImage="StarF.png" EmptyStarImage="star.png" />
                <BoxView Grid.Column="1" HeightRequest="1" VerticalOptions="CenterAndExpand" Grid.Row="1"
                         BackgroundColor="{DynamicResource gray}"/>
                <Label Grid.Column="2" Text="1" HorizontalOptions="CenterAndExpand" Grid.Row="1"/>

            </Grid>
        </Grid>
    </ContentPage.Content>
</ContentPage>

This is the layout Which i want to use multiple times but can't achieve (I have added my Views in backend).

<?xml version="1.0" encoding="UTF-8"?>
<ContentView xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             x:Class="MyApp.NestedLayouts.RattingBar">
        <StackLayout Orientation="Horizontal"/>
</ContentView>

Custom rendered button style not working

$
0
0

Hi,

I've created custom renderer for button and it works fine, but 'Style' attribute in XAML doesn't anymore? Is it not possible to set styles to custom controls?

Edit: actually some things like background colour works from style, but Padding attribute doesn't, any idea? Even setting Padding directly doesn't work?

WebView doesn't get resized or panned when soft keyboard is overlayed

$
0
0

I'm using Xamarin Forms 2.3.3.175, the latest version, and testing on Lollipop emulator.

When the input field in a WebView get focused, the software keyboard is scrolling up and the input field is overlayed.
The keyboard hides the focused input field as shown in the screenshots.

If I create and click a Entry rather than the WebView, it resizes the content page as expected.
I've searched a lot with this issue but none of them works with WebView case.(including setting WindowSoftInputMode = SoftInput.AdjustResize on Activity)

I can say this behavior in Xamarin.Forms is buggy because If I create a WebView in Android with Activity rather than FormsAppCompatActivity, the WebView is scrolled up OK.

My test codes are just a simple WebView in a ScrollView


eliteKit: Ready to use backend applications (User system, Chats..)

$
0
0

Hi guys,

we're currently working on precoded base applications, which might be for example an user system ready to use.
As backend we're using an open source PHP script called the eliteKit-API.

Our vision with this idea is to revolutionize basic templates which are usually without any serverside functionalities.
Developers will be able to download the app solution at our official eliteKit website and the PHP API script as well.

With a simple instruction on how to install the API on any webhosting server using a SQL database behind, it will be totally easy to use our user system application to start working out any application (like social networks for example).

What do you think about this idea? We are planning to work on a lot of basic applications using any API scripts and as well realtimed server communcation solutions, which are planned for the near future.

Heres an video to demonstrate the current state of the eliteAppUser which communicates with our API PHP backend script:

Would love to hear your opinions on that, to keep working it out! Any suggestions are also welcome.

Cheers,
Dominik :smile:


Carousal View is override Issue

$
0
0

I'm new in Xamarin's community,
I'm Trying to Implement Hotstar's like carousal using a carousel view in Xamarin forms (4.4 stable version).
My Issue is when carousal view calls in my feed section it displays the previous carousal Images and video on top of it. Please help How I solve this.
I'm Attaching a screenshot showing how it displays in my UI displays

And the same happened on Feed's carousal too. Please help how I solve this.

Why VS asks for Xcode 11.3?

$
0
0

After updating VS2019 to ver 16.4.3 today, it is warning about the need to have Xcode 11.3. I don't find it even beta of it on Apple Developer portal. Is it critically needed for proper XF compiling?

Different Title Views in Tabbed Page

$
0
0

I have tabbed page in my application and i want to show different title for the each page in the navigation.titleviews. How can achieve this?

Binding Library Error: How to make a method return an array of IDictionary ?

$
0
0

I am getting an error when I import a .aar file to integrate with a machine service.

My question is as per the title.

This the code I am trying to get:

[Register ("getSlots", "()[Ljava/util/HashMap;", "")]
        public unsafe global::System.Collections.Generic.IDictionary <string, byte[]> [] GetSlots ()
        {
            const string __id = "getSlots.()[Ljava/util/HashMap;";
            try {
                var __rm = _members.InstanceMethods.InvokeNonvirtualObjectMethod (__id, this, null);
                return (global::System.Collections.Generic.IDictionary<string, byte[]>[]) JNIEnv.GetArray (__rm.Handle, JniHandleOwnership.TransferLocalRef, typeof (global::System.Collections.Generic.IDictionary<string, byte[]>));
            } finally {
            }
        }

This is the code I am getting:

[Register ("getSlots", "()[Ljava/util/HashMap;", "")]
        public unsafe global::System.Collections.Generic.IDictionary <string, byte[]>GetSlots ()
        {
            const string __id = "getSlots.()[Ljava/util/HashMap;";
            try {
                var __rm = _members.InstanceMethods.InvokeNonvirtualObjectMethod (__id, this, null);
                return (global::System.Collections.Generic.IDictionary<string, byte[]>[]) JNIEnv.GetArray (__rm.Handle, JniHandleOwnership.TransferLocalRef, typeof (global::System.Collections.Generic.IDictionary<string, byte[]>));
            } finally {
            }
        }

I need a method that returns an array IDictionary <string, byte[]>[], but I am getting IDictionary <string, byte[]>

This is the code that is in metadata.xml

<attr path="/api/package[@name='br.com.uol.pagseguro.plugpagservice.wrapper']/class[@name='PlugPagNFCResult']/method[@name='getSlots' and count(parameter)=0]" name="managedReturn">System.Collections.Generic.IDictionary &lt;string, byte[]&gt;</attr>

But every time I write "[]", after ">", it doesn't appear to form an array!

Could you help me with this?

Issue: InstallFailedException

$
0
0

I am currently having an issue with running my Xamarin.Forms app on my mobile device whether it be emulated or my physical test device.
I am on Visual Studio 2019 and it is a new app project and I have had it running before but usually after the first run it does not work again after that if it did.
The error code is as follows:

ADB0010: Mono.AndroidTools.InstallFailedException: Failure [INSTALL_FAILED_INVALID_APK: Package couldn't be installed in /data/app/com.companyname.appname-w4jR_g7Ki-eDsfg24hSJUA==: Package /data/app/com.companyname.appname-w4jR_g7Ki-eDsfg24hSJUA==/base.apk code is missing]
   at Mono.AndroidTools.Internal.AdbOutputParsing.CheckInstallSuccess(String output, String packageName) in E:\A\_work\254\s\External\androidtools\Mono.AndroidTools\Internal\AdbOutputParsing.cs:line 341
   at Mono.AndroidTools.AndroidDevice.<>c__DisplayClass95_0.<InstallPackage>b__0(Task`1 t) in E:\A\_work\254\s\External\androidtools\Mono.AndroidTools\AndroidDevice.cs:line 753
   at System.Threading.Tasks.ContinuationTaskFromResultTask`1.InnerInvoke()
   at System.Threading.Tasks.Task.Execute()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at AndroidDeviceExtensions.<PushAndInstallPackage>d__11.MoveNext() in E:\A\_work\254\s\External\androidtools\Xamarin.AndroidTools\Devices\AndroidDeviceExtensions.cs:line 187
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at AndroidDeviceExtensions.<PushAndInstallPackage>d__11.MoveNext() in E:\A\_work\254\s\External\androidtools\Xamarin.AndroidTools\Devices\AndroidDeviceExtensions.cs:line 203
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
   at Xamarin.AndroidTools.AndroidDeploySession.<InstallPackage>d__112.MoveNext() in E:\A\_work\254\s\External\androidtools\Xamarin.AndroidTools\Sessions\AndroidDeploySession.cs:line 414
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
   at Xamarin.AndroidTools.AndroidDeploySession.<RunAsync>d__106.MoveNext() in E:\A\_work\254\s\External\androidtools\Xamarin.AndroidTools\Sessions\AndroidDeploySession.cs:line 217
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Xamarin.AndroidTools.AndroidDeploySession.<RunLoggedAsync>d__104.MoveNext() in E:\A\_work\254\s\External\androidtools\Xamarin.AndroidTools\Sessions\AndroidDeploySession.cs:line 119

I have tried many things including:
Repairing the SDK
Uninstalling Visual Studio, Android Studio, Android SDK and then re-installing them

Viewing all 77050 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>