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

Get user's current location from map

$
0
0
Hi devs, I'm kinda new to xamarin and I'm having difficulties getting user's current location from map. Pls how do I go about this? I really need your contribution.

xamarin studio 5.9.5 menus grayed out

$
0
0

Please can someone tell me what is wrong here as i have just installed xamarine studio on my aptop using a windows10 64bit operating system but cant run my project as the run menu is grayed out ,please what is the way foreward ?

Opening Oauth2 page with self signed certificate causing webview to display security warning

$
0
0

Is there a way I can prevent the security warning popup from displaying. Is there a solution where I can still use my self signed certificate or do I have to use a trusted certificate?

    var authenticator = new OAuth2Authenticator(
            Constants.OAuthAuthCodeLocal.ClientId,
            "",
            Constants.OAuthAuthCodeLocal.AuthorizeUrl,
            Constants.OAuthAuthCodeLocal.RedirectUrl);
        LoadMask = true;
        authenticator.Completed += OnAuthCodeAuthenticationCompleted;
        authenticator.Error += OnAuthCodeAuthenticationError;
        AuthenticationState.Authenticator = authenticator;

        var presenter = new OAuthLoginPresenter();
        presenter.Login(authenticator);

As for the Webview to allow authentication when you log on the website ?

$
0
0

Пожалуйста, помогите решить эту проблему.
Я использую WebView для открытия веб-сайта.
Сайт использует авторизацию через AD.
При использовании Chrome открывается диалоговое окно авторизации.

При использовании приложения учетные данные не запрашиваются.

Как решить ?

Skipped XX frames! The application may be doing too much work on its main thread.

$
0
0

Hi,

when scrolling ListView (debug mode) on the Samsung device, the list sometimes skips to some elements (not always) then I get in VS output:

02-04 08:28:51.904 I/zygote64(30968): Explicit concurrent copying GC freed 4452(221KB) AllocSpace objects, 0(0B) LOS objects, 49% free, 6MB/12MB, paused 290us total 66.611ms
02-04 08:28:51.907 D/Mono    (30968): GC_NEW_BRIDGE num-objects 527 num_hash_entries 52442 sccs size 16277 init 0.00ms df1 318.51ms sort 20.11ms dfs2 23.75ms setup-cb 2.68ms free-data 91.18ms links 189251/189251/251888/16 dfs passes 326491/205528 ignored 73055
02-04 08:28:51.907 D/Mono    (30968): GC_BRIDGE: Complete, was running for 209.50ms
02-04 08:28:51.907 D/Mono    (30968): GC_MINOR: (Nursery full) time 334.37ms, stw 335.39ms promoted 543K major size: 19312K in use: 17510K los size: 4096K in use: 850K
02-04 08:28:51.917 I/Choreographer(30968): Skipped 34 frames!  The application may be doing too much work on its main thread.

data is not downloaded when scrolling the list because everything is in the Binding in the listView.

How to use customized view component from library?

$
0
0

Hi all.
I want to embed a gauge (or clock) in my application.
So After a search I found this:
github.com/Pygmalion69/Gauge
Looks good.
How can I use this component in my xamarin.android project?

Want to design a UI according to the photo that is attached.

$
0
0

Can i merge two pages such as content page and tabbed page?

Or is there any other solution please let me know.

UWP crashing after latest vs2017 update

$
0
0

After updating to the latest release of VS2017 I keep getting an error when I try to debug my UWP XF applications with an error saying "Unable to activate Windows Store app ……. The …..exe process started but the activation request failed with error 'Operation not supported. Unknown error: 0x80040904'.

I have another computer with the version prior to latest and it can build and run my projects with no issue.

Manual clean builds have not fixed the issue.

Side loading release builds do build but won't install properly.

A new vanilla uwp project builds fine.

The XF version is 3.4.0.1029999

A brand new XF project also has no issues.


Xamarin Carousel not binding to ViewModel

$
0
0

I've got a Carousel page, where I use a XAML page as the template, however, while static text works fine, binding that page to a ViewModel, doesn't show my data correctly on the page:

My Carousel XAML page:

<?xml version="1.0" encoding="utf-8" ?>

<CarouselPage.ItemTemplate>


</CarouselPage.ItemTemplate>

Code behind:

using TestProject.ViewModels.Budget;
using System;
using System.Collections.ObjectModel;
using Xamarin.Forms;
using Xamarin.Forms.Xaml;

namespace TestProject.Views.Budget
{
public partial class CustomerListPage : CarouselPage
{
public int CurrentIndex;

    public CustomerListPage()
    {
        InitializeComponent();

        ItemTemplate = new DataTemplate(typeof(CustomerListItemPage));

        ItemsSource = new ObservableCollection<ContentPage>
        {
            new CustomerListItemPage(){BindingContext = new CustomerListItemViewModel(DateTime.Now) },
            new CustomerListItemPage(){BindingContext = new CustomerListItemViewModel(DateTime.Now.AddMonths(-1)) },
            new CustomerListItemPage(){BindingContext = new CustomerListItemViewModel(DateTime.Now.AddMonths(-2)) },
            new CustomerListItemPage(){BindingContext = new CustomerListItemViewModel(DateTime.Now.AddMonths(-3)) },
        };
    }
}

}

My template page:

<?xml version="1.0" encoding="utf-8" ?>

<ContentPage.Content>

        <Label  Text="{Binding CurrentDate}" VerticalOptions="Start" HorizontalOptions="Center" BackgroundColor="Red" />
    </StackLayout>
</ContentPage.Content>

My ViewModel:

using System;

namespace TestProject.ViewModels.Budget
{
public class CustomerListItemViewModel : SyncableViewModel
{
private string currentDate { get; set; }

    public string CurrentDate
    {
        get
        {
            return currentDate;
        }

        set
        {
            currentDate = value;
            OnPropertyChanged(nameof(CurrentDate));
        }
    }

    public CustomerListItemViewModel(DateTime date)
    {
        CurrentDate = date.ToString();
    }
}

}
I thought I had everything wired up correctly, however, when I go to the carousel, the CurrentDate field is not showing up at all, even though when debugging, it is setting it correctly in the ViewModel.

After adding CSOM SharePoint Online nuget package, my app stops

$
0
0

Hi
In VS2017, after adding CSOM SharePoint Online nuget package, my app stops

In output windows i can see : Could not load assembly 'Microsoft.SharePoint.Client.Publishing.Portable' during startup registration

Can you give me some help ?

Firebase crashlytics

$
0
0

Is Xamarin form crashlytics report has been checked by an firebase console???

if yes means i want tutorial for how to check xamarin form crashlytics using firebase.

Firebase.Firestore.FieldValue does not contain a definition for ArrayUnion

$
0
0

Hello!

I'm currently working on an application in iOS and Android that uses Firebase. I'm trying to add a value to an existing array in firestore. In iOS I had no problems using 'FieldValue.FromArrayUnion(obj)'. However in Android I'm having a hard time since this method does not exist. Any ideas of how can I add a value into my array without overwriting its data?

Thank you.

CSOM SharePoint

$
0
0

Hi
In VS2017, after adding CSOM SharePoint Online nuget package, my app stops

In output windows i can see : Could not load assembly 'Microsoft.SharePoint.Client.Publishing.Portable' during startup registration

Can you give me some help ?

Xamarin forms Open map location on external app

$
0
0

Helo,
I'm using xamarin forms and by

Device.OpenUri (new Uri ($ "geo: {Latitud}, {Longitude}"));

I'm opening and external gps navigation. It works for android 9. Application waze start navigate to this position, google mpas appears that position. But on lower android it only open a map application on my current position. (Samsung galaxy s7 android 8, huawey p8 android 6).
Can you help me how to solve this?

Interop to 32-bit and 64-bit C++ libraries in same project?

$
0
0

My Xamarin project for ARM devices is built for AnyCPU mode. At runtime, depending on Android device, it seems to run in 32 or 64 bit mode. For C++ interop I then need my shared library present in 32 and 64 bit builds depending on if Xamarin decides to run my app in 32/64 bit mode.

Are there best practices WRT project configuration and building for this scenario?

One alternative is to force 32-bit mode, but as this is a photo app, more memory is better so if 64-bit mode is available then it will be gladly consumed.

I did something similar for Windows, detecting mode at runtime and invoking different interop DLLs depending on bit depth. I am however a novice with Xamarin.


Xamarin DropDown

$
0
0

I want to use a dropdown like that

for both Android and IOS. How can I?

How to set selected tab in tabbed page - xamarin forms

$
0
0

Hi Everyone,

I am new to xamarin, and i am working with tabbed page with Android and Ios.

There is a requirement to add a tab between the tabbed pages, and upon clinking it need to do some functionalities and get back to home tab.

I am able to do the functionalities and set the home tab back using the following code.

protected override void OnCurrentPageChanged()
{
base.OnCurrentPageChanged();
if (this.CurrentPage != null && this.CurrentPage.ClassId == "some id")
{
...some codes
CurrentPage = Children[0];
}
}

It is loading the home page content, but the selected tab (Highlighting) was not updated.

Can anyone help me out ?

How create renderer BackgroundImage and BackgroundColor a Layout?

$
0
0

Hi everyone, Good Work!! :)

I want use on every page this View.(this page White part Image and Silver part BackgroundColor)
But i cant find Renderer Codes. Any can share me a sample or code?
or is there a another solution?

Add Multiple Pins to Map in MVVM pattern

$
0
0

Hello,

I am having issues trying to understand how to add Pins to a map in MVVM pattern. (I can have multiple maps in the view).

Here's my ViewModel Code.

<flv:FlowListView SeparatorVisibility="Default" HasUnevenRows="True" FlowItemTappedCommand="{Binding ItemTappedCommand}" FlowLastTappedItem="{Binding LastTappedItem}" FlowColumnMinWidth="600" FlowItemsSource="{Binding DashboardWidgets}" >
    <flv:FlowListView.FlowColumnTemplate>
                <StackLayout BackgroundColor="White" Margin="1">
                    <!--Map Widgets -->
                    <StackLayout BackgroundColor="{Binding bgcolor}" HorizontalOptions="CenterAndExpand" VerticalOptions="CenterAndExpand" IsVisible="False" >
                        <StackLayout.Triggers>
                            <DataTrigger TargetType="StackLayout" Binding="{Binding resultsettype}" Value="map">
                                <Setter Property="IsVisible" Value="True"/>
                            </DataTrigger>
                        </StackLayout.Triggers>
                        <StackLayout Orientation="Vertical"  Padding="4" HeightRequest="400" WidthRequest="600">
                            <maps:Map x:Name="MyMap" IsShowingUser="true" MapType="Hybrid" />
                        </StackLayout>
                    </StackLayout>
                    <!--Image Widgets -->
                    <StackLayout BackgroundColor="{Binding bgcolor}" HorizontalOptions="CenterAndExpand" VerticalOptions="CenterAndExpand" HeightRequest="200" WidthRequest="600" Padding="4" IsVisible="False">
                        <StackLayout.Triggers>
                            <DataTrigger TargetType="StackLayout" Binding="{Binding resultsettype}" Value="image">
                                <Setter Property="IsVisible" Value="True"/>
                            </DataTrigger>
                        </StackLayout.Triggers>
                        <StackLayout Padding="1" HeightRequest="200" WidthRequest="600">
                            <Image Source="{Binding contentvalue, Converter={StaticResource LocalBase64ToImageConverter}}" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand"/>
                        </StackLayout>
                    </StackLayout>
    </flv:FlowListView.FlowColumnTemplate>

I have an Observable collection of DashboardWidgets which can hold a map, image, integer or a list.
If it's a map, I will get all the pins in VM and somehow bind them to the map. Since I am using mvvm pattern, I shouldnot access the Map in my VM and moreover I have no clue how to do it either.

So I far have tried Extending the Map to make pins bindable but to no success.

    public class ExtendedMap : Map
        {
        public static readonly BindableProperty PinsProperty = BindableProperty.Create(nameof(MultiPins), typeof(IList<Pin>), typeof(ExtendedMap), new List<Pin>());
        public List<Pin> MultiPins
            {
            get {
                                var val = (List<Pin>)GetValue(PinsProperty);
                                return new List<Pin>();
                                }
                        set => SetValue(PinsProperty, value);
                        }                
                    }      

I tried creating a contentview binding it's content to property inside vm but no luck.

XAML:
Tried both. None worked.

<contentview content={binding widgetResult } />
<contentview content={binding mapresult} />

VM:
VM implements IPropertyChanged.

var map = new Map(MapSpan.FromCenterAndRadius(new Position(37, -122), Distance.FromMiles(0.3)))
                {
                IsShowingUser = true,
                HeightRequest = 100,
                WidthRequest = 960,
                VerticalOptions = LayoutOptions.FillAndExpand
                };
        (await GetMapPins(widget.filter)).ForEach(f => map.Pins.Add(f));
        widget.widgetResult = new ContentView
                {
                    Content = map
                 };
        widget.mapresult = map;

Xamarin Forms Application.Current Properties Backup on user Google Drive account

$
0
0

I want to store my Application.Current.Properties to user's Google Drive Account as backup via Google Drive REST API v3. And Sync functionality from App to Drive and vice a versa.

I have searched and found very little info about it. But unable to take start as I am a newbie in using the user's Cloud storage.

So can anyone guide me how to achieve this? No such documentation or video tutorial found to do it from scratch. I need help.
Thanks in advance.

Viewing all 204402 articles
Browse latest View live


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