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

Multiline Title in Navigation Bar

$
0
0

Hello,

Is it possible to tweek navigation tool bar to have two line title (e.g. using custom page renderer)?

I need this only for Android platform.

Regards,
Novak


How to fix "open failed: errno 13" exception

$
0
0

I am developing a camera app using CrossMedia.Plugin , when I take a photo from camera or from my phone gallery ,the app crashes and the out put window shows open failed: errno 13 exception.How to fix it...

Please help me

can't build Marshmallow app using just the Xamarin.Forms xaml template

$
0
0

Not trying to do anything unusual or otherwise exotic. Just using VS 2017 (15.9.6) to build an app that runs on my Marshmallow (v6.0) phone. The app in question is nothing more than the default "Welcome to Xamarin.Forms!". After a 2 day ordeal I finally was able to deploy the app to my phone where it promptly threw an exception:

01-31 10:07:56.664 32388 32388 E AndroidRuntime: Process: com.companyname.App1.Android, PID: 32388
01-31 10:07:56.664 32388 32388 E AndroidRuntime: java.lang.RuntimeException: Unable to get provider mono.MonoRuntimeProvider: java.lang.RuntimeException: Unable to find application Mono.Android.Platform.ApiLevel_27 or Xamarin.Android.Platform!

Is VS 2017 not honoring the minimum target framework (which is set to v6.0) when generating the apk? It ran fine in the VisualStudio_Android-23_arm_phone emulator so what gives? There are a lot of devices running Marshmallow - it isn't that old. How do I build an app that runs on an Android Marshmallow device?

Mismatch between the processor architecture

$
0
0

Hi.
I am using Xamarin.Forms on Visual Studio 2017. I am trying to use a dll that is compiled on 64bit. When i run the app on android emulator, it has a warning of "mismatch between the processor architecture" and the app crashed on the emulator. If i disable the initialization of the said dll, app runs fine.

Is it possible to use external dll's or api's on xamarin and if yes, how can we use those properly on xamarin.

Thanks...

Xamarin.Form How to get (Image,Header,Text) into a Listview without XAML

$
0
0

I think its a liteview i need in this case.

This is what i want to achieve.

I want every item in the listview to have a image,Header,text

The binding needs to be in the code to.

I have found this on a website.

var listView = new ListView ();
listView.ItemsSource = produkter ;
listView.ItemTemplate = new DataTemplate();

But cant figure out the rest.

List produkter = new List();
produkter = productlist();

public List productlist()
{
public String Header {get;set;}
public String text {get;set;}
public String image {get;set;}
}

Thanks alot if you can help with this.

ImageButton from Xamarin Forms 3.4: different render behavoir regarding to Image

$
0
0

Old implementation was
class MyImageButton : Image { … }

This I changed to class MyImageButton : ImageButton { … }
On platform UWP it's the same behavoir, iOS I never tested, but on Android it's different.

As it's forbidden to post links I cannot show the picture.
I have the "three Points menu image".
With ImageButton as base I see only the left/top quarter of the image.
With Image as base I see the image as expected.

Top Part is rendered with new ImageButton, the Bottom with my old Image based.

It's no big deal to Keep with my old implementation. But I'm wondering why ImageButton is rendered different from Image on Android.

Regards, Holger Gothan.

PdfSharp for iOS and Android

How can I change the hamburger icon for another one in Xamarin.Forms for Android?

$
0
0

How can I change the hamburger icon for another one in Xamarin.Forms for Android?

I tried a lot of methods to change the three bars (hamburger icon) for another icon with Xamarin.Forms, but it seems to always use the burger.

For iOS I already checked, and it works really great, but for some reason I can't show the same picture in Android.

For Android I'm using a default project created with the latest Xamarin Studio 6. It generates a MainActivity of type FormsAppCompatActivity.

Is there any way to change the picture consistently?


Login with Facebook

$
0
0

Hi people, my name's Leonardo, i have a solution of xamarin forms and it is a application android and ios, i need create a login that use facebook login, but, all help in internet not help me because nothing is functional, I tryed use Xamarin.auth and I no have success, please help me, sorry, my inglesh not is good.

Code for saving UIView as PDF in Xamarin.iOS

$
0
0

I am trying to use below code for saving UI View as PDF as in the link: https://forums.xamarin.com/discussion/129636/create-pdf-from-uiview#latest

partial void BtnTest_TouchUpInside(UIButton sender)
        {
            createPDFFromView(this.View);

        }
        public static NSMutableData createPDFFromView(UIView view)
        {

            NSMutableData pdfData = new NSMutableData();

            try
            {
                // Points the pdf converter to the mutable data object and to the UIView to be converted

                UIGraphics.BeginPDFContext(pdfData, view.Bounds, null);
                UIGraphics.BeginPDFPage(view.Bounds, null);

                var pdfContext = UIGraphics.GetCurrentContext();

                view.Layer.RenderInContext(pdfContext);

                UIGraphics.EndPDFContent();
            }
            catch (Exception ex)
            {

            }
            return pdfData;
        }

Is this the complete code or I need to additional code to consume NSMutabledata returned by createPDFFromView method here?

Displaying H.264 Video

$
0
0

I have the following code, its not pretty but 'should' be functional....
Gets data from a UDP source, and then processes, eventually displays in AVSampleBufferDisplayLayer...at least that's the idea, I can successfully do the first part, its just the displaying bit that fails, I get a blank scree on the emulator???. I get non error messages and cannot figure out what is going on now.
Anybody that can help, Ill be truly gratefully.

using System;
using System.Net;
using System.Net.Sockets;
using System.Text;
using System.Threading.Tasks;
using UIKit;
using CoreMedia;
using System.Collections.Generic;
using AVFoundation;
using CoreVideo;
using System.Runtime.InteropServices;
using ObjCRuntime;

namespace UDPTest.iOS
{
public partial class ViewController : UIViewController
{
UdpClient udpClient;
int Next;
int Previous;

    int state;
     int BufferPointer = 0;
    byte[] videoData = new byte[1000000];

    enum NALUnitType
    {
        unspecified = 0,
        codedSlice = 1,
        idr = 5,
        sps = 7,
        pps = 8,
    }


    byte[] SetUpStream = new byte[] {
        0x00, 0x01, 0x01, 0x76,                         /*     ...v */
        0x30, 0x30, 0x31, 0x30, 0x30, 0x30, 0x30, 0x36, /* 00100006 */
        0x30, 0x30, 0x30, 0x30, 0x35, 0x38, 0x30, 0x35, /* 00005805 */
        0x30, 0x30, 0x30, 0x30, 0x30, 0x31, 0x41, 0x75, /* 000001Au */
        0x64, 0x69, 0x6f, 0x31, 0x30, 0x35, 0x30, 0x30, /* dio10500 */
        0x30, 0x30, 0x30, 0x31, 0x56, 0x69, 0x64, 0x65, /* 0001Vide */
        0x6f, 0x31, 0x30, 0x39, 0x30, 0x30, 0x30, 0x30, /* o1090000 */
        0x30, 0x37, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x53, /* 07FrameS */
        0x69, 0x7a, 0x65, 0x32, 0x38, 0x30, 0x30, 0x30, /* ize28000 */
        0x66, 0x30, 0x30, 0x39, 0x30, 0x30, 0x30, 0x30, /* f0090000 */
        0x30, 0x31, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x52, /* 01FrameR */
        0x61, 0x74, 0x65, 0x66, 0x30, 0x37, 0x30, 0x30, /* atef0700 */
        0x30, 0x30, 0x30, 0x33, 0x42, 0x69, 0x74, 0x52, /* 0003BitR */
        0x61, 0x74, 0x65, 0x34, 0x30, 0x30 };            /* ate400 */

    byte[] Describe = new byte[] {
        0x00, 0x00, 0x00, 0x76,                         /*     ...v */
        0x30, 0x30, 0x31, 0x30, 0x30, 0x30, 0x30, 0x38, /* 00100008 */
        0x30, 0x30, 0x30, 0x30, 0x31, 0x30, 0x30, 0x37, /* 00001007 */
        0x30, 0x30, 0x30, 0x30, 0x30, 0x31, 0x41, 0x6c, /* 000001Al */
        0x6c, 0x49, 0x6e, 0x66, 0x6f, 0x31 };           /* lInfo1   */

    public ViewController(IntPtr handle) : base(handle)
    {
    }
    AVSampleBufferDisplayLayer test;
    public async override void ViewDidLoad()
    {
        base.ViewDidLoad();

        udpClient = new UdpClient(3102);

        state = 20;
        Next = 1;
        Previous = 0;



        test = new AVSampleBufferDisplayLayer
        {
            Frame = View.Frame,
            Bounds = View.Bounds,
            BackgroundColor = UIColor.Black.CGColor
        };

        View.Layer.AddSublayer(test);



        await UDPReceiveTest();





    }

    public override void DidReceiveMemoryWarning()
    {
        base.DidReceiveMemoryWarning();
        // Release any cached data, images, etc that aren't in use.     
    }


    private async Task UDPReceiveTest()
    {
        while (true)
        {
            IPEndPoint Ip2 = new IPEndPoint(IPAddress.Parse("255.255.255.255"), 1000);

            var UdpReceiveResult = await udpClient.ReceiveAsync();
            ProcessPacket(UdpReceiveResult.Buffer);
        }
    }

    private void UDPSendPacket(byte[] data)
    {//192.168.1.1
        IPEndPoint Ip2 = new IPEndPoint(IPAddress.Parse("255.255.255.255"), 1000);
        var UdpReceiveResult = udpClient.Send(data, data.Length, Ip2);
     }

    private void ProcessPacket(byte[] Buffer)
    {
        if (Check_Announcement(Buffer) == true)
        {
            Console.WriteLine("Announcement");

            string DescribeL = "\0\0\0v0010000800001007000001AllInfo1";
            byte[] buffer = System.Text.Encoding.UTF8.GetBytes(DescribeL);
            UDPSendPacket(buffer);
            state = 2;
        }

        switch (state)
        {
            case 2: //Got Anouncement
                {
                    if (Check_Description(Buffer) == true)
                    {
                        Console.WriteLine("Description Received");
                        byte[] buffer2 = new byte[] { 0x01, 0x00, 0x01, 0x76 };
                        UDPSendPacket(buffer2);
                        UDPSendPacket(SetUpStream);
                        state = 3;
                    }
                    break;
                }

            case 3: //Got All Info
                {
                    if (Check_SetUpStreamAck(Buffer) == true)
                    {
                        Console.WriteLine("Got Setup Stream ACK");
                        byte[] buffer2 = new byte[] { 0x01, 0x01, 0x02, 0x76 };
                        UDPSendPacket(buffer2);

                        string s = System.Text.Encoding.UTF8.GetString(buffer2, 0, buffer2.Length);
                        state = 4;
                    }
                    break;
                }

            case 4: //Got Stream Settings
                {
                    if (VideoDataIsRecognised(Buffer) == true)
                    {
                        int temp = Buffer[1] + 1;
                        byte[] next = BitConverter.GetBytes(temp);
                        byte[] ackb = new byte[] { 0x01, Buffer[1], next[0], 0x76 };

                        UDPSendPacket(ackb);
                        AppendVideoData(Buffer);

                    }
                    break;
                }

            default:
                    break;
        }
    }

    private bool Check_Announcement(byte[] buffer)
    {
        if (buffer.Length == 32)
        {
            if (BitConverter.ToUInt32(buffer, 0) == 1752855916)
            {
                return true;
            }
        }
        return false;
    }

    private bool Check_Description(byte[] buffer)
    {
        if (buffer.Length == 733)
        {
            string ss = System.Text.Encoding.UTF8.GetString(buffer, 26, 7);
            if (0 == string.Compare(ss, "AllInfo"))
            {
                return true;
            }
        }
        return false;
   }

    private bool Check_SetUpStreamAck(byte[] buffer)
    {
        if (buffer.Length == 30)
        {
            string ss = System.Text.Encoding.UTF8.GetString(buffer, 26, 4);
            if (0 == string.Compare(ss, "Ret1"))
            {
                return true;
            }
        }
        return false;
    }




    private bool VideoDataIsRecognised(byte[] buffer)
    {
        if (buffer.Length >= 90)
        {
            string ss = System.Text.Encoding.UTF8.GetString(buffer, 95, 4);
            if (0 == string.Compare(ss, "Data"))
            {
                return true;
            }
        }
        return false;
    }


    private void AppendVideoData(byte[] buffer)
    {
        if (buffer[99] == 0x00 && buffer[100] == 0x00 && buffer[101] == 0x00 && buffer[102] == 0x01) // 'Data' in bytes 95,96,97,98 so Ceck 99 onwards for NAL start Code
        {
            if (BufferPointer == 0)
            {
                // this is the first NAL, we will buffer this, and await the rest of the data in the remainder seuqnce,
                // we will display when we get another sequence buffer tstarting with NAL
                int copy = buffer.Length - 99;
                Buffer.BlockCopy(buffer, 99, videoData, BufferPointer, copy);
                BufferPointer = buffer.Length - 99;
            }
            else
            {
                // we already have data in our buffer, got our NAL so lets process what we have
                ProcessVideo(videoData);

                // Now store the new data we got and reset out pointer to show were gthering data
                Buffer.BlockCopy(buffer, 99, videoData, 0, buffer.Length - 99);
                BufferPointer = buffer.Length - 99; 

            }
        }
        else
        {
            // Doesnt start with a NAL start code, so either scrambled, or we are building a bigger buffer...
            BufferPointer = BufferPointer + buffer.Length - 99;
            Buffer.BlockCopy(buffer, 99, videoData, BufferPointer, buffer.Length - 99);
        }
    }


    private bool CheckNALUStartCode(byte[] buffer)
    {
        if (buffer[0] == 0x00 && buffer[1] == 0x00 && buffer[2] == 0x00 && buffer[3] == 0x01)
        {
            return true;
        }
        return false;
    }

    private int StartCodeIndex(byte[] buffer, int from)
    {
        for (int i = from; i < buffer.Length - 5; i++)
        {
            if (buffer[i] == 0x00 && buffer[i + 1] == 0x00 && buffer[i + 2] == 0x00 && buffer[i + 3] == 0x01)
            {
                return i;
            }
        }
        return -1;
    }



    CMBlockBuffer blockBuffer = null;
    CMSampleBuffer sampleBuffer = null;
    CMVideoFormatDescription formatDescription;


    private void ProcessVideo(byte[] buffer)
    {
        // SPS, PPS, IDS
        // BYTE: 0   1   2   3   4   5   6   7   8   9   10  11  12  13  14  15  16  17  18  19  20  21  22  23  24  25  26  27  28  29  30  31  32  33  34  35  36  37  38  39  40  41  42 ........ etc 
        // DATA: 0   0   0   1   SPS D   D   D   D   D   D   D   D   D   D   D   0   0   0   1   PPS D   D   D   D   D   D   D   D   D   D   D   0   0   0   1   IDR D   D   D   D   D   D  ........ etc

        // Coded Slide
        // BYTE: 0   1   2   3   4   5   6   7   ........ etc 
        // DATA: 0   0   0   1   CDS D   D   D   ........ etc

        Console.WriteLine("Processing : " + BufferPointer.ToString());
        NALUnitType naluType = (NALUnitType)(buffer[4] & 0x1F);

        int spsRangeLower = 0;
        int ppsRangeLower = 0;

        int blockLength = 0;

        if (formatDescription == null && naluType != NALUnitType.sps)
        {
            Console.WriteLine("Error: format Description is nil and frame does not start from SPS");
            return;
        }

        if (naluType == NALUnitType.sps)
        {
            //sps should be 4 to 15, then 4 buffer bytes 0,0,0,1 ..so next NALU in byte 20, we DO NOT Include the code 0,0,0,1 (start code header) in the data
            spsRangeLower = 4;
            naluType = (NALUnitType)(buffer[20] & 0x1F);
        }

        if (naluType == NALUnitType.pps)
        {
            //pps should be 20 to 31
            ppsRangeLower = 20;
            naluType = (NALUnitType)(buffer[36] & 0x1F);
        }


        if (spsRangeLower != 0 && ppsRangeLower != 0) // Check we have SPS and PPS
        {
            int spsSize = 12;
            int ppsSize = 12;
            formatDescription = null;

            byte[] param1 = new byte[spsSize];
            byte[] param2 = new byte[ppsSize];
            Array.Copy(buffer, spsRangeLower, param1, 0, spsSize);
            Array.Copy(buffer, ppsRangeLower, param2, 0, ppsSize);
            var props = new List<byte[]> { param1, param2 };

            CMFormatDescriptionError Status = new CMFormatDescriptionError();
            formatDescription = CMVideoFormatDescription.FromH264ParameterSets(props, 4, out Status); 

            if (formatDescription == null)
            {
                Console.WriteLine("Error: Can't create CMFormatDescription" + Status.ToString());
                return;
            }
        }

        if (naluType == NALUnitType.idr)
        {
            Console.WriteLine("Processing IDR");

            int offset = 32; // starts at the header 0,0,0,1
            blockLength = BufferPointer-offset;
            byte[] data = new byte[blockLength];
            Array.Copy(buffer, offset, data, 0, blockLength);

            byte[] intBytes = BitConverter.GetBytes((UInt32)(blockLength - 4)); // dont include the header bytes, in the length
            Array.Reverse(intBytes);

            // now replace the 0,0,0,1 header bytes with the big endian length
            Array.Copy(intBytes, data, 4);

            CMBlockBufferError bbstatus = new CMBlockBufferError();
            blockBuffer =CMBlockBuffer.FromMemoryBlock(data, 0, 0, out bbstatus);

            if (blockBuffer == null)
            {
                Console.WriteLine("Error: Can't create CMBlockBuffer from IDR" + bbstatus.ToString());
                return;
            }
        }


        if (naluType == NALUnitType.codedSlice)
        {
            Console.WriteLine("Processing Code Slice");

            // no offset coded slice always comes in its own UDP packet, with it NALU header as 0,1,2,3 bytes.... this gets replaces with length below.
            blockLength = BufferPointer;

            byte[] data = new byte[blockLength];
            Array.Copy(buffer, 0, data, 0, blockLength); 

            byte[] intBytes =  BitConverter.GetBytes((UInt32)(blockLength - 4)); // dont include the header bytes, in the length
            Array.Reverse(intBytes);
            // now replace the 0,0,0,1 header bytes with the big endian length
            Array.Copy(intBytes, data, 4);

            CMBlockBufferError bbstatus = new CMBlockBufferError();
            blockBuffer = CMBlockBuffer.FromMemoryBlock(data, 0, 0, out bbstatus);

            if (blockBuffer == null)
            {
                Console.WriteLine("Error: Can't create CMBlockBuffer from coded slice" + bbstatus.ToString());
                return;
            }
        }

        if (blockBuffer != null)
        {
            CMSampleBufferError status = new CMSampleBufferError();
            nuint[] sampleSizeArray = new nuint[1];
            sampleSizeArray[0] = (nuint)blockLength; //(nuint)BufferPointer;

            CMSampleTimingInfo[] cmT = new CMSampleTimingInfo[1];
            cmT[0].DecodeTimeStamp = sampleBuffer.DecodeTimeStamp;
            cmT[0].PresentationTimeStamp = sampleBuffer.PresentationTimeStamp;
            cmT[0].Duration = sampleBuffer.Duration;

            sampleBuffer = CMSampleBuffer.CreateReady(blockBuffer, formatDescription, 1, cmT, sampleSizeArray, out status);

            if (sampleBuffer == null)
            {
                Console.WriteLine("Error: Failed to create CMSampleBuffer");
                return;
            }

            var dt = sampleBuffer.Duration;
            var ts = sampleBuffer.DecodeTimeStamp;
            var tp = sampleBuffer.PresentationTimeStamp;

            Console.WriteLine("Duration: " + dt.Value);


            //CMSampleBufferAttachmentSettings set = new CMSampleBufferAttachmentSettings(sampleBuffer.GetAttachments(CMAttachmentMode.ShouldNotPropagate));
            //set.DisplayImmediately = true;


            CMSampleBufferAttachmentSettings c = sampleBuffer.GetSampleAttachments(true)[0];
            c.DisplayImmediately = true;
            sampleBuffer.SetAttachments(c.Dictionary, CMAttachmentMode.ShouldNotPropagate);

            if (test.ReadyForMoreMediaData)
            {
                test.EnqueueSampleBuffer(sampleBuffer);
                test.SetNeedsDisplay();


                CoreGraphics.CGImage tef = test.Contents;
                if (tef == null)
                {
                    Console.WriteLine("No Image Data?");
                }
            }
        }
        else 
        {
            Console.WriteLine("Error: Reached end of the method without available blockBuffer");
            return;
        }


    }




}

}

Auto logout after x minutes due to idle/inactivity in android

$
0
0

Is there way on how to auto logout the session of the user, when the user is idle or not clicking the app? Thank you.

application xamarin android that can handle commands from remote

$
0
0

I have android tv box, and I have a remote with numbers
I want to try making an application, which can handle all the numbers in my remote
such as press 1, then the "youtube" application will open,
such as press 2, then the "xplore" application will open,
such as press 3, then the "file manager" application will open,

like the thing, press the home button on Android, it will return to home
I want to make it like that, if you press the number you want, then the application you are going to will open

when pressing 0, it will return to the application we made, to change the settings (number = application)

like "adb getevent -lt"
when there is a keyevent it will respond to the button that is pressed

I want to code like this:

    public override bool OnKeyDown(Android.Views.Keycode keyCode, Android.Views.KeyEvent e)
    {
        if (keyCode == Android.Views.Keycode.Num1)
        {
            >>>> open youtube
        }
        if (keyCode == Android.Views.Keycode.Num2)
        {
            >>>> open xplore
        }
        if (keyCode == Android.Views.Keycode.Num3)
        {
            >>>> open file manager
        }
        if (keyCode == Android.Views.Keycode.Num0)
        {
            >>>> open my app
        }
    }

Such code only applies, when my application is on display
when another application is on the screen then "OnKeyDown" not applicable

anyone can help me so that my application "OnKeyDown" can work on the background???

drivegooglecom/file/d/11q6e3VNuoAGYZShinSYj8iJ4X7TiBY9v/view?usp=sharing

How to reduce File Provider memory footprint?

$
0
0

Any ideas/tricks on how to reduce the memory footprint of my NSFileProviderExtension more than I already have?

I have done the following:
1. Got rid of JSON.net
2. Got rid of System.Http.Net
3. Run file provider in Release mode (only build ARM64)

The file provider starts out with a footprint of about 11.5 MB on iPhone6 and 13.5 on iPad Pro (appex size is 2.3MB). Of course, when it hits 15 MB, BOOM!

For comparison, a file provider I built with XCode starts out with a memory footprint of about 3.4MB.

I can run for a while on my iPhone 6 but running on any iPad Pro quits upon first navigation.

I have a Pro account so I don't have access to the Xamarin Profiler.

Unfortunately, for iOS11 I needed to add Mono.Data.Sqlite. I hadn't seen this problem before adding sqlite. See references below:

Here are my iOS build settings:

Xamarin Forms / Best way to share file on Android?

$
0
0

Hi! I have an app in production on the iOS side of the world. It includes the ability to share a local file (a simple zip archive I create of local app data). On the Android side of things, I see all over the forums that Android tightened security restrictions for file access sometime in late 2017 or early 2018, thus requiring the use of a FileProvider. I found some blogs on how to implement a FileProvider directly in Java and the manifest file, but I can't find anything for Xamarin Forms using an Android dependency... or I'm just entering the wrong search criteria! Any pointers would be greatly appreciated. I just want my Android users to be able to attach a zip or text file to an email or share it via another method using a Share Intent.

Thanks for any heads ups or links to already existing good documentation!


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

Any ebook reader SDK for Xamarin forms?

SoundPool pause and resume

$
0
0

Hi all,
I just released my first mobile game (tepoball) and one of my customers is experiencing a problem with sound. Sometimes the music keeps playing even the app is in the background. He was not able to Isolate the problem and uses a Moto G5 device with Android 8.1. What the app basically does is when the OnPause event of the Activity is raised it calls the method SoundPool.AutoPause and the same for the OnResume event with AutoResume. Did anyone have the same problem and came up with a solution?

when all BindableProperties get initialized from XAML regardless their declaration order?

$
0
0

This happens a lot when creating custom controls (mostly in code only). In many cases some properties (if not all) are dependent on each other, like for example: ItemsSource and DisplayMemberPath .. etc- I need to know the value of DisplayMemberPath while I'm iterating over the ItemsSource to render controls (set the Text of a Label to the value of DisplayMemberPath).

when I process Items in the ItemsSource collection I want to make sure that the DisplayMemberPath property has also been set,
when using the propertyChanged delegate of the ItemsSourceProperty it's likely that the DisplayMemberPathProperty is null, if it's set in XAML after ItemsSource:

<controls:FlowList ItemsSource="{Binding Items}" DisplayMemberPath="Title"/>

so, where is the proper place where I'll be sure every property has been set regardless their declaration order?

Emoji View like whatsup

$
0
0

Good Day All

i have lots of emojis, i want to create the same view whatsup create when someone select the emoji button as depicted below

i tried to put them i a stacklayout and make its orientation horizontal and scroll but it does not fit well .

Thanks

Viewing all 204402 articles
Browse latest View live


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