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

PayPal Integration in Xamarin Forms

$
0
0

hello xamarin Lovers,

I have tried the sample of AlejandroRuiz/PayPal.Forms but not not installed 2.15.5 & 2.15.4 versions in xamarin forms
i followed this below link

https://github.com/AlejandroRuiz/PayPal.Forms.

so coukld you please suggest which package exactly installed in xamarin forms

and this will take my waste of time from past 10 days and i am searching xamarin forums also nobody cannot give exactly solution
can anyone know please help me to resolve the issues as soon as possible.


Issue: About application icon present in "Hello, Android: Quickstart" document

$
0
0

Hello,I'm following Hello, Android: Quickstart at developer.xamarin.com/guides/android/getting_started/hello,android/hello,android_quickstart/ to create my first android application occured an issue about application icon.

In document that say: Select Build > Android Application and select @mipmap/icon from the Application icon combo box, but in my visual studion it show is "@mipmap/Icon" in the Application icon down-list and occured an error: Error: No resource found that matches the given name (at 'icon' with value '@mipmap/Icon'). when building my project.

I'm found this article mipmap folders issue at forums.xamarin.com/discussion/49320/mipmap-folders-issue, change mipmap/Icon to mipmap/icon in AndroidManifest.xml file , build successful, but a problem is no app icon display in android emulator, in the end, i changed Icon.png to lowercase icon.png`, it can worked and display new icon in the android emulator.

It looks need to update resource image file Xamarin App Icons set to lowercase name.

Another problem is sample code Xamarin Andrid App Icons (ZIP) still use @drawable/Icon but document is said for @mipmap/icon.

I hope this can help other people.

Environments: VS 2017

Xamarin Webservice

$
0
0

Hi, Now i am working on xamarin webservice part. I want to send my username and password to server and server send back some information like userid, applicationid, username etc.

I try the like following.

            string url = "my url";
            string sContentType = "application/json";

            JObject jsonObject = new JObject();
            jsonObject.Add("username", name);
            jsonObject.Add("password", password);

            HttpClient oHttpClient = new HttpClient();
            var oTaskPostAsync = oHttpClient.PostAsync(url, new StringContent(jsonObject.ToString(), Encoding.UTF8, sContentType));

            await oTaskPostAsync.ContinueWith((oHttpResponseMessage) =>
            {
                // response of post here
                Debug.WriteLine("webserviceresponse:>" + oHttpResponseMessage);
            });

Install Newtosoft.json and Microsoft.Net.Http NuGet packages. After deploying i try to print oHttpResponseMessage, But code didn't enter inside ContinueWith. Can anyone help.

Thanks in advance.

Xamarin Forms Stream from string path

$
0
0

Hello ! I need stream, imagestream from path(string) to use in Syncfusion Pdf. Need add image to pdf file.

Enter test error when Run UITest on Device

$
0
0

Hi all

I want to run UITest on Device . I write a test method like this for login page.

_app.EnterText(n => n.Marked("Username"), "Name");
_app.WaitForElement(n => n.Marked("Username"));

_app.EnterText(n => n.Marked("Password"), "Password");
_app.WaitForElement(n => n.Marked("Password"));

_app.Tap(c => c.Button("LoginButton"));

But the text can not fill to Password Entry . All fill to Name Entry. Can not focus from Name Entry to Password Entry . How to do this ?

When I run the test on Emulator . It's OK and don't need to write WaitForElement.

Thanks

include uwp page into xamarin forms project

$
0
0

Hi, currently I'm facing a problem that might be solved very easily. But I need some advice from you.

I have a lib. that I need to implement in a XF application. This lib. (for ORC) is for UWP only. There will be some other libraries that can be used on Android and IOS.
To get this working, I have created an interface and reg. my class, that implements the interface and is placed inside the UWP project, to use this library.
It seems that I can only use it in a UWP page, not in a XF page. But to use it in my project, I find a way to call/open this page or, if its possible, to open the UWP page within a Xamarin Forms page (like a subpage or so).

Integrate Azure AD B2C into a Xamarin Android app using MSAL

$
0
0

Dear Friends,

I am looking for a sample for integrating Xamarin Android application with Azure AD B2C. There is already documentation for integrating with Xamarin Forms.
Thanks in advance,
Regards,
Achayan

Confused about paths for images when using Xam.Plugin.Media and cross-platform

$
0
0

I'm using the Media plugin v3.0.1 from James Montemagno for the first time, and I'm quite confused about how it stores and retrieves photos.
Right now I'm questioning the iOS side (I'll worry about Android later).

Here's my basic code:

        async void ShowCamera()
        {
            if (!CrossMedia.Current.IsCameraAvailable || !CrossMedia.Current.IsTakePhotoSupported)
            {
                await DisplayAlert(App.alertTitle, ":( No camera available.", "OK");
                return;
            }

            var xFile = await CrossMedia.Current.TakePhotoAsync(new Plugin.Media.Abstractions.StoreCameraMediaOptions
            {
                SaveToAlbum = true  //,
                //Directory = "Sample",
                //Name = "test.jpg"
            });

            if (xFile == null)
                return;

            Debug.WriteLine("********** NEW PHOTO image:" + xFile);
            //adds pic to grid on the page
            AddPicToGrid(xFile.Path);

            xFile.Dispose();
        }

        async void ShowPhotoPicker(object sender, EventArgs e)
        {
            if (!CrossMedia.Current.IsPickPhotoSupported)
            {
                await DisplayAlert(App.alertTitle, ":( Permission not granted to photos.", "OK");
                return;
            }
            var xFile = await CrossMedia.Current.PickPhotoAsync();
            if (xFile == null)
                return;

            Debug.WriteLine("********** PICKED image:" + xFile);
            //adds pic to grid on the page
            AddPicToGrid(xFile.Path);

            xFile.Dispose();
        }

Here are my situations and question:

1) When I call ShowPhotoPicker, and then select an image from my Library, I get a path like this:

/var/mobile/Containers/Data/Application/A1D9636A-1DEE-4E3D-9314-EAD86EA4DC7D/Documents/temp/IMG_20171010_170414.jpg
/var/mobile/Containers/Data/Application/A1D9636A-1DEE-4E3D-9314-EAD86EA4DC7D/Documents/IMG_20171010_170426.jpg

which seems to be dependent upon my app, and specifically, the instance of my app (if I rebuild, the string changes).
When this happens, I cannot reference the same photo from my library anymore because the app string has changed.

2) When I call ShowCamera, after taking a photo, a similar thing happens as in Q1.
While the image is saved into my Library as expected, I can not reference it again if I rebuild my app.

3) I do not want to change and save photos to my app local path - saving/retrieving from the Library is my desired method.

So - How can I reference a photo in my library that is not "app build based" but is instead persistent with a 'fixed' path?


What happened with Google maps on Forms?

$
0
0

It used to load properly, but now i stays on 0,0 instead of zooming on where y want and does not display the pins or polyline.
What is going on!?

How to get Layouts Width and Height

$
0
0

Hey guys, new in here, trying to get width and height of an existing layout. Googling it didn't really help. Here is the code:

LinearLayout mainLayout = (LinearLayout)FindViewById (Resource.Id.linearLayoutId);

int width = ?????????
int height = ?????????

There supposed to be a getWidth() and getHeight(), but can't figure it out.

Appreciate any suggestions.
A

How do i add a text entry,listview on map and icon in text entry?

$
0
0
Here is my code...

    ScrollView scroll = new ScrollView();
        Entry textbox1 = new Entry
        {
            Placeholder = "Search",
            TextColor = Color.Red,
        };
        Image img = new Image
        {
            Source = "icon.png"
        };
        var tapGestureRecognizer = new TapGestureRecognizer();
        tapGestureRecognizer.Tapped += (s, e) =>
        {
            ViewModel.AddressText = string.Empty;
        };
        img.GestureRecognizers.Add(tapGestureRecognizer);
        textbox1.SetBinding(Entry.TextProperty, new Binding("AddressText"));
        textbox1.TextChanged += OnTextChanged;
        ListView lstvw = new ListView()
        {
            HeightRequest = 0
        };
        lstvw.SetBinding(ListView.ItemsSourceProperty, new Binding("Addresses"));
        lstvw.ItemSelected += async (sender, selected) =>
        {
            await selectedlocation(sender, selected);
        };
        DataTemplate dt = new DataTemplate(typeof(TextCell));
        dt.SetBinding(TextCell.TextProperty, new Binding("Address"));
        lstvw.ItemTemplate = dt;
        var stack = new StackLayout { Spacing = 0};
         stack.Children.Add(img);
        stack.Children.Add(map);
        stack.Children.Add(textbox1);
        stack.Children.Add(lstvw);
        scroll.Content = stack;
        Content = scroll;

Thanks in advance...

While deploying Xamarin from IOS app Mono.Andriod depedency

$
0
0

When i deploy Xamarin from IOS app it throws error like "System.IO.FileNotFoundException: Could not load file or assembly 'Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=84e04ff9cfb79065' or one of its dependencies"

System.Net.WebException: Error: SecureChannelFailure (The authentication or decryption has failed.)

$
0
0

I'm working on a Xamarin.Forms project, on the Android platform.
It seems that I cannot estabilish a secure HttpClient connection.
I'm getting this error everytime I try to connect to an HTTPS url for downloading an image:

Error getting stream for https://randomuser.me/api/portraits/thumb/women/1.jpg: System.Net.WebException: Error: SecureChannelFailure (The authentication or decryption has failed.) ---> System.IO.IOException: The authentication or decryption has failed. ---> System.IO.IOException: The authentication or decryption has failed. ---> Mono.Security.Protocol.Tls.TlsException: The authentication or decryption has failed.
  at Mono.Security.Protocol.Tls.RecordProtocol.EndReceiveRecord (System.IAsyncResult asyncResult) [0x0003a] in /Users/builder/data/lanes/3819/96c7ba6c/source/mono/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/RecordProtocol.cs:430
  at Mono.Security.Protocol.Tls.SslClientStream.SafeEndReceiveRecord (System.IAsyncResult ar, System.Boolean ignoreEmpty) [0x00000] in /Users/builder/data/lanes/3819/96c7ba6c/source/mono/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/SslClientStream.cs:256
  at Mono.Security.Protocol.Tls.SslClientStream.NegotiateAsyncWorker (System.IAsyncResult result) [0x00071] in /Users/builder/data/lanes/3819/96c7ba6c/source/mono/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/SslClientStream.cs:418
   --- End of inner exception stack trace ---
  at Mono.Security.Protocol.Tls.SslClientStream.EndNegotiateHandshake (System.IAsyncResult result) [0x00035] in /Users/builder/data/lanes/3819/96c7ba6c/source/mono/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/SslClientStream.cs:396
  at Mono.Security.Protocol.Tls.SslStreamBase.AsyncHandshakeCallback (System.IAsyncResult asyncResult) [0x0000c] in /Users/builder/data/lanes/3819/96c7ba6c/source/mono/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/SslStreamBase.cs:101
   --- End of inner exception stack trace ---
  at Mono.Security.Protocol.Tls.SslStreamBase.EndRead (System.IAsyncResult asyncResult) [0x00051] in /Users/builder/data/lanes/3819/96c7ba6c/source/mono/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/SslStreamBase.cs:883
  at Mono.Net.Security.Private.LegacySslStream.EndAuthenticateAsClient (System.IAsyncResult asyncResult) [0x00011] in /Users/builder/data/lanes/3819/96c7ba6c/source/mono/mcs/class/System/Mono.Net.Security/LegacySslStream.cs:475
  at Mono.Net.Security.Private.LegacySslStream.AuthenticateAsClient (System.String targetHost, System.Security.Cryptography.X509Certificates.X509CertificateCollection clientCertificates, System.Security.Authentication.SslProtocols enabledSslProtocols, System.Boolean checkCertificateRevocation) [0x00000] in /Users/builder/data/lanes/3819/96c7ba6c/source/mono/mcs/class/System/Mono.Net.Security/LegacySslStream.cs:445
  at Mono.Net.Security.MonoTlsStream.CreateStream (System.Byte[] buffer) [0x0001e] in /Users/builder/data/lanes/3819/96c7ba6c/source/mono/mcs/class/System/Mono.Net.Security/MonoTlsStream.cs:99
   --- End of inner exception stack trace ---
  at System.Net.HttpWebRequest.EndGetResponse (System.IAsyncResult asyncResult) [0x0005e] in /Users/builder/data/lanes/3819/96c7ba6c/source/mono/mcs/class/System/System.Net/HttpWebRequest.cs:1023
  /Users/builder/data/lanes/3819/96c7ba6c/source/mono/mcs/class/System.Net.Http/System.Net.Http/HttpClientHandler.cs:379
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in /Users/builder/data/lanes/3819/96c7ba6c/source/mono/mcs/class/referencesource/mscorlib/system/runtime/exceptionservices/exceptionservicescommon.cs:143
  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x00047] in /Users/builder/data/lanes/3819/96c7ba6c/source/mono/mcs/class/System.Net.Http/System.Net.Http/HttpClient.cs:276
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in /Users/builder/data/lanes/3819/96c7ba6c/source/mono/mcs/class/referencesource/mscorlib/system/runtime/exceptionservices/exceptionservicescommon.cs:143
  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x00047] in C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android\Forms.cs:358
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in /Users/builder/data/lanes/3819/96c7ba6c/source/mono/mcs/class/referencesource/mscorlib/system/runtime/exceptionservices/exceptionservicescommon.cs:143
  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x00047] in C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Core\UriImageSource.cs:166
Image Loading: Error getting stream for https://randomuser.me/api/portraits/thumb/men/19.jpg: System.Net.WebException: Error: SecureChannelFailure (The authentication or decryption has failed.) ---> System.IO.IOException: The authentication or decryption has failed. ---> System.IO.IOException: The authentication or decryption has failed. ---> Mono.Security.Protocol.Tls.TlsException: The authentication or decryption has failed.
  at Mono.Security.Protocol.Tls.RecordProtocol.EndReceiveRecord (System.IAsyncResult asyncResult) [0x0003a] in /Users/builder/data/lanes/3819/96c7ba6c/source/mono/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/RecordProtocol.cs:430
  at Mono.Security.Protocol.Tls.SslClientStream.SafeEndReceiveRecord (System.IAsyncResult ar, System.Boolean ignoreEmpty) [0x00000] in /Users/builder/data/lanes/3819/96c7ba6c/source/mono/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/SslClientStream.cs:256
  at Mono.Security.Protocol.Tls.SslClientStream.NegotiateAsyncWorker (System.IAsyncResult result) [0x00071] in /Users/builder/data/lanes/3819/96c7ba6c/source/mono/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/SslClientStream.cs:418
   --- End of inner exception stack trace ---
  at Mono.Security.Protocol.Tls.SslClientStream.EndNegotiateHandshake (System.IAsyncResult result) [0x00035] in /Users/builder/data/lanes/3819/96c7ba6c/source/mono/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/SslClientStream.cs:396
  at Mono.Security.Protocol.Tls.SslStreamBase.AsyncHandshakeCallback (System.IAsyncResult asyncResult) [0x0000c] in /Users/builder/data/lanes/3819/96c7ba6c/source/mono/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/SslStreamBase.cs:101
   --- End of inner exception stack trace ---
  at Mono.Security.Protocol.Tls.SslStreamBase.EndRead (System.IAsyncResult asyncResult) [0x00051] in /Users/builder/data/lanes/3819/96c7ba6c/source/mono/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/SslStreamBase.cs:883
  at Mono.Net.Security.Private.LegacySslStream.EndAuthenticateAsClient (System.IAsyncResult asyncResult) [0x00011] in /Users/builder/data/lanes/3819/96c7ba6c/source/mono/mcs/class/System/Mono.Net.Security/LegacySslStream.cs:475
  at Mono.Net.Security.Private.LegacySslStream.AuthenticateAsClient (System.String targetHost, System.Security.Cryptography.X509Certificates.X509CertificateCollection clientCertificates, System.Security.Authentication.SslProtocols enabledSslProtocols, System.Boolean checkCertificateRevocation) [0x00000] in /Users/builder/data/lanes/3819/96c7ba6c/source/mono/mcs/class/System/Mono.Net.Security/LegacySslStream.cs:445
  at Mono.Net.Security.MonoTlsStream.CreateStream (System.Byte[] buffer) [0x0001e] in /Users/builder/data/lanes/3819/96c7ba6c/source/mono/mcs/class/System/Mono.Net.Security/MonoTlsStream.cs:99
   --- End of inner exception stack trace ---
  at System.Net.HttpWebRequest.EndGetResponse (System.IAsyncResult asyncResult) [0x0005e] in /Users/builder/data/lanes/3819/96c7ba6c/source/mono/mcs/class/System/System.Net/HttpWebRequest.cs:1023
  at System.Threading.Tasks.TaskFactory`1[TResult].FromAsyncCoreLogic (System.IAsyncResult iar, System.Func`2[T,TResult] endFunction, System.Action`1[T] endAction, System.Threading.Tasks.Task`1[TResult] promise, System.Boolean requiresSynchronization) [0x00014] in /Users/builder/data/lanes/3819/96c7ba6c/source/mono/mcs/class/referencesource/mscorlib/system/threading/Tasks/FutureFactory.cs:550
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in /Users/builder/data/lanes/3819/96c7ba6c/source/mono/mcs/class/referencesource/mscorlib/system/runtime/exceptionservices/exceptionservicescommon.cs:143
  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x00047] in /Users/builder/data/lanes/3819/96c7ba6c/source/mono/mcs/class/System.Net.Http/System.Net.Http/HttpClientHandler.cs:379
 [0x0002e] in /Users/builder/data/lanes/3819/96c7ba6c/source/mono/mcs/class/System.Net.Http/System.Net.Http/HttpClient.cs:276
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in /Users/builder/data/lanes/3819/96c7ba6c/source/mono/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:535
  at Xamarin.Forms.UriImageSource+<GetStreamAsyncUnchecked>d__22.MoveNext () [0x00224] in C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Core\UriImageSource.cs:166

I searched around, but it seems that this is a bug related to the Mono HttpClient SSL/TLS 1.2 implementation.
Is there a workaround?
I installed the modernhttpsclient package, as someone suggested in another thread, but it doesn't solve anything.

How do i check if user is logged in and user has active internet connection?(PCL project)

$
0
0

After successful login, i just saved email in App.Current.Properties.Add("UEMAIL", uemail.Text);
App.Current.SavePropertiesAsync();

what is the better way to check every time is user logged in and user has active internet connection?

Thanks in advance.

Need Xamarin Developer with .NET and Couchbase Experience - Louisville, KY - USA

$
0
0

Hello Developers,

We are looking for a .NET Developer with Xamarin Development and Couchbase Experience for a Position in Louisville, KY

Thanks
Gowtham
spampana@evoketechnologies.com


liferay with Xamarin for Notifications on iOS and Android.

$
0
0

Hi

Does any one have integrated liferay with Xamarin for Notifications on iOS and Android.

Thanks
gsalunkhe

support right to left direction in xamarin forms- grid

$
0
0

Hello,
Do we have any support for right to left direction ( ex., in case Hebrew ) in Grid.
For example, if I have grid columns 0, 1, 2, do we have builtin functionality to locate them from right to left on android with Hebrew and from left to right on android with English ?
I use Visual Studio 2017
Thanks

Value cannot be null. Parameter name: filename when I set MasterDetails Page In Xamarin Forms

$
0
0

Hi,
I am set masterdetails page in xamarin forms but after execution its provide me exception that Value cannot be null.
Parameter name: filename.
Please tell me what i am miss in code ?

Generic Gesture Recognizers

$
0
0

In Xamarin Forms it's possible to create custom gesture recognizers:
https://xamarinhelp.com/custom-gestures-in-xamarin-forms/

But, it seems that a recognizer can only be applied to single control at a time via a custom renderer. We want to be able to create a context menu gesture recognizer that works with a long touch on phone, but a right click on desktop. It's totally pointless if we have to write a renderer for each control we want to apply this to.

I just want to make sure that I'm not missing something here. Is it seriously the case that we cannot create a gesture recognizer that sits across multiple controls? This is seriously limiting.

Custom renderers can be useful, but the design of Xamarin Forms makes them useless in many cases because you can only apply one per control, per app, and that renderer can only be applied to one control - it doesn't cascade up to higher level controls.

MongoDB

$
0
0

How to Connect Mongodb using REST API web service in Xamarin?
Any reference would be better to understand for me...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>