All Posts By

admin

New SWIFTFramework 2018.1

By | Blog, Uncategorized

New SWIFTFramework version 2018.1 with the latest bugfixes and enhancements is available to download and upgrade. Please check our dedicated site at SWIFTComponents web.

What’s new

  • Latest 2018 specification messages
  • Highly improved performance with up to 3x speed improvement with validation
  • FIX – multithreading validation fix

  • Download at: http://www.iosbits.co.uk/swiftcomponents/Downloads/SWIFTFramework_2018_1.zip

    Happy Coding.

    New SWIFTFramework version 2017.2

    By | Blog

    New SWIFTFramework version 2017.2 with the latest bugfixes and enhancements is available to download and upgrade. Please check our dedicated site at SWIFTComponents web.

    What’s new

  • Latest 2017 specification messages
  • Highly improved performance with up to 3x speed improvement with validation
  • FIX – Category 5 fixes
  • FIX – issues with tag order fixed


  • Happy Coding.

    New SWIFTFramework version 2017.1

    By | Blog

    New SWIFTFramework version 2017.1 with the latest SWIFT “November” changes is available to download and upgrade. Please check our dedicated site at SWIFTComponents web.

    What’s new

  • Latest 2017 specification messages
  • Highly improved performance with up to 3x speed improvement with validation
  • Option to switch off the schema validation making the parsing and basic message creation up to 100x faster
  • Improved licensing mechanism with added RunTime key code setting


  • Happy Coding.

    Detect non system input method

    By | Blog

    On Android developers cannot define whether the input field supports non standards/custom keyboards. This might be an issue for secured applications, like mobile banking, or any line of business apps. What can be done then is to at least notify the user that this is the case and he should be careful not to use such input methods when logging in and use only the system default ones.

    The code to check that is:

    InputMethodManager methodManager = (InputMethodManager)this.GetSystemService (Context.InputMethodService);
    
    foreach (var inputMethodInfo in methodManager.EnabledInputMethodList)
    {
        if (inputMethodInfo.Id.Equals (Settings.Secure.GetString (ContentResolver, Settings.Secure.DefaultInputMethod)) == false)
        {
            if ((inputMethodInfo.ServiceInfo.ApplicationInfo.Flags & ApplicationInfoFlags.System) == 0)
            {
                // we found non default input method, so show the error toast and return;
            }
        }
    }
    

    Happy coding.

    Cannot run Android SDK Manager

    By | Blog

    After the Android SDK or Xamarin updates, should you ever have trouble to run Android SDK Manager and see the exception:

    java.lang.NullPointerException
    at java.io.File.(File.java:277)
    at com.android.sdklib.internal.avd.AvdManager.parseAvdInfo(AvdManager.java:1623)
    at com.android.sdklib.internal.avd.AvdManager.buildAvdList(AvdManager.java:1584)
    at com.android.sdklib.internal.avd.AvdManager.(AvdManager.java:357)
    at com.android.sdklib.internal.avd.AvdManager.getInstance(AvdManager.java:380)
    at com.android.sdklib.internal.repository.updater.UpdaterData.initSdk(UpdaterData.java:259)
    at com.android.sdklib.internal.repository.updater.UpdaterData.(UpdaterData.java:127)
    at com.android.sdkuilib.internal.repository.SwtUpdaterData.(SwtUpdaterData.java:61)
    at com.android.sdkuilib.internal.repository.ui.AvdManagerWindowImpl1.(AvdManagerWindowImpl1.java:97)
    at com.android.sdkuilib.repository.AvdManagerWindow.(AvdManagerWindow.java:83)
    at com.android.sdkmanager.Main.showAvdManagerWindow(Main.java:432)
    at com.android.sdkmanager.Main.doAction(Main.java:380)
    at com.android.sdkmanager.Main.run(Main.java:151)
    at com.android.sdkmanager.Main.main(Main.java:117)

    then just delete directory “users//.android/avd”.

    Happy coding!

    iOS Custom badge control

    By | Blog

    Ever needed to create custom badge to UITabBarItem? Well here you go. I think it is pretty selfexplanatory.

    public static class UITabBarItem_CustomBadge
    	{
    		public static void SetCustomBadgeValue (this UITabBarItem tabBarItem, string value, UIFont font, UIColor textColor, UIColor borderColor)
    		{
    			UIView view = (UIView)tabBarItem.ValueForKey (new NSString ("view"));
    
    			tabBarItem.BadgeValue = value;
    
    			// remove old one
    			foreach (UIView subview in view.Subviews)
    			{
    				if (subview.Tag == 99) // badge has tag of 99
    				{
    					subview.RemoveFromSuperview ();
    
    					break;
    				}
    			}
    
    			foreach (UIView subview in view.Subviews)
    			{
    				if (subview.ToString ().StartsWith ("<_UIBadgeView:"))
    				{
    					// create new label view that we can style.
    					// remove background, add border, make it nice
    					var label = new UILabel (subview.Frame);
    
    					label.TextAlignment = UITextAlignment.Center;
    					label.Font = font;
    					label.Text = value;
    					label.BackgroundColor = borderColor.ColorWithAlpha (.5f);
    					label.TextColor = textColor;
    					label.Layer.BorderColor = borderColor.CGColor;
    					label.Layer.BorderWidth = 1;
    					label.Layer.CornerRadius = label.Frame.Height / 2;
    					label.Layer.MasksToBounds = true;
    
    					view.AddSubview (label);
    					subview.Hidden = true;
    
    					label.Tag = 99; // fake it here for iOS 😉
    				}
    			}
    		}
    	}
    

    Enjoy and happy coding!