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

how to invoke an activity from a class

$
0
0

how to invoke an activity from a class and get the result xamarin android


Xamarin.Forms.Shell: how to get the bottom TabBar height?

$
0
0

I work on a Xamarin.Forms.Shell app using the default bottom TabBar, and I need to know the TabBar height to adjust some items.

I've found a way to get the StatusBar height on both platforms there, but I didn't found a solution for the TabBar.

Is it possible? I only found requests about changing the TabBar height on Stack...

dynamic tabbar in xamarin.forms shell?

$
0
0

<ShellContent Title="title" Icon="icon.png" Route="IndexPage" ContentTemplate={DataTemplate local:IndexPage} />

can it be changed dynamiclly?

the title icon route and contentTemplate?

Validation for Entry

$
0
0

Hi Techie,
How to add the validation for Entry. Validation for Email, Password, Phone number , Etc.

Thanks in Advance,
Vasanth

How to create folder in Android 10 and above programmatically? its giving access denied exception

$
0
0

How to create folder in Android 10 and above programmatically? its giving access denied exception

Has to run App.OnStart method directly. Why?

$
0
0

Good day. I've got unexpected behaviour in my app. In solution use two projects - Android and UWP. So I try to get authorisation from server, so use async methods. Auth starts before main page loads, and I start it in App.xaml.cs. So here is the code:

public App()
        {
            InitializeComponent();
        }

protected async override void OnStart()
        {
            bool isUser = await accountManager.InitAsync();
            if (isUser) MainPage = new NavigationPage(new MainPage());
            else MainPage = new NavigationPage(new RegisterPage());
        }

In accountManager.InitAsync(); I restore user from App.Dictionary and make POST request to a server, to check user in DB.
When I start UWP project it works as I thought - I get answer from server and get needed page. But when I start in in Android device no page is loaded - though accountManager.InitAsync(); sends post request and I get answer. And when I call OnStart from App(), it works as planned:

public App()
        {
            InitializeComponent();
            OnStart();
        }

protected async override void OnStart()
        {
            bool isUser = await accountManager.InitAsync();
            if (isUser) MainPage = new NavigationPage(new MainPage());
            else MainPage = new NavigationPage(new RegisterPage());
        }

But in this case I got 2 calls to a server, not critical, but wrong, as I suppose.
So why is it so? Should I change the logic to use async methods at app start? And what I do not understand in OnStart functionality?

Title in ContentPage

$
0
0

Hi everyone,

Please someone know how I can change the structure of a page, I want the Title not to be shown, but rather, a banner image.

Thanks for the support!

DQ

Images not loading on localhost SSL...

$
0
0

Hi i am running dot net core on localhost with self-signed certificate for development. I've followed this guide
https://docs.microsoft.com/en-us/xamarin/cross-platform/deploy-test/connect-to-local-web-services

However - images do not seem to be working. I am using FFImageLoading and i'm getting SSL exceptions. Any ideas how to resolve this please??

2020-11-26 21:46:46.163829+0000 MyApp.iOS[3687:143593] Image loading failed: https://localhost:5001/Uploads/ImagePath.png
FFImageLoading.Exceptions.DownloadAggregateException: One or more errors occurred. (The SSL connection could not be established, see inner exception.) (The SSL connection could not be established, see inner exception.) (The SSL connection could not be established, see inner exception.) (The SSL connection could not be established, see inner exception.) ---> System.Net.Http.HttpRequestException: The SSL connection could not be established, see inner exception. ---> System.Security.Authentication.AuthenticationException: Authentication failed, see inner exception. ---> Mono.Security.Interface.TlsException: CertificateUnknown


Restrict keyboard dismissal while tapping outside entry on Android

$
0
0
Is there a way in xamarin for android, where we can restrict the keyboard dismissal for an entry while tapping outside the entry.
I want to keep the focus of the entry always and only unfocus while clicking some buttons

Spanish male voice for xamarin forms

$
0
0

Hello I need my xamarin forms application for android and ios to speak with a male voice in Spanish without using third party subscriptions since the customer does not want to pay for them, but is willing to pay if it is a tts (text to speech) for a single fee.

at the moment i have tried with the text to speech of jamesmontemagno but i have only managed to get the female voice, also i have looked for some payment tts but i have managed to find none.

How to read SMS in Xamarin.Forms

$
0
0

From Xamarin forms app, I wrote platform specific code to send sms. Once the SMS is being sent, I will be receiving a SMS in inbox. How to read that message and to show as a popup in the app. (for only Android)

Bottom Tab Bar

$
0
0

Hi
how to change bottom tab bar like this.
other icon is done i want center green icon how to adjust

Login with twitter using Xamarin.Auth throwing Authorization Required (401) Exception.

$
0
0

Hi All,
I am working on user login with twitter. I found some code and implemented in my Xamarin forms application and i also created consume key and other setting as well on twitter . After Running my application and hitting the Login with Twitter i am getting Exception : The Remote Server Error:401 Authorization Required. Please help me , i am struggling since last 2 days.
Here is my Code:

        OAuth1Authenticator Twitterauth = null;
        try
        {
            Twitterauth = new OAuth1Authenticator(
                       consumerKey: "XXXXXX", 
                       consumerSecret:"XXXXXXXXXX", 
                       requestTokenUrl: new Uri("https://api.twitter.com/oauth/request_token"), 
                       authorizeUrl: new Uri("https://api.twitter.com/oauth/authorize"), 
                       accessTokenUrl: new Uri("https://api.twitter.com/oauth/access_token"),
                       callbackUrl: new Uri("http://twitter.com")  
                   );
        }
        catch(Exception ex)
        {

        }

                    auth.Completed += (sender, eventArgs) =>
                    {
                        if (eventArgs.IsAuthenticated)
                        {
                            OAuthConfig.User = new UserDetails();
                        // Get and Save User Details 
                        OAuthConfig.User.Token = eventArgs.Account.Properties["oauth_token"];
                            OAuthConfig.User.TokenSecret = eventArgs.Account.Properties["oauth_token_secret"];
                            OAuthConfig.User.TwitterId = eventArgs.Account.Properties["user_id"];
                            OAuthConfig.User.ScreenName = eventArgs.Account.Properties["screen_name"];

                            OAuthConfig.SuccessfulLoginAction.Invoke();
                        }
                        else
                        {
                        // The user cancelled
                    }
                    };


                    activity.StartActivity(auth.GetUI(activity));

how to binding to an element in a list?

$
0
0

there is a list and I want to bind to one element in the list how to do it?

Request to update Xamarin.Facebook.AudienceNetwork.Android Nuget !

$
0
0

Hello dear, Please update Xamarin.Facebook.AudienceNetwork.Android nuget package to V 6.2 as the latest Audience Network SDK provided by Facebook is of V 6.2. The current nuget package listed on Nuget.org is of V 5.10.1 . Facebook continuously asking me to update the sdk as OLD sdk is affecting my Ads experience and revenue. I shall be very thankful to you if you resolve this issue as soon as possible .

Note: Also some APIs have been removed and alternatives are provided as shown in change log .
I have also tried to bind AAR file with successful results but the old api ad.setAdListener(AdListener listener) is removed completely in new sdk version and causing me issues in Xamarin.Forms project.

Link to latest sdk of facebook audience : https://developers.facebook.com/docs/audience-network/changelog-android#6_2_0


BindableProperty in composite control

$
0
0

I have a custom composite control that is a frame and label inside a grid... Everything works as expected... I have some bindable properties I need to set at runtime. RowDefinition Height, ColumnDefinition Width, and Frame.CornerRadius... I have read nearly every explanation and code snippet available, but each and every iteration throws a runtime exception. Can anyone provide some guidance with this?

Navigate one ContentView Page to another ContentView Page

$
0
0

Hi
i have one contentview page and inside one button if i click on this button then how i can redirect to another content view page.below code is not working for me.

Application.Current.MainPage.Navigation.PushAsync(new Shoes.ShoesView()());

Issues with Xamarin Forms on Android 10 making a httpclient request

$
0
0

I run this code on Andriod 9 and it's worked perfectly, but when I prove it in a phone with android 10 an exception appears "A task was canceled" and it isn't a "timeout" problem, because I increased so much but still dont work on Android 10. Why may this could happen?

Video player in Xamarin forms too slow to start buffering/playing

$
0
0

I was experimenting with some nuget package video players in Forms, and I tried

  1. the new experimental MediaElement video player
  2. the Nuget package Xam.Forms.VideoPlayer which seems to be based on the sample video player at https://docs.microsoft.com/en-us/samples/xamarin/xamarin-forms-samples/customrenderers-videoplayerdemos/
  3. Nuget package @ https://github.com/adamfisher/Xamarin.Forms.VideoPlayer that is no longer maintained.

However, they all seemed to take a long time to start buffering, and then a long time before they finally started playing.

I compared the three and the fastest to start playing seemed to be Xam.Forms.VideoPlayer (marginally faster than other two).
Finally, I timed just this one, loading a video from Amazon s3. It took about 10 seconds before the video element sized itself to the correct aspect ratio and started buffering. Then another 10 seconds before it started actually playing, for a total of 20 seconds.

By way of comparison, when I opened the s3 link directly in my Edge web browser, it took only 10 seconds to start playing.

I was wondering if others are also experiencing the same performance? Is this normal?

Thanks for reading/commenting.

By the way, this is my code:

                    <video:VideoPlayer
                        x:Name="videoPlayer"
                        AutoPlay="False"
                        BackgroundColor="White"
                        HeightRequest="300"
                        IsBuffering="{Binding IsVideoBuffering, Mode=OneWayToSource}"
                        IsVisible="{Binding IsVideoVisible}"
                        Source="{Binding VideoSource}" />

How to view a photo like in Telegram?

$
0
0

I want to view photo in my App like this
How I can do this?

Viewing all 89864 articles
Browse latest View live


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