private static Application SetWrapperSdkAndGetApplication()
 {
     AndroidMobileCenter.SetWrapperSdk(new AndroidWrapperSdk {
         WrapperSdkName = WrapperSdk.Name, WrapperSdkVersion = WrapperSdk.Version
     });
     return((Application)Application.Context);
 }
Example #2
0
        static Application SetWrapperSdkAndGetApplication()
        {
            var    monoAssembly                 = typeof(Java.Lang.Object).Assembly;
            var    monoAssemblyAttibutes        = monoAssembly.GetCustomAttributes(typeof(AssemblyInformationalVersionAttribute), true);
            var    monoAssemblyVersionAttibutes = monoAssemblyAttibutes as AssemblyInformationalVersionAttribute[];
            string xamarinAndroidVersion        = null;

            if (monoAssemblyVersionAttibutes?.Length > 0)
            {
                xamarinAndroidVersion = monoAssemblyVersionAttibutes[0].InformationalVersion;
                xamarinAndroidVersion = xamarinAndroidVersion?.Split(';')[0];
            }
            var wrapperSdk = new AndroidWrapperSdk
            {
                WrapperSdkName        = WrapperSdk.Name,
                WrapperSdkVersion     = WrapperSdk.Version,
                WrapperRuntimeVersion = xamarinAndroidVersion
            };

            AndroidMobileCenter.SetWrapperSdk(wrapperSdk);
            return((Application)Application.Context);
        }