@Override
  public void onCreate() {
    // OkHttp changes the global SSL context, breaks other HTTP clients.  Google Analytics uses a
    // different http
    // client, which OkHttp doesn't handle well.
    // https://github.com/square/okhttp/issues/184
    if (!mUrlStreamFactorySet) {
      URL.setURLStreamHandlerFactory(Utils.createOkHttpClient());
      mUrlStreamFactorySet = true;
    }

    // Use OkHttp instead of HttpUrlConnection to handle HTTP requests, OkHttp supports 2.2 while
    // HttpURLConnection
    // is a bit buggy on froyo.
    if (!mConnectionFactorySet) {
      HttpRequest.setConnectionFactory(new OkConnectionFactory());
      mConnectionFactorySet = true;
    }

    super.onCreate();

    sMainApplication = this;
    setSite(getDefaultSite());
  }