Skip to content

Methods

Calling Methods

All methods are static, so you can call each one by using the GooConsole.

Initializing The application

Must be called in the main activity of an application if you don't use the Default login activity.

public static void initMainActivity(Activity activity)

Protecting your app

Return true if the current user is a Google robot or a Google Review Agent

public static boolean isEnemy()

If you must show user an Override message when the packagename is different from the one declared on the application listing (for example if you have published a new app and you want all user to install the new app instead of the current one).

public static boolean isOverride()

App workflow

Run the app workflow

public static void appWorkflow(Activity activity)

Event Mangement

Post an object to registred events

public static void post(Object object)

Register an event

public static void registerEvent(Object object)

Unregister an event

public static void unregisterEvent(Object object)

Accessing and leaving the application

End current session application, after calling this method, the application data will be synchronized with the server

public static void endSession(Activity activity)

public static void destroy()

Application information

Return the application ID

public static int appId()

Accessing and saving data

Return a boolean value saved in the Pref

public static boolean getBoolean(String valueName, boolean defalut)

Return a boolean value saved in pref or from Metadata

public static boolean is(String valueName)

Save a Boolean value to pref

public static void saveBoolean(String valueName, boolean value)

Activate a boolean value with name valueName (true)

public static void on(String valueName)

Deactivate a boolean value with name valueName (false)

public static void off(String valueName)

Increment a data with 1

public static void increment(String valueName)

Decrement a data with 1

public static void decrement(String valueName)

With this methods, you can save and get data From a predeclared Pref

public static int getInt(String valueName)

public static void saveInt(String valueName, int value)

public static String getString(String valueName)

public static void saveString(String valueName, String value)

public static long getLong(String valueName)

public static void saveLong(String valueName, long value)

public static float getFloat(String valueName)

public static void saveFloat(String valueName, float value)

public static void addToList(String valueName, String value)

public static void removeFromList(String valueName, String value)

public static void addToSet(String valueName, String value)

public static List<String> getList(String valueName)

Application Metadata

Get Metadata Info for the current application

public static String getMetadata(String key)

public static String getMetadata(String key, String defaultValue)

public static long getMetadata(String key, long defaultValue)

Application Mobile Info

Get current mobie info (Sim Info, Operator Info, device Info)

public static MobileFactoryInfo getMobileInfo()

Get device Sim country

public static String getCountry()

Get device network country

public static String getNetworkCountry()

Facebook

Get current user Facebook Profile

public static UserProfile getFacebookProfile()

Return :

    firstName
    lastName
    gender
    birthDay
    location
    picture
    email

Sharing

Share the current running app on the apps that allows sharing. Share a message text with the link configured on the app listing

public static void shareCurrentApp(Activity activity)

Share a text

public static void shareText(Activity activity, String textToShare)

Share a text and show options to user (default share and copy to clipboard)

public static void shareTextOption(Activity activity, String textToShare)

Analytics

Send logs to Facebook

public static void facebookLogEvent(String log)

To track the action you want to send

//for google analytics tracking
public static void track(String event)

//For all tracking services
public static void trackAll(String event)

/**
 * To track the exception you want to pass
 *
 * @param exp Exception and if error is fatal
 */
public static void exception(Exception exp, boolean fatal)

/**
 * To track the event you want to pass
 *
 * @param category Exception and if error is fatal
 */
public static void event(String category, String action)

public static void event(String category, String action, long value, String label)

Gaming

Notify the game server that the game is over, so The app will synchronize state with the server

public static void gameOver()

Reset game data of the current User

public static void resetGame()

Ads

The values required for calling each function

  • showRewardedUsNormalAd : If you want to call it directly and control all behaviors, set the isDirect to true.
  • ViewGroup : The view where you want to insert the banner.

The following image shows you the different sizes of Ads Banner:

GoConsole Size Ads Banner!

  • Position : The order where you want to insert the banner in the specified ViewGroup. The first one is the index 0;

  • The GoRewardListener has two methods :

    onRewarded(int rewardItem) : With the rewarded value. onRewardedFailed(int arg)

Return true if ads activated on the application

public static boolean isAdsOn()

Test if the ads are activated or not in the application.

public static boolean showAds()

Rewarded videos

Different calls :

public static void rewardedVideoAds(Activity activity, boolean showRewardedUsNormalAd, GoRewardListener rewardListener)

public static void rewardedVideoAds(Activity activity, boolean showRewardedUsNormalAd, String zone, GoRewardListener rewardListener)

Show an interstitial from the selected networks

Different calls :

public static void interstitial(Activity activity)

public static void interstitial(Activity activity, String zone)

Banners

public static void banner(final Activity activity, final ViewGroup viewGroup)

public static void banner(final Activity activity, final ViewGroup viewGroup, final int position)

public static void banner(final Activity activity, final ViewGroup viewGroup, String zone)

public static void banner(final Activity activity, final ViewGroup viewGroup, final int position, String zone)

Mailing

Show a random mailform window :

public static void mailform(Activity activity)

Show a specific mailform window by id :

public static void mailform(Activity activity, int id)

Show an interstitial for a random mailform :

public static void mailformInterstitial(Activity activity)

Show an interstitial for a specific mailform by id :

public static void mailformInterstitial(Activity activity, int id)

To subscribe a user when getting mail and name using other form or other source

public static void subscribeToML(String name, String email)

Applications

Get the list of the applications :

public static List<goo.console.services.models.Application> applicationsList()

Show a Random application :

public static void appInterstitial(Activity activity)

Show the specifed application by appId :

public static void appInterstitial(Activity activity, int appId)

Show the appList Screen :

public static void appsList(Activity activity)

Show the Interstitial app list

public static void appsListInterstitial(Activity activity)

Show a banner cube with the applications (Row : number of the application in row, col number of column) :

public static void appsCube(final Activity activity, final ViewGroup viewGroup, final int position, final int row, final int col)

Get text and share current application :

public static String currentAppLink(Activity activity)

Rewarding

Is a rewarded application :

public static boolean isRewordApp()

Show the global reward board by name : With home ads (cpa offers, application list, Ads ...) :

public static void rewardedboard(Activity activity, String rewardedName)

Show the global random reward board or the default one : With home ads (cpa offers, application list, Ads ...) :

public static void rewardedboard(Activity activity)

News

public static void news(Activity activity)

public static void newsInterstitial(Activity activity)

Show Message form

public static void messageForm(Activity activity)

public static void exit(Activity activity)

Show Facebook page

public static void facebookPage(Activity activity)

Open Google play app listing

public static void ratePage(Activity activity)

public static void rateDialog(Activity activity)

Open Google play Dev Page

public static void playDevPage(Activity activity)

Open website

public static void website(Activity activity)

public static void website(Activity activity, String url)

Show app guide

public static void showDialogGuide(Activity activity, Class pClass)

public static void showVideoGuide(Activity activity, boolean directAccess, String id)

public static void showVideoGuide(Activity activity, String id)

Application Intro

public static void showAppIntro(Activity activity, List<AppIntroElement> listAppIntroElement, boolean directAccess)

public static void showAppIntro(Activity activity, List<AppIntroElement> listAppIntroElement, boolean directAccess, int backgroundColor)

public static void showAppIntro(Activity activity, List<AppIntroElement> listAppIntroElement, boolean directAccess, int backgroundColor, boolean useAds)

public static void showAppIntro(Activity activity, List<AppIntroElement> listAppIntroElement, boolean directAccess, int backgroundColor, boolean useAds, boolean cancelable)

Show override dialog

public static void override(Activity activity)

Shopping

Show buy interstitial for a single product by id :

public static void buySingleProduct(Activity activity, int productId, String shortDescription, String detail)

Show random product from products list :

public static void showRandomProduct(Activity activity)

Show product listing for a product by id :

public static void showProduct(Activity activity, int productId)

Show checkout interstitial :

public static void checkoutAll(Activity activity, String shortDescription, String detail)

Show checkout interstitial for only product :

public static void checkoutStore(Activity activity, String shortDescription, String detail)

Show checkout interstitial for only app features :

public static void checkoutProVersion(Activity activity, String shortDescription, String detail)

Show list of app features to buy :

public static void proVersion(Activity activity)

Show current user purchased features :

public static void myProVersion(Activity activity)

Show store interstitial for all products :

public static void store(Activity activity)

Show coins/points store :

public static void solde(Activity activity)

Show interstitial to remove Ads from app :

public static void removeAds(Activity activity)

Show interstitial for support dev :

public static void supportUs(Activity activity)

Show shopping cart :

public static void cart(Activity activity)

Show user orders :

public static void orders(Activity activity)

Site and policies

public static void zoomIt(Activity activity, String type, String value)

public static void privacyPolicy(Activity activity)

public static void webview(Activity activity, String url)

User Account managment

The user logged in the plication by using Facebook :

public static boolean isLoggedToFacebook()

The user logged in application by using Google :

public static boolean isLoggedToGoogle()

The user logged in application by using either Facebook, Google or Email :

public static boolean isLoggedTo()

Logout from the application with the default system :

public static void logOut()

The user logged in application by using Email :

public static boolean isLoggedByEmail()

Show the facebook login screen :

public static void facebookLogin(Activity activity)

Show the account page : with facebook, google, and mail login option :

public static void account(Activity activity)

Show the register Form :

public static void registerForm(Activity activity)

public static void manageNotification(Activity activity)

public static void load(Activity activity, int time, String message)

Tools

Get an image by using url and put it on the cache :

public static void getImage(String url, ImageView imageView)

Open an url by using default browser :

public static void openUrl(Activity activity, String url)

Open an application by using its class instantiation :

public static void openAppLink(Activity activity, goo.console.services.models.Application application)

Open app store listing using packagename

public static void openAppURL(Activity activity, String pacakgeName)

Test if the device is connected to the internet

public static boolean isConnected(Activity activity)

Return true of the current user has already installed the app with the given packagename

public static boolean appInstalled(Activity activity, String packageName)

Gaming : Manage coins and points

  • rewardedName : The name of point/coin, this will be saved in the default list.
  • value : Point/Coin that you want to add or remove from the user solde.
  • TopDownListener : It has one method to be implemented public void onTopDown(boolean state, long solde). state : True for a success operation. solde : New user solde.
  • source : To know where the user earn or lose points/coins.
  • objectName : If you want to create a new collection to save user points/coins.
  • subElement : Name of sub collection, so every objectName can contain multiple subElement.
  • syncho : If it is true, the data will be synchronised immediately with the server.

Methods:

Remove points/coins

    public static void topDown(String rewardedName, long value, TopDownListener listener)

    public static void topDown(String rewardedName, long value, String source, TopDownListener listener)

    public static void topDown(String rewardedName, long value, String source, boolean synchro, TopDownListener listener)

    public static void topDown(String objectName, String subElement, String rewardedName, long value, TopDownListener listener)

    public static void topDown(String objectName, String subElement, String rewardedName, long value, String source, TopDownListener listener)

    public static void topDown(String rewardedName, long value, boolean syncho, TopDownListener listener)

    public static void topDown(String rewardedName, long value, boolean syncho, String source, TopDownListener listener)

    public static void topDown(String objectName, String subElement, String rewardedName, long value, boolean syncho, TopDownListener listener)

    public static void topDown(String objectName, String subElement, String rewardedName, long value, String source, boolean syncho, TopDownListener listener)

Add points/coins

    public static void topUp(String rewardedName, long value, TopUpListener listener)

    public static void topUp(String objectName, String subElement, String rewardedName, long value, TopUpListener listener)

    public static void topUp(String rewardedName, long value, boolean syncho, TopUpListener listener)

    public static void topUp(String objectName, String subElement, String rewardedName, long value, boolean syncho, TopUpListener listener)

    public static void topUp(String rewardedName, long value, String source, TopUpListener listener)

    public static void topUp(String objectName, String subElement, String rewardedName, long value, String source, TopUpListener listener)

    public static void topUp(String rewardedName, long value, String source, boolean syncho, TopUpListener listener)

    public static void topUp(String objectName, String subElement, String rewardedName, long value, String source, boolean syncho, TopUpListener listener)

Save custom info for the current user

    public static void saveCustomInfo(String objectName, String subElement, String infoName, String infoValue, String source, boolean synchro)

    public static void savePlayerInfo(String subElement, String infoName, String infoValue, String source, boolean synchro)

Get user solde amount for the value name

    public static long soldeValue(String rewardedName)

Get user points amount for the value name

    public static long pointValue(String pointName)

Add point to user

    public static void increasePoint(String pointName, long value)

    public static void increasePoint(String pointName, long value, String source)

Remove point from user

    public static void decreasePoint(String pointName, long value)

    public static void decreasePoint(String pointName, long value, String source)

Display solde zone to the giving view

    public static void soldeZone(Activity activity, LinearLayout view)

Show the default leaderborad interstitial

    public static void leaderboard(Activity activity)

Show the giving scoreName leaderborad interstitial

    public static void leaderboard(Activity activity, String scoreName)

Show a No enough points/coins Dialog for the giving rewardedName

    public static void NotEnoughMessage(Activity activity, String rewardedName, long soldeNeeded)

Sweet Alert Dialog

  • alertType : SweetAlertDialog.NORMAL_TYPE, SweetAlertDialog.ERROR_TYPE, SweetAlertDialog.SUCCESS_TYPE, SweetAlertDialog.WARNING_TYPE
  • title : Title for the dialog, maybe string or resource id.
  • message : Message to show on dialog, maybe string or resource id.
  • button : Button text to show on dialog button, maybe string or resource id.
  • showBannerAds : Show banner ad on the dialog or not.

Methods

public static void sweetAlertDialog(final Activity activity, int alertType, String title, String message, String button)

public static void sweetAlertDialog(final Activity activity, int alertType, int title, int message, int button)

public static void sweetAlertDialogWithAds(final Activity activity, int alertType, String title, String message, String button)

public static void sweetAlertDialogWithAds(final Activity activity, int alertType, int title, int message, int button)

public static void sweetAlertDialog(final Activity activity, int alertType, String title, String message, String button, boolean showBannerAds)

public static void sweetAlertDialog(final Activity activity, int alertType, int title, int message, int button, boolean showBannerAds)

public static void sweetAlertDialogWithAds(final Activity activity, int alertType, String title, String message, String button, boolean showBannerAds)

public static void sweetAlertDialogWithAds(final Activity activity, int alertType, int title, int message, int button, boolean showBannerAds)

Giveaway System

public static void dailyGiveAway(final Activity activity)

public static void dailyGiveAway(final Activity activity, boolean direct)

Sharing options

Sharing with friends and get rewarded

public static void shareWithFriend(Activity activity)

public static void shareWithFriend(Activity activity, int icon)

public static void validateInvitation(Activity activity, boolean ads, String rewardName)

public static void validateInvitation(Activity activity, boolean ads)

Daily giveaway

public static void dailyRewardForTime(Activity activity, LinearLayout zone, String rewardTitle, final String rewardName)

public static void dailyRewardForTime(Activity activity, LinearLayout zone)

Creating menu

public static void createMenu(Activity activity, DrawerLayout drawer, Menu menu, List<CustomMenuItem> customMenuItems)

public static void createFloatingMenu(Activity activity, FloatingActionMenu viewById)

Gift program

public static View gifProgramLayout(LayoutInflater inflater, ViewGroup container, Activity activity)

public static String giftProgramPointValue()

public static String giftProgramFriendlyPointName()

public static String giftProgramPointName()

public static long giftProgramPointDefaultValue()

public static void giftProgram(Activity activity)

public static boolean isGiftProgram()

public static boolean isDailyGiveaway()

public static String parseTime(Activity activity, long time)

Pollfish

public static void showPollfish(int source)

Included apps

public static void runMathGame(Activity activity, boolean accessMainApp)

public static void runMathGame(Activity activity)

Games

Run the wheel game :

public static void playWheel(Activity activity)

public static void playWheel(final Activity activity, String title, final String soldeName, final String soldeTitle)

Read a string from resources

public static String readString(int id)

public static String getString(Activity activity, int id)

public static String getString(Activity activity, int id, Object... formatArgs)

Save info to a collection by using a key value list

public static void addInfo(String collection, String key, String value)

public static String getInfo(String collection, String key)

public static Map<String, String> getInfo(String collection)

Get country name by using country code

public static String countryName(String key)

Get Country code by using country name

public static String countryCode(String key)

Get list of countries

public static List<String> listCountry()

Get array of countries

public static String[] arrayCountry()

Copy text to clipboard

public static boolean copyToClip(Activity activity, String text)

Add the Global background with no transparance effect

public static void addGlobalBackgroundNoTransparance(Activity activity, View view)

Add the Global background with transparance

public static void addGlobalBackground(Activity activity, View view)

Add header image to the application

public static void headerImage(ImageView headerImage)

Find number of element of the value name. The values can be :

- GooConsole.GOOCONSOLE_PRODUCT_PRPOFEATURE
- GooConsole.GOOCONSOLE_PRODUCT_SHOPPING
- GooConsole.GOOCONSOLE_PRODUCT_POINTS
- GooConsole.GOOCONSOLE_PRODUCT_SHOPPING_CART
- GooConsole.GOOCONSOLE_PRODUCT_SHOPPING_ORDERS
- GooConsole.GOOCONSOLE_PRODUCT_PRPOFEATURE_ORDERS

public static String howMuch(String value)

Open terms and conditions page

public static void termsAndConditions(Activity activity)

Open about page

public static void aboutPage(Activity activity)

Get Hash key for the current app

public static String appKeyHash(Activity activity)

Create a notification that will be display every : time (milliseconds)

public static void addNotificationReminder(int uniqueId, String title, String body, int time)

Return a unique client ID for the current user

public static String ClientId()

If the user was referred by another user

public static boolean confirmRef()