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

Infinite Timeout after second HttpWebRequest

$
0
0

Hei Guys,

we have a iOS Application which communicates via a WCF Webservice with our own Webservice. We implemented the WcfProxy with Visual Studio and all Works well. Now one of our customers has a unique problem. He uses a vpn to obtain a connection from the mobile device to our webservice. Sometimes the vpn is not correctly loaded and our app tries to open a connection to an internal webservice adress. If this happens the first request via the HttpWebRequest (used in the generated WcfProxy) will trigger after the set timeout period a timeout exception (so far, so good). Now if we call a secondary method of the WcfProxy to this (not existing) Url the HttpWebRequest will never come back and will stay forever. Only we can accompolish a connection to the vpn, then the function will correctly excuted.

This problem can be replicated by following simple function:

    //---Format for Forums-Post changed to don't look like a Url ;-)
        HttpWebRequest request = (HttpWebRequest)WebRequest.Create("https" + "://" + "sg.eurowig.local" + "/" + "abc.html"); 


        request.Timeout = 1000;
        request.ContinueTimeout = 1000; //Try
        request.ReadWriteTimeout = 1000;  //Try
        request.KeepAlive = false;  //Try
        request.ServicePoint.MaxIdleTime = 1000;  //Try
        request.Method = "HEAD"; //Try
        try
        {
            using (HttpWebResponse response = (HttpWebResponse)request.GetResponse())
            {
                //Console.Log("We reached the destination");
            }
        }
        catch (WebException exc)
        {
            //Console.Log(exc);
        }
        finally
        {
            request.Abort(); //Try
            request = null; //Try
            GC.Collect(); //Try
        }

My expirience so far:

  • Compiled on Visual Studio for Mac 7.7.3 on an iPhone 8 Plus with iOS 12.1
  • >> No timeout on second call
  • Compiled with Visual Studio for Windows 2017 on an iPhone 8 Plus with iOS 12.1
  • >> No timeout on second call
  • Tried with an not existing URL like "my.domain.that.does.not.exist"
  • >> Direct exception - Cant resolve hostname << Works
  • Different settings in the HttpWebRequest Object, as u see on the //Try comment each line...
  • >> No timeout on second call

Anyone an ideas, how to run into the timeout in the second call?

thanks in advance too you guys,
Sascha


Issue reported while submitting windows app to windows store

$
0
0

I have developed a Xamarin Forms(.Net standard) UWP app and submitted it to windows store, but the windows store team reject the app because of the following issue.

The app doesn’t install on one or more of the currently selected device families due to an unsupported minimum OS version. If the affected device family is not intended to be targeted, then please de-select the unsupported device family and resubmit the app. Otherwise, please change the minimum and/or target OS version that the app supports (https://docs.microsoft.com/en-us/windows/uwp/updates-and-versions/choose-a-uwp-version#choose-which-version-to-use-for-your-app)

My apps min and target versions are Windows 10 Fall Creators Update(10.0; Build 16299). I am targetting my app only for windows 10 desktop devices and Windows 10 mobile devices. So what is the correct min and target versions for my app?

Xamarin.Forms Sirikit Implementation.

$
0
0

I need to implement in a Xamarin.Forms Project Sirikit. I have tested sirikit in xamarin.ios only projects and works fine. Cant say the same about Xamarin Forms.

I dont know whats going on because it doesnt even get to the GetHandler function (Im debugging with console.Writeline commands to know if it reaches it). Im thinking, once xamarin.forms is initialized, it cant reach the ios siri intents.

I need help.

Is it possible to use BOTH a Notification Service Extension and Notification Content Extension?

$
0
0

For my application I am using a Notification Service Extension to modify the way the notification is displayed to the user.
I also want to display a photo in its content, for this I understand I would need to use a Notification Content Extension.

Is it possible to use both? I don't really see how that would be.

How can I add a photo in my notification and where would that photo need to reside? Can be it in the Library folder?

Pass Image from one page to another

$
0
0

Hi, I have been trying to pass the image captured through the CustomRenderer that works on the native iOS platform. I want to pass the image data from one page to another as done in Android through intent.PutExtra.
Is there any way to do it?

What do you use for mass mailing?

My question is on "Xamarin Profiler".

$
0
0

Can I use Xamarin profiler, while deploying my code on a physical device? I ideally want to do for both iOS and Android. But just started with PoC on Android. I am able to get the code deployed on physical device (android) using Xamarin LivePlayer. But when I trying starting "xamarin Profiler" it gives me an error saying " The application was not deployed, so the profiler session could not start. Please ensure that the application has been built successfully and try again".
Although when I follow the same steps to deploy on "Android Emulator", I can open the profiler session. But no success on physical device.

Listview Selected Item Background Color

$
0
0

Is it possible to set the ListView selected item background color? Right now on IOS its gray and I want it to be transparent if possible.


Xamarin.Forms CardsView nuget package

$
0
0

Hi all) I've released new package for Xamarin.Forms (Something like Tinder's CardsView)
Maybe, someone will be interested in it

nuget.org/packages/CardsView/ -- nuget
github.com/AndreiMisiukevich/CardView -- source and samples

CarouselView implementation, CardsView nuget package

Carousel View Custom Renderer Alternative?

$
0
0

Since there is not a Carousel View just yet (and Xamarin doesn't sound convinced to make one), has anyone made a custom renderer that can share some code on how to make a swipable carousel?

CarouselView with previewing side elements (Here is how)

how to pass json object as an value for one of the key in post request?

$
0
0

I have three keys personname,billingdate and nozzolereadings...I am able to work with name and date as it is simple string but nozzolereadings is asking for json object as a value..

My required json request is:
personname name
billingdate 2019-01-01
nozzolereadings [{"opening_reading":"7687","closing_reading":"7691289"},{"opening_reading":"103250","closing_reading":"103348"}]

Anyone suggest please how to send [{"opening_reading":"7687","closing_reading":"7691289"},{"opening_reading":"103250","closing_reading":"103348"}] as value to post request ?This is my code for sending request to API and getting response...

class Bill
{
public async static Task AddBillData(string name,string date)
{

          Uri uri = new Uri(urlname);

        var postData = new List<KeyValuePair<string, string>>
            {
                new KeyValuePair<string, string>("personname",name),
                new KeyValuePair<string, string>("billingdate",date),


            };

        HttpRequestMessage req = new HttpRequestMessage(HttpMethod.Post, uri);
        req.Content = new FormUrlEncodedContent(postData);

        using (HttpClient client = new HttpClient())
        {
            var response = await client.SendAsync(req);

            var content = await response.Content.ReadAsStringAsync();

            statusCheck = JsonConvert.DeserializeObject<StatusView>(content);
        }

        return statusCheck;

    }
}

Is it possible to ship an SDK using Xamarin for iOS & Android?

$
0
0

Essentially, I'd like to ship an SDK for my product. Instead of doing this in Android, iOS and Windows respectively, I'm wondering if its possible for me to use Xamarin to ship for all platforms from one "codebase". Seems like this should be possible since Xamarin is about shipping apps from one "codebase" on multiple platforms, but I haven't seen any specific documentations on this on the Microsoft Docs.

Am I over-complicating it (aka. apps == SDK) or is this a valid concern? Please share documentation and/or past experiences if relevant :smile:

get Power fail/restart exceptions during Android native debugging

$
0
0

Hi! I got many "power fail/restart" exceptions on uncertain locations during native debugging. I guess what caused it is that I access sensors data by sensor manager. I can't show my code and I remove my all C++ code won't stop this. Can you tell what cause this exactly? How can I get through this?

Thanks a lot for your helping.


get Power fail/restart exceptions during Android native debugging

$
0
0

Hi! I got many "power fail/restart" exceptions on uncertain locations during native debugging. I guess what caused it is that I access sensors data by sensor manager. I can't show my code and I remove my all C++ code won't stop this. Can you tell what cause this exactly? How can I get through this?

Thanks a lot for your helping.

how to solve getting null value in List after Deserialize JSON Object?

$
0
0

I want to get List of bills . I am getting data in response and content also. but after Deserialize the JSON object
bills = data.bill_details as List; in this line i am getting Null value.
Any suggestion please?

How to use CouchbaseLite with Xamarin forms PCL project?

$
0
0

I read documentation, it says use shared library option. How to do in PCL project, any example or demo? TIA

Archiving, .apk is missing the application icon?

$
0
0

I have a Xamarin project with custom icon for my app. Icon works correctly when deploying to device from Visual Studio, but when I create an .apk file with Archive functionality, I get the default icon instead of my icon.

Icon is defined ( "@drawable/icon" ) in manifest, project settings and MainActivity.

Are there some extra steps/configurations that I need so that correct icon is placed in the .apk?

I'm running Xamarin 4.12.3.78

Sharapie tool does not generate C# code properly.

$
0
0

Hi Folks,

I want to print receipts using EPSON TM-T88V thermal POS printer through mobile on Android and iOS platform.
For Android, I downloaded EPSON SDK from here.
For iOS, I downloaded it from here.

Epson SDK for android contains two .jar files named ePOS2.jar and ePOSEasySelect.jar and two libraries with extension .so named libepos2.so and libeposeasyselect.so which were referenced to Xamarin.Android project successfully, printing receipts on android went well.

For iOS, I refereed this walk-through on Xamarin documentation.

I used the following command to generate the c# files where my header and binary files were located:

sharpie bind --output=ePOS --namespace=ePOS --sdk=iphoneos12.0 *.h -scope ePOS

The generated files have too many syntax errors, which I don't know how to resolve at the moment. Below is the Structs.cs file with errors like "Identifier expected".

public struct
{
    [FieldOffset(0)]
    public long double __f;

    [FieldOffset(0)]
    public ulong __u;
}

Kindly help, and suggest whether I'm going in right direction.

Viewing all 204402 articles
Browse latest View live


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