Dash Stats Docs

AppBrain

public class AppBrain

Entry point to the AppBrain SDK. For any method you call, init(Context) always needs to be called first. It’s strongly advised to put this in the onCreate() of all your Activities, or of your Application object if you have one. If you put this in your Activities’ onCreate(), don’t forget to also check your Services and BroadcastReceivers for potential other entry points into your app. Otherwise you can call init(Context) right before any other calls to the SDK, but in that case you won’t get an accurate number of active users, and loading of remote settings will be less frequent.

Author:AppBrain

See also: AppBrain monetization

Methods

public static void addTestDevice(String deviceId)

Put a device in test mode. In test mode random cloud alerts will be shown.

Parameters:
  • deviceId – Your device ID, which can be found in the logcat output after calling init(Context) when debugging on your device.
public static AdService getAds()

Get an AdService implementation, which allows you to show AppBrain Promoted Apps. init(Context) needs to be called before this method!

Returns:An AdService implementation
public static AdvertiserService getAdvertiserService()

Gets an AdvertiserService implementation, which allows you to send conversion events to AppBrain. init(Context) needs to be called before this method!

Returns:An AdvertiserService implementation
public static RemoteSettings getSettings()

Get the values that were set on the server. init(Context) needs to be called before this method!

Returns:An object containing all values that were set on the server.
public static void init(Context context)

Initialize the AppBrain SDK. This method is best called in the onCreate() of any Activity where AppBrain is used.

Parameters:
  • context – The Activity context.
public static void initApp(Context context)

Initialize the AppBrain SDK. This method is especially meant for your android.app.Application.onCreate(). Because it’s not called from an Activity, the analytics will not count this user as active in your app (because the Application can be started because of a broadcast receiver or service for instance.

Parameters:
  • context – The context of the Android app.