iOS WkWebview Return A Blank Screen / White Screen

Try to code your first example of WkWebview / UIWebView in your iOS app always return a blank screen or white screen? You are not alone. Apparently since iOS 9, all HTTP / non-secure web connection is block by default. It is something call App Transport Security (ATS).

You can add the following configuration into Info.plist to allow WkWebview / UIWebView to load HTTP / non-secure web page:

<key>NSAppTransportSecurity</key>
<dict>
    <key> NSAllowsArbitraryLoadsInWebContent</key>
    <true/>
</dict>

Or you can completely disable App Transport Security by

<key>NSAppTransportSecurity</key>
<dict>
    <key>NSAllowsArbitraryLoads</key>
    <true/>
</dict>

Source: https://developer.xamarin.com/guides/ios/application_fundamentals/ats/

Comparing Ad Providers in Windows Phone (My Experience)

More and more ad providers are starting to provider ad service for Windows Phone platform. As a Windows Phone developer, I find it very difficult to find any blog post or review comparing the ad providers in Windows Phone. (You can find a lot for Android and iOS.) I’m writing this blog post according to my own experience as a Windows Phone developer dealing with the ad providers. Hopefully this can help you select which ad providers to include in your apps without going through too much trouble.

 

Before you continue read this post, you need to understand the following things:

  • The fill-rate, CTR (click through rate), eCPM (pay per thousand impression) and eCPC (pay per click) are vary according to app, category, country and platform.
  • I only used the SDK for Windows Phone 7 version the ad providers given instead of Windows Phone 8 version since I wanted to support as many device as possible.
  • The list below are sorted according to my own preference according to their performance previously.
  • Those are my own experiences, it maybe vary from others.
  • Please don’t compare the eCPM or eCPC with other platform like Android or iOS… just don’t.

Continue reading Comparing Ad Providers in Windows Phone (My Experience)

Windows Store App – Focus on TextBox when Navigated To The Page

Some time you want to make your app more user friendly by automatically focus on specify control for example search text box so that when user open the page, they can start typing the keyword they want to search rather than click on the search text box first then only start typing.

I try to use TextBox.Focus() in OnNavigatedTo, but it nothing happen. So I try to use the same method use in Silverlight by creating a DispatcherTimer and delay the focus by 0.5 second. Well, this method work out in Windows Store App. If you are interested, below are the code.

// timer to create initial focus on control
DispatcherTimer initialFocusDispatcherTimer = new DispatcherTimer();
initialFocusDispatcherTimer.Interval = new TimeSpan(0, 0, 0, 0, 500);
initialFocusDispatcherTimer.Tick += (tickSender, tickEvent) =>
    {
        initialFocusDispatcherTimer.Stop();

    // focus on search bar
    SearchTextBox.Focus(Windows.UI.Xaml.FocusState.Keyboard);
    };
initialFocusDispatcherTimer.Start();

 

 

by Ooi Keng Siang via Ooiks’s Blog

Windows Store App – Check If File Exist or Not

Before Windows 8, to check a file exist or not on Windows Phone 7.5 or .NET can be as simple as calling the file.IsFileExist() and it will return a simple boolean indicated whatever the file exist or not. But Windows 8 team decided to have a totally different way and I had no idea why Microsoft or Windows 8 team decided to re-write it.

Anyway, here is how it work out in Windows 8 app (C# code):

public async Task<bool> IsFileExist(string path)
{
    try
    {
        await Windows.Storage.StorageFile.GetFileFromPathAsync(path);

        // file found
        return (true);
    }
    catch
    {
        // file not found
        return (false);
    }
}

 

by Ooi Keng Siang via Ooiks’s Blog