Thursday, November 9, 2017

XAML Compilation

Using the XAML compiler to increase the performance of a Xamarin.Forms app

XAML can be optionally compiled directly into intermediate language (IL) with the XAML compiler (XAMLC).
XAMLC offers a number of a benefits:
It performs compile-time checking of XAML, notifying the user of any errors.
It removes some of the load and instantiation time for XAML elements.

XAMLC is disabled by default to ensure backwards compatibility. It can be enabled at both the assembly and class level by adding the XamlCompilation attribute.

The following code example demonstrates enabling XAMLC at the assembly level:

It helps to reduce the file size of the final assembly by no longer including .xaml files.

The following code example demonstrates enabling XAMLC at the assembly level:
using Xamarin.Forms.Xaml;
[assembly: XamlCompilation(XamlCompilationOptions.Compile)]You can also enable XAMLC at the class level

Tuesday, October 3, 2017

Creating a list of unique random numbers

Creating a list of unique random numbers

public static List<int> GetUniqueRandomNumbers(int iAmountOfRandomNumbers, int iSmallestNumber, int iBiggestNumber)

            //Create a list of numbers from which the routine
            //shall choose the result numbers
            List<int> lstPossibleNumbers = new List<int>();
            for (int i = iSmallestNumber; i <= iBiggestNumber; i++)

            //Create a list, which shall hold the result numbers
            List<int> lstResultList = new List<int>();

            //Initialize a random number generator
            Random objRand = new Random();

            //For-loop which picks each round a unique random number
            for (int i = 0; i < iAmountOfRandomNumbers; i++)
                //Generate random number
                int randomNumber = objRand .Next(1, lstPossibleNumbers.Count) - 1;
                //Use random number as index for the possible number list
                //Remove the chosen result number from possible numbers list
            return lstResultList;

Friday, May 19, 2017

iTunes Connect Screenshots Sizes for all iOS (iPhone/iPad/Apple Watch) devices

The following resolutions are acceptable to iTunes connect:
  • iPhone 3+4 (3.5 Inch)
    • 640 x 960
  • iPhone 5 (4 Inch)
    • 640 x 1136
  • iPhone 6 (4.7 Inch)
    • 750 x 1334
  • iPhone 6 Plus (5.5 Inch)
    • 1242 x 2208
    • You need the screenshot in this resolution, the phone scales them down to 1080 x 1920
  • iPad (Air and Mini Retina)
    • 1536 x 2048
  • iPad Pro (12.9 Inch)
    • 2048 x 2732
  • Apple Watch
    • 312 x 390 pixels
    • (only one orientation)

Wednesday, May 17, 2017

Issues in Xamarin.iOS - Failed to launch the simulator: Could not find file "/Users/_____/Library/Caches/Xamarin/mtbs/builds/...

Clean Visual Studio solution: which can be dome by t manually by removing every bin/obj folder,
On Mac, remove  everything under /Users/<User Name>/Library/Caches/Xamarin/mtbs/builds

In Mac you have two ways of accessing the Go To Folder function from the Mac OS X desktop and Finder:
From the “Go” menu navigate down to “Go to Folder” ….or better yet…
Hit Command+Shift+G from the OS X desktop or a Finder window

Learning Azure /