Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all 204402 articles
Browse latest View live

NSFilePromiseProvider any sample?

$
0
0

It is interesting that NSFilePromiseProvider is being highlited and featured in several documents like: https://docs.microsoft.com/en-us/xamarin/mac/platform/introduction-to-macos-sierra/modern-cocoa-apps, while it seems not to be fully implemented and possibly not even useful in the current implementation, as at least this API is not implemented and it seems to be critical: https://developer.apple.com/documentation/appkit/nsfilepromiseproviderdelegate/1644244-filepromiseprovider?language=objc

Anyway any sample code for Xamarin (truth to be code not much samples for objective C/swift either)? Especially samples with NSTableView would be appreciated.


How can I pass a ViewCell into custom control?

$
0
0

I'm making a custom control and how can I pass other View into it?

In my case I want to pass in a custom ViewCell to my custom ListView so I could re-use this custom control with different item sources and their proper ViewCells:

<ContentView xmlns="http://xamarin.com/schemas/2014/forms" 
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             x:Class="Foobar.Base.Views.LazyListView">
    <ContentView.Content>
        <StackLayout>
            <Label Text ="Custom ListView"></Label>
            <CustomListView ItemsSource="{Binding Items}">
                <CustomListView .ItemTemplate>
                   ** <!--Render a custom ViewCell that was passed in to the custom control-->**
                </CustomListView.ItemTemplate>
            </CustomListView >
        </StackLayout>
    </ContentView.Content>
</ContentView>

Should I use something like x:Arguments for it?

Timer lags in Xamarin android

$
0
0

We were developing a cross-platform app for iOS and Android which uses a timer (so we are using the Device.StartTimer Thread).
While testing our app against the google stopwatch, the iOS version of the app lines up perfectly (in a timespan of 150000 milliseconds), but the Android app falls 10000 milliseconds behind by the end of the 150000 milliseconds.
I have tried disabling the Mono Runtime, but the app still shows this behavior.
I would appreciate any help on this!

XenMobile VPN tunnel compatibility

$
0
0

I'm trying to deploy a Xamarin IOS App througth XenMobile.

The app is wrapped successfully using the MDX toolkit and I can install it thought SecureHub.

The unique problem we have is that I can´t route the network traffic using the vpn tunnel provided by the XenMobile platform. Is there any limitation on that?

Thanks,

How to do a Custom tapped page for XamarinForms platform WPF?

$
0
0
I am developing wpf application using XamarinForms, which is having tab bar. I want to customize the tapped page to support wpf application. If anyone having a solution please let me know. Thanks in advance.

[XAMARIN FORMS] problem of the link between my xaml view (with a picker) and the viewmodel

$
0
0

Hello everyone,

I have a small problem, I explain myself:

here's what I did, I have a page with buttons (with different values) and a picker (see xaml code), when the user clicks on a button, normally the picker selection list proposes things that are linked to the value of my button through lists (see my view model code). Except it doesn't work!

In my opinion it is because of the static type that is on some of my lists and methods. So my picker which has a binding on one of my lists does not display my selection because it cannot access my list because it is in static and not a constructor (in which I call the element of my binding).

Do you have a solution for me?

If you can't understand me, don't hesitate to ask me questions?

you will find the different files with my code below.

Sincerely
Camille

xaml code :

<?xml version="1.0" encoding="utf-8" ?>
<ContentPage
    x:Class="PolQual.Views.StatementReferencielPage"
    xmlns="http://xamarin.com/schemas/2014/forms"
    xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
    xmlns:local="clr-namespace:PolQual.Views"
    xmlns:viewModels="clr-namespace:PolQual.ViewModels;assembly=PolQual"
    Title="Accueil">

    <ContentPage.BindingContext>
        <viewModels:StatementReferencielPageModel />
    </ContentPage.BindingContext>

    <ContentPage.Content>

        <StackLayout>

            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="10*" />
                    <RowDefinition Height="15*" />
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="100*" />
                </Grid.ColumnDefinitions>

                <Label
                    Grid.Row="0"
                    Grid.Column="0"
                    FontSize="25"
                    HorizontalOptions="Center"
                    Text="Information sur le relevé référenciel" />

            </Grid>

            <ScrollView>
                <Grid x:Name="gridLayout" />
            </ScrollView>

            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="2*" />
                    <RowDefinition Height="3*" />
                    <RowDefinition Height="8*" />
                    <RowDefinition Height="2*" />
                    <RowDefinition Height="3*" />
                    <RowDefinition Height="6*" />
                    <RowDefinition Height="3*" />
                    <RowDefinition Height="6*" />
                    <RowDefinition Height="3*" />
                    <RowDefinition Height="6*" />
                    <RowDefinition Height="5*" />
                    <RowDefinition Height="6*" />
                    <RowDefinition Height="1*" />
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="25*" />
                    <ColumnDefinition Width="50*" />
                    <ColumnDefinition Width="25*" />
                </Grid.ColumnDefinitions>

                <Label
                    Grid.Row="1"
                    Grid.Column="1"
                    FontSize="15"
                    Text="Veuillez sélectioner le secteur :" />

                <Picker
                    x:Name="PickerSectorsLists"
                    Title="Sélectionner votre secteur"
                    Grid.Row="2"
                    Grid.Column="1"
                    ItemDisplayBinding="{Binding Value}"
                    ItemsSource="{Binding SectorsFindLists}"
                    SelectedItem="{Binding SelectedSector}" />

                <Label
                    Grid.Row="4"
                    Grid.Column="1"
                    FontSize="15"
                    Text="{Binding ShowHouseholdTrash}" />

                <Switch
                    x:Name="SwitchHousehodTrash"
                    Grid.Row="5"
                    Grid.Column="1"
                    HorizontalOptions="Start"
                    IsToggled="{Binding HouseholdTrash}" />

                <Label
                    Grid.Row="6"
                    Grid.Column="1"
                    FontSize="15"
                    Text="{Binding ShowBoxboard}" />

                <Switch
                    x:Name="SwitchBoxboard"
                    Grid.Row="7"
                    Grid.Column="1"
                    HorizontalOptions="Start"
                    IsToggled="{Binding Boxboard}" />

                <Label
                    Grid.Row="8"
                    Grid.Column="1"
                    FontSize="15"
                    Text="{Binding ShowGlass}" />

                <Switch
                    x:Name="SwitchGlass"
                    Grid.Row="9"
                    Grid.Column="1"
                    HorizontalOptions="Start"
                    IsToggled="{Binding Glass}" />

                <Button
                    Grid.Row="11"
                    Grid.Column="1"
                    BackgroundColor="#2196f3"
                    Clicked="GoToAssesmentGrid"
                    FontSize="20"
                    Text="Valider les informations"
                    TextColor="White" />

            </Grid>

        </StackLayout>

    </ContentPage.Content>
</ContentPage>

Behind code :

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using Xamarin.Forms;
using Xamarin.Forms.Xaml;
using PolQual.ViewModels;

namespace PolQual.Views
{
    [XamlCompilation(XamlCompilationOptions.Compile)]
    public partial class StatementReferencielPage : ContentPage
    {
        public StatementReferencielPage()
        {
            InitializeComponent ();
            BindingContext = new StatementReferencielPageModel();
            gridLayout.RowDefinitions.Add(new RowDefinition { Height = new GridLength(40) });
            gridLayout.RowDefinitions.Add(new RowDefinition { Height = new GridLength(40) });
            gridLayout.RowDefinitions.Add(new RowDefinition { Height = new GridLength(40) });
            gridLayout.RowDefinitions.Add(new RowDefinition { Height = new GridLength(40) });
            gridLayout.RowDefinitions.Add(new RowDefinition { Height = new GridLength(40) });
            gridLayout.RowDefinitions.Add(new RowDefinition { Height = new GridLength(40) });
            gridLayout.RowDefinitions.Add(new RowDefinition { Height = new GridLength(40) });
            //collmun
            gridLayout.ColumnDefinitions.Add(new ColumnDefinition { Width = new GridLength(25, GridUnitType.Star) });
            gridLayout.ColumnDefinitions.Add(new ColumnDefinition { Width = new GridLength(50, GridUnitType.Star) });
            gridLayout.ColumnDefinitions.Add(new ColumnDefinition { Width = new GridLength(25, GridUnitType.Star) });

            var PolesListsIndex = 0;

            for (int columnIndex = 1; columnIndex < 2; columnIndex++)
            {
                for (int rowIndex = 0; rowIndex < 7; rowIndex++)
                {
                    if (PolesListsIndex >= StatementReferencielPageModel.PolesLists.Count<Pole>())
                    {
                        return;
                    }
                    var poles = StatementReferencielPageModel.PolesLists[PolesListsIndex];
                    PolesListsIndex += 1;

                    var button = new Button()
                    {                   
                        Text = poles.Name,
                        BackgroundColor = Color.FromHex(poles.Color),
                        HorizontalOptions = LayoutOptions.Center,
                        VerticalOptions = LayoutOptions.Center,
                        WidthRequest = 280,
                    };
                    string request = StatementReferencielPageModel.PolesLists[rowIndex].Name;
                    button.Clicked += delegate { MaFunction(request); };// anonymous method
                    gridLayout.Children.Add(button, columnIndex, rowIndex);  

                }
            }
        }

        public static void MaFunction(string polename)
        {
           StatementReferencielPageModel.FindPoleName(polename);
        }

        public void GoToAssesmentGrid(object sender, System.EventArgs e)
        {
            if (PickerSectorsLists.SelectedIndex == -1) 
            {
                DisplayAlert("Erreur de saisie", "Veuillez séléctioner un secteur svp! ", "D'accord");
            }
            else
            {
                var page = new AssesmentGridPage();
                Navigation.PushAsync(page);
            }
         }
    }
}

view Model code :

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using Xamarin.Forms;
using PolQual.Views;

namespace PolQual.ViewModels
{
    public class StatementReferencielPageModel : INotifyPropertyChanged
    {
        private static List<Sector> _sectorsLists;
        public static List<Sector> SectorsLists { get => _sectorsLists; set => _sectorsLists = value; }

        private readonly List<Sector> sectorsFindLists;
        private static List<Sector> _sectorsFindLists;
        public static List<Sector> SectorsFindLists { get => _sectorsFindLists; set => _sectorsFindLists = value; }

        private static List<Pole> _polesLists;
        public static List<Pole> PolesLists { get => _polesLists; set => _polesLists = value; }

        public event PropertyChangedEventHandler PropertyChanged;

        public void OnPropertyChanged([CallerMemberName] string propertyname = null)
        {
            PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyname));
        }

        private bool _boxboard { get; set; }
        public bool Boxboard
        {
            get { return _boxboard; }
            set
            {
                _boxboard = value;
                OnPropertyChanged();
                OnPropertyChanged(nameof(ShowBoxboard));
            }
        }

        private bool _glass { get; set; }
        public bool Glass
        {
            get { return _glass; }
            set
            {
                _glass = value;
                OnPropertyChanged();
                OnPropertyChanged(nameof(ShowGlass));
            }
        }

        private bool _householdTrash { get; set; }
        public bool HouseholdTrash
        {
            get { return _householdTrash; }
            set
            {
                _householdTrash = value;
                OnPropertyChanged();
                OnPropertyChanged(nameof(ShowHouseholdTrash));
            }
        }

        private Sector _selectedSector { get; set; }
        public Sector SelectedSector
        {
            get { return _selectedSector; }
            set
            {
                if (_selectedSector != value)
                {
                    _selectedSector = value;
                    // que faire quand l'élèment est sélectionné !
                }
            }
        }

        public StatementReferencielPageModel()
        {
            SectorsLists = GetSectors().OrderBy(t => t.Key).ToList();
            SectorsFindLists = GetSectors().OrderBy(t => t.Key).ToList();
            PolesLists = GetPoles().OrderBy(t => t.Key).ToList();
        }

        public List<Sector> GetSectors()
        {
            var Sectors = new List<Sector>()
            {
                //Erdre et cens
                new Sector() { Key = 0, Value = "Sautron", PoleName="Erdre et cens" },
                new Sector() { Key = 1, Value = "Orvault", PoleName="Erdre et cens" },
                new Sector() { Key = 2, Value = "Nantes Nord", PoleName="Erdre et cens" },
                new Sector() { Key = 3, Value = "La-Chapelle-Sur-Erdre", PoleName="Erdre et cens" },
                // Erdre et Loire
                new Sector() { Key = 4, Value = "Mauves-Sur-Loire", PoleName="Erdre et Loire" },
                new Sector() { Key = 5, Value = "Carquefou", PoleName="Erdre et Loire" },
                new Sector() { Key = 6, Value = "Thouré sur Loire", PoleName="Erdre et Loire" },
                new Sector() { Key = 7, Value = "Sainte Luce sur Loire", PoleName="Erdre et Loire" },
                new Sector() { Key = 8, Value = "Nantes Erdre", PoleName="Erdre et Loire" },
                new Sector() { Key = 9, Value = "Doulon", PoleName="Erdre et Loire" },
                //Loire-Sèvre et Vignoble
                new Sector() { Key = 10, Value = "Rezé", PoleName="Loire-Sèvre et Vignoble" },
                new Sector() { Key = 11, Value = "Les Sornières", PoleName="Loire-Sèvre et Vignoble" },
                new Sector() { Key = 12, Value = "Vertou", PoleName="Loire-Sèvre et Vignoble" },
                new Sector() { Key = 13, Value = "Saint Sébastien sur Loire", PoleName="Loire-Sèvre et Vignoble" },
                new Sector() { Key = 14, Value = "Base Goulaine", PoleName="Loire-Sèvre et Vignoble" },
                new Sector() { Key = 15, Value = "Nantes sud", PoleName="Loire-Sèvre et Vignoble" },
                //Sud-Ouest
                new Sector() { Key = 16, Value = "Bouchenais", PoleName="Sud-Ouest" },
                new Sector() { Key = 17, Value = "Saint-Aignan-Grandlieu", PoleName="Sud-Ouest" },
                new Sector() { Key = 18, Value = "Bouaye", PoleName="Sud-Ouest" },
                new Sector() { Key = 19, Value = "Saint-Leger-Les-Vignes", PoleName="Sud-Ouest" },
                new Sector() { Key = 20, Value = "Brains", PoleName="Sud-Ouest" },
                new Sector() { Key = 21, Value = "La-Montagne", PoleName="Sud-Ouest" },
                new Sector() { Key = 22, Value = "Saint-Jean-De-Boiseau", PoleName="Sud-Ouest" },
                new Sector() { Key = 23, Value = "Le Pellerin", PoleName="Sud-Ouest" },
                //Loire-Chézine
                new Sector() { Key = 24, Value = "Couëron", PoleName="Loire-Chézine" },
                new Sector() { Key = 25, Value = "Saint-Herblain", PoleName="Loire-Chézine" },
                new Sector() { Key = 26, Value = "Indre", PoleName="Loire-Chézine" },
                //Nantes-Ouest
                new Sector() { Key = 27, Value = "Bellevue-Chantenay-Sainte-Anne", PoleName="Nantes-Ouest" },
                new Sector() { Key = 28, Value = "Dervallière-Zola", PoleName="Nantes-Ouest" },
                new Sector() { Key = 29, Value = "Breil-Barberie", PoleName="Nantes-Ouest" },
                new Sector() { Key = 30, Value = "Hauts Pavés Saint Félix", PoleName="Nantes-Ouest" },
                //Nantes-Loire
                new Sector() { Key = 31, Value = "Malakof-Saint-Donatien", PoleName="Nantes-Loire" },
                new Sector() { Key = 32, Value = "Centre Ville", PoleName="Nantes-Loire" },
                new Sector() { Key = 33, Value = "île de Nantes", PoleName="Nantes-Loire" },

            };
            return Sectors;
        }

        public List<Pole> GetPoles()
        {
            var Poles = new List<Pole>()
            {
                new Pole { Key = 1, Name = "Erdre et Cens", Color = "ffccd5"},
                new Pole { Key = 2, Name = "Erdre et Loire", Color = "ff4d4d"},
                new Pole { Key = 3, Name = "Loire-Sèvre et vignoble", Color = "ff9933"},
                new Pole { Key = 4, Name = "Sud-Ouest", Color = "bfbfbf"},
                new Pole { Key = 5, Name = "Loire-chézine", Color = "ffff4d"},
                new Pole { Key = 6, Name = "Nantes-Ouest", Color = "3385ff"},
                new Pole { Key = 7, Name = "Nantes-Loire", Color = "53c653"},
            };
            return Poles;
        }

        public static void FindPoleName(string polename)
        {
            for (int search = 0; search < SectorsLists.Count(); search++)
            {
                if (SectorsLists[search].PoleName == polename)
                {
                    SectorsFindLists.Add(new Sector() {Key = search, Value = SectorsLists[search].Value, PoleName = polename });
                }
            }
        }

        public string ShowBoxboard
        {
            get
            {
                return $"{(_boxboard ? "Jour de collecte des cartons : oui " : "Jour de collecte des cartons : non")}";
            }
        }

        public string ShowGlass
        {
            get
            {
                return $"{(_glass ? "Jour de collecte du verre : oui " : "Jour de collecte du verre : non")}";
            }
        }

        public string ShowHouseholdTrash
        {
            get
            {
                return $"{(_householdTrash ? "Jour de collecte des Ordure ménagère : oui " : "Jour de collecte des Ordure ménagère : non")}";
            }
        }
    }

    public class Sector
    {
        private int _key;
        public int Key { get => _key; set => _key = value; }

        private string _value;
        public string Value { get => _value; set => _value = value; }

        private string _poleName;
        public string PoleName { get => _poleName; set => _poleName = value; }
    }

    public class Pole
    {
        private int _key;
        public int Key { get => _key; set => _key = value; }

        private string _color;
        public string Color { get => _color; set => _color = value; }

        private string _name;
        public string Name { get => _name; set => _name = value; }
    }
}

MQTT publish with system.net.mqtt upon button_click event

$
0
0

Hi, I been working on a small peice of code in Xamarin Forms (my first project) to send a mqtt message upon a button press.
Ive written the code to publish the mqtt message to the test.mosquitto.org server within a C# console app and that seems to be working OK.

`using System;
using System.Net.Mqtt;
using System.Text;

namespace MqttTest.Client
{
class Program
{
const string topic = "test/test/button";

    static void Main (string[] args)
    {
        var config = new MqttConfiguration { Port = 1883 };
        var client = MqttClient.CreateAsync("test.mosquitto.org", config).Result;
        var clientId = "myClientID";
        string message = "test";


        client.ConnectAsync (new MqttClientCredentials (clientId)).Wait ();
        client.SubscribeAsync (topic, MqttQualityOfService.AtLeastOnce).Wait ();
        //Publishes "message" Var 
        client.PublishAsync(new MqttApplicationMessage(topic, Encoding.UTF8.GetBytes($"{message}")), MqttQualityOfService.AtLeastOnce).Wait();
    }
}

}
`

Ive now written a very simple xamarin cross platform app with 1 button, 1 button_clicked event and the code for the button clicked event which was written in the above console app.

`using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Xamarin.Forms;
using System.Net.Mqtt;

namespace App1
{
public partial class MainPage : ContentPage
{
public MainPage()
{
InitializeComponent();
}
const string topic = "test/test/button";

    private void Button_Clicked(object sender, EventArgs e)
    {
        var config = new MqttConfiguration { Port = 1883 };
        var client = MqttClient.CreateAsync("test.mosquitto.org", config).Result;
        var clientId = "clientIdhGHvpYY9uM";
        string message = "Hello";


        client.ConnectAsync(new MqttClientCredentials(clientId)).Wait();
        client.SubscribeAsync(topic, MqttQualityOfService.AtLeastOnce).Wait();
        client.PublishAsync(new MqttApplicationMessage(topic, Encoding.UTF8.GetBytes($"{message}")), MqttQualityOfService.AtLeastOnce).Wait();
    }
}

}
`

Upon testing the app in the emulator, it loads up OK but when I click the button, it freezes the app and does not publish to the test mqtt server.

Can anyone offer any advice on how to get this working

thank you

Problem with the layout

$
0
0

Hi everyone! I m a new user of xamarin on visual studio and i can't understand a thing that happens. For my first app, i follow the introduction on Microsoft website. My problem is that when i add a second (or more), for example, text i can't put them one below the previous one; they go one over the other. i tried many times but happend the same things with every tool i add. how i can sort out it? Thanks.


Is there a Label for Hyperlinks?

$
0
0

Hey there. Is there a Label that can recognize Hyperlinks like Phone numbers, E-Mails and URLs ?

I found this one but it does not work for me. I copy pasted that whole thing.

AwesomeHyperLinkLabel.cs is in my namespacename project.

AwesomeHyperLinkLabelRenderer.cs is in my namespacename.iOS project

then I created an xaml in my namespacename with xmlns:AwesomeHyperLinkLabel="clr-namespace:namespacename"

acts like a usual Label.

Did I miss a step or do I have to configure something myself?

Copy file from Resources to Library\Application Support

$
0
0

Hi there,

I have a SQLite database file that I have a default version of in my Resources directory that is set to copy to the output directory on build.

On app startup I check to see if the user already has my sqlite database file in place if not I want to copy the default file from the resource directory to the user's Library\Application Support directory which I understand is where my sandboxed application can store user data.

What I've not been able to work out programatically is where is my Resource directory path is so I can issue a copy command. I looked at NSHomeWindow() and sample code

[System.Runtime.InteropServices.DllImport("/System/Library/Frameworks/Foundation.framework/Foundation")]
    public static extern IntPtr NSHomeDirectory();

    public static string ContainerDirectory
    {
        get
        {
            return ((NSString)ObjCRuntime.Runtime.GetNSObject(NSHomeDirectory())).ToString();
        }
    }

And am assuming that I use ContainerDirectory as the string representation? However that doesn't seem to point to where my Resources folder is when the app is running.

How to use NEW Upload Key to sign app update and upload to Google Play store?

$
0
0

Hi,

Somehow I managed to save the wrong keystore for my Android app that I developed using Xamarin and already published.
When I wanted to upload an update to the Google Play Store with the keystore that I thought was the right keystore,
the SHA certificate did not match.

Luckily I was registered for Google Play App Signing so they were able to reset the Upload Key for me.
In order to reset the upload key I:

  1. (dont know if i had to do this to generate new upload key) Generated a new archive and new keystore for the Android project in Xamarin and exported the APK to a folder. In that folder i ran the command lines in the next steps:

  2. Generated a new upload key using the command line:
    keytool -genkeypair -alias upload -keyalg RSA -keysize 2048 -validity 9125 -keystore keystore.jks

  3. Exported the certificate for that key to a *.pem file:
    keytool -export -rfc -alias upload -file upload_certificate.pem -keystore keystore.jks

  4. Sent the *.pem to Google Play Developer Support.**

    Now that I have a *.pem file and *.jks file, how do I create the new APK file for my Xamarin Android project, signed with the new upload key in Visual Studio?

iPhone simulators missing from debug device list

$
0
0

I am running Visual Studio 15.9.5 on Windows 10, I have a MacBook Pro with Visual Studio for Mac and all the latest updates, with Xcode 10.1.

In Xcode Preferences/Components, you can see I have installed iOS 10.0 Simulator, 10.1,10.2,10.3.1,11.0,11.1,11.2, 11.3, 11.4, 12.0.

While paired up with the MacBook Pro, in DEBUG mode, I can see all the iPhone 5 and 6's from 10.3 to 12.1 (I am targeting 10.3).
However, in this list, there are no iPhone 7's or above. In the unsupported list, it does some some iPHone 7's, but they are older than 10.3.

Does anyone have some suggestions as to how I can fix this?

Xamarin.Forms app does not run after released to "TestFlight"

$
0
0

My Xamarin.Forms app runs fine on emulators, and I can connect an iPhone 5 to my MacBook and successfully debug and run the app on a physical phone in debug mode. However, after pushing the release to "TestFlight", the app appears to start with the splash screen, then just disappears.

In my AppDelegate.cs in "FinishedLaunching", i wire up for unhandled exceptions like this:

        AppDomain.CurrentDomain.UnhandledException += CurrentDomainOnUnhandledException;
        TaskScheduler.UnobservedTaskException += TaskSchedulerOnUnobservedTaskException;

Then, from within these handlers, I report crashes to my own backend log system, but also I have code to record the crash with App Center's "Crashes.TrackError()". I have verified this works by creating a test page that generates unhandled exceptions, and it successfully is caught with my error handlers and reported to the server.

When I run the app from TestFlight, the app crashes immediately, and no log information is sent to my log system, or to App Center. This is my nightmare scenario in support phones, crashes that I have no details about.

Can you please share any suggestions or ideas you may have, on how I can go about solving this crash problem; or how I can get diagnostics information from this crash, and future crashes.

Thanks.

ACR User Dialogs not working in Android PCL

$
0
0

I am trying to use ACR User Dialog in my PCL Project. It works like a charm in my iOS project build but when I try to build my Android Project, it gives me the below error:

Exception while loading assemblies: System.IO.FileNotFoundException: Could not load assembly 'AndHUD, Version=1.2.0.0, Culture=neutral, PublicKeyToken='. Perhaps it doesn't exist in the Mono for Android profile?
File name: 'AndHUD.dll'
at Java.Interop.Tools.Cecil.DirectoryAssemblyResolver.Resolve(AssemblyNameReference reference, ReaderParameters parameters)
at Java.Interop.Tools.Cecil.DirectoryAssemblyResolver.Resolve(AssemblyNameReference reference)
at Xamarin.Android.Tasks.ResolveAssemblies.AddAssemblyReferences(DirectoryAssemblyResolver resolver, ICollection`1 assemblies, AssemblyDefinition assembly, Boolean topLevel)
at Xamarin.Android.Tasks.ResolveAssemblies.Execute(DirectoryAssemblyResolver resolver) TimPapp.Droid

I already have AndHUD 1.2.0 package installed in NuGet. Any idea what can be the reason? Appreciate any help.

DismissViewController causes app to crash blaming 'unknown' orientation

$
0
0

Hi guys,
I spent now at least 8 hours with no success. I am creating a new controller like that:

var newVC = (MyNavigationController)Storyboard.InstantiateViewController("myNavigationController");
NavigationController.PresentViewController(newVC, true, null);

When a user clicks Cancel button on a view controller that is root view controller for MyNavigationController the following is run

NavigationController.PopViewController(true);

And then the application crashes with the following:
Foundation.MonoTouchException: Objective-C exception thrown. Name: UIApplicationInvalidInterfaceOrientation Reason: preferredInterfaceOrientationForPresentation 'unknown' must match a supported interface orientation: 'portrait, landscapeLeft, landscapeRight, portraitUpsideDown'!

What is the reason? What do I do wrong?


remove entry's top&bottom space

$
0
0

navy color is entry's backgroundcolor.
look like this image, entry's showing space is not matching entry's height.
I want entry's showing space matched height.
how can I do this?

Problem with Absolute Layout and Overlay Areas

$
0
0

Hi there!

I have a View with list view and, using absolute layout, I created an editor for that list view.

The editor, when visible, overlays itens 2 to 6.

I can tap or press itens 1 and 7 to call the editor.

If I tap itens 2 to 6, nothing happens. The editor, even invisible, block my selection.

Is there a way to fix this problem?

Thanks in advance for any kind of help.

Regards,

Ciro.

Pickers opens box twice when focused after focus an entry

$
0
0

Hi everyone!!
I have a big issue that I can't solve from myself.

like the title says, in my android app (using xamarin.forms 3.4.0.1009999 after I updated from a very old version) when I select an entry, then tap over a picker, it opens twice.
A workaround I found is to place the picker in a StackLayout.. but when the picker is in a grid this workaround doesn't work.

Searching into the web, this issue should be resolved in release 3.4.0.1 so.. any ideas?

thanks!!!

Basic Deployment and Build Questions

$
0
0
  1. I create a new project (Xamarin, Blank project). I compile it. My Android phone is plugged into the computer. I start the ADB server. Then I select Deploy and I get a deployment to the Emulator. I don't want that. I want to deploy to the phone. What gives? How do I diagnose? How do I stop deployment to the emulator?

Nuget packages for android.arch.work:work-runtime & android.arch.work:work-firebase

$
0
0

In my Android binding project, I want to use android.arch.work:work-runtime & android.arch.work:work-firebase packages. These packages are not present in the NuGet.
So I have included these as .jar files but I am getting a runtime exception as

"Didn't find class "androidx.work.R$bool" on path: DexPathList"

in the manifest file, I have added as

provider
android:name="androidx.work.impl.WorkManagerInitializer"
android:authorities="'MyApplicatonPackageName'.workmanager-init"
android:enabled="true"
android:exported="true"
Can anyone help me to resolve this issue please?
Many thanks

Viewing all 204402 articles
Browse latest View live


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