public static void HideBannerAd() {
   if (SonarFrameworkSettings.USE_ADMOB) {
     admob.HideBannerAd();
   }
   if (SonarFrameworkSettings.USE_REVMOB) {
     revmob.HideBannerAd();
   }
 }
  public void onResume() {
    // REVMOB
    if (SonarFrameworkSettings.USE_REVMOB) {
      revmob.onResume();
    }

    if (SonarFrameworkSettings.USE_FACEBOOK) {
      facebook.onResume();
    }

    if (SonarFrameworkSettings.USE_ADMOB) {
      admob.onResume();
    }

    if (SonarFrameworkSettings.USE_CHARTBOOST) {
      chartboost.onResume();
    }

    if (SonarFrameworkSettings.USE_ADCOLONY) {
      adcolony.onResume();
    }

    if (SonarFrameworkSettings.USE_VUNGLE) {
      vungle.onResume();
    }
    if (SonarFrameworkSettings.USE_AMAZON_GAMECIRCLES) {
      amazongameCircle.onResume();
    }
    if (SonarFrameworkSettings.USE_REVMOB) {
      flurry.onResume();
    }
  }
  public void onCreate(Bundle b) {
    // GOOGLE PLAY SERVICES
    if (SonarFrameworkSettings.USE_GOOGLE_PLAY_GAME_SERVICES) {
      googlePlayServices.onCreate(b);
    }
    // REVMOB
    if (SonarFrameworkSettings.USE_REVMOB) {
      revmob.onCreate(b);
    }

    if (SonarFrameworkSettings.USE_FACEBOOK) {
      facebook.onCreate(b);
    }

    if (SonarFrameworkSettings.USE_TWITTER) {
      twitter.onCreate(b);
    }

    if (SonarFrameworkSettings.USE_ADMOB) {
      admob.onCreate(b);
    }

    if (SonarFrameworkSettings.USE_CHARTBOOST) {
      chartboost.onCreate(b);
    }

    if (SonarFrameworkSettings.USE_ADCOLONY) {
      adcolony.onCreate(b);
    }

    if (SonarFrameworkSettings.USE_VUNGLE) {
      vungle.onCreate(b);
    }
  }
  public static void showLeaderboard(final String leaderboardID) {
    if (SonarFrameworkSettings.USE_GOOGLE_PLAY_GAME_SERVICES) {
      ((SonarFrameworkActivity) app)
          .runOnUiThread(
              new Runnable() {

                @Override
                public void run() {
                  if (isSignedIn()) {
                    ((SonarFrameworkActivity) app)
                        .startActivityForResult(
                            googlePlayServices.showLeaderboard(leaderboardID), REQUEST_LEADERBOARD);
                  } else {
                    String message =
                        app.getResources()
                            .getString(
                                app.getResources()
                                    .getIdentifier(
                                        "fail_show_leaderboard", "string", app.getPackageName()));
                    message = message.replace("{leaderboardID}", leaderboardID);
                    displayAlert(message);
                  }
                }
              });
    }
    if (SonarFrameworkSettings.USE_AMAZON_GAMECIRCLES) {
      amazongameCircle.showLeaderboards();
    }
  }
  public static void submitScore(final String leaderboardID, final long score) {
    if (SonarFrameworkSettings.USE_GOOGLE_PLAY_GAME_SERVICES) {
      ((SonarFrameworkActivity) app)
          .runOnUiThread(
              new Runnable() {

                @Override
                public void run() {
                  if (isSignedIn()) {
                    Log.d("Google Play Services", "Submit score " + score + " to " + leaderboardID);
                    googlePlayServices.submitScore(leaderboardID, score);

                  } else {
                    String message =
                        app.getResources()
                            .getString(
                                app.getResources()
                                    .getIdentifier(
                                        "fail_submit_score_leaderboard",
                                        "string",
                                        app.getPackageName()));
                    message = message.replace("{score}", score + "");
                    message = message.replace("{leaderboardID}", leaderboardID);
                    displayAlert(message);
                  }
                }
              });
    } else if (SonarFrameworkSettings.USE_AMAZON_GAMECIRCLES) {
      amazongameCircle.submitScore(leaderboardID, score);
    }
  }
 // GooglePlayServices Functions
 public static boolean isSignedIn() // returns if the user is signed into google play services
     {
   if (SonarFrameworkSettings.USE_GOOGLE_PLAY_GAME_SERVICES) {
     return googlePlayServices.isSignedIn();
   }
   return false;
 }
  public boolean onBackPressed() {
    if (SonarFrameworkSettings.USE_CHARTBOOST) {
      return chartboost.onBackPressed();
    }

    return false;
  }
  public void onDestroy() {
    if (SonarFrameworkSettings.USE_FACEBOOK) {
      facebook.onDestroy();
    }

    if (SonarFrameworkSettings.USE_ADMOB) {
      admob.onDestroy();
    }

    if (SonarFrameworkSettings.USE_CHARTBOOST) {
      chartboost.onDestroy();
    }

    if (SonarFrameworkSettings.USE_MOPUB) {
      mopub.onDestroy();
    }
  }
  public void onActivityResult(int request, int response, Intent data) {
    // GOOGLE PLAY SERVICES
    if (SonarFrameworkSettings.USE_GOOGLE_PLAY_GAME_SERVICES) {
      googlePlayServices.onActivityResult(request, response, data);
    }

    if (SonarFrameworkSettings.USE_FACEBOOK) {
      facebook.onActivityResult(request, response, data);
    }

    if (SonarFrameworkSettings.USE_TWITTER) {
      twitter.onActivityResult(request, response, data);
    }

    if (SonarFrameworkSettings.USE_ADMOB) {
      admob.onActivityResult(request, response, data);
    }
  }
  public void onPause() {
    if (SonarFrameworkSettings.USE_FACEBOOK) {
      facebook.onPause();
    }

    if (SonarFrameworkSettings.USE_ADMOB) {
      admob.onPause();
    }

    if (SonarFrameworkSettings.USE_CHARTBOOST) {
      chartboost.onPause();
    }

    if (SonarFrameworkSettings.USE_ADCOLONY) {
      adcolony.onPause();
    }

    if (SonarFrameworkSettings.USE_VUNGLE) {
      vungle.onPause();
    }
  }
  public void onStop() {
    // GOOGLE PLAY SERVICES
    if (SonarFrameworkSettings.USE_GOOGLE_PLAY_GAME_SERVICES) {
      googlePlayServices.onStop();
    }

    if (SonarFrameworkSettings.USE_FACEBOOK) {
      facebook.onStop();
    }

    if (SonarFrameworkSettings.USE_TWITTER) {
      twitter.onStop();
    }

    if (SonarFrameworkSettings.USE_ADMOB) {
      admob.onStop();
    }

    if (SonarFrameworkSettings.USE_CHARTBOOST) {
      chartboost.onStop();
    }
    if (SonarFrameworkSettings.USE_FLURRY_ANALYTICS) {
      flurry.onStart();
    }
  }
 public static void FacebookShare(
     final String name,
     final String link,
     final String description,
     final String caption,
     final String imagePath) {
   if (SonarFrameworkSettings.USE_FACEBOOK) {
     Log.v("FACEBOOK", name);
     Log.v("FACEBOOK", link);
     Log.v("FACEBOOK", description);
     Log.v("FACEBOOK", caption);
     Log.v("FACEBOOK", imagePath);
     facebook.Share(name, link, description, caption, imagePath);
   }
 }
 public static void SetGAScreenName(final String screenName) {
   if (SonarFrameworkSettings.USE_GOOGLE_ANALYTICS) {
     googleAnalytics.SetGAScreenName(screenName);
   }
 }
 // Vungle Functions
 public static void ShowRewardedVideoAdV(boolean isIncentivised) {
   if (SonarFrameworkSettings.USE_VUNGLE) {
     vungle.ShowVideoAd(isIncentivised);
   }
 }
 // Adcolony Functions
 public static void ShowRewardedVideoAdAC() {
   if (SonarFrameworkSettings.USE_ADCOLONY) {
     adcolony.ShowVideoAd();
   }
 }
 public static void ShowFullscreenAdMP() {
   if (SonarFrameworkSettings.USE_MOPUB) {
     mopub.ShowFullscreenAd();
   }
 }
 public static void ShowPopUpAd() {
   if (SonarFrameworkSettings.USE_REVMOB) {
     revmob.ShowPopUpAd();
   }
 }
 public static void SendLogEvent(String eventId) {
   if (SonarFrameworkSettings.USE_FLURRY_ANALYTICS) {
     flurry.SendLogEvent(eventId);
   }
 }
 public static void ShowPreLoadedFullscreenAdAM() {
   if (SonarFrameworkSettings.USE_ADMOB) {
     admob.ShowPreLoadedFullscreenAd();
   }
 }
 public static void unlockAchievementAmazon(final String achievementID) {
   if (SonarFrameworkSettings.USE_AMAZON_GAMECIRCLES) {
     amazongameCircle.unlockAchievementAmazon(achievementID);
   }
 }
 // Twitter Functions
 public static void TwitterTweet(final String tweet, final String title) {
   if (SonarFrameworkSettings.USE_TWITTER) {
     twitter.TwitterTweet(tweet, title);
   }
 }
 // Facebook Functions
 public static void FacebookSignIn() {
   if (SonarFrameworkSettings.USE_FACEBOOK) {
     facebook.FacebookSignIn();
   }
 }
 public static void SetGADispatchInterval(int dispatchInterval) {
   if (SonarFrameworkSettings.USE_GOOGLE_ANALYTICS) {
     googleAnalytics.SetGADispatchInterval(dispatchInterval);
   }
 }
 public static void PreLoadFullscreenAdCB() {
   if (SonarFrameworkSettings.USE_CHARTBOOST) {
     chartboost.PreLoadFullscreenAd();
   }
 }
 public static void SendGAEvent(
     final String category, final String action, final String label, long value) {
   if (SonarFrameworkSettings.USE_GOOGLE_ANALYTICS) {
     googleAnalytics.SendGAEvent(category, action, label, value);
   }
 }
 public static void ShowVideoAdCB() {
   if (SonarFrameworkSettings.USE_CHARTBOOST) {
     chartboost.ShowVideoAd();
   }
 }
 public static void EndTimeLogEvent(final String eventId) {
   if (SonarFrameworkSettings.USE_FLURRY_ANALYTICS) {
     flurry.EndTimeLogEvent(eventId);
   }
 }
 public static void HideBannerAdMP() {
   if (SonarFrameworkSettings.USE_MOPUB) {
     mopub.HideBannerAd();
   }
 }
 public static void HideBannerAd(int position) {
   if (SonarFrameworkSettings.USE_ADMOB) {
     admob.HideBannerAd(position);
   }
 }
 // Revmob Functions
 public static void ShowFullscreenAd() {
   if (SonarFrameworkSettings.USE_REVMOB) {
     revmob.ShowFullscreenAd();
   }
 }