Android SDK Advanced Configuration Options

Android SDK Advanced Configuration Options

Android SDK Advanced Configuration Options

Changing Settings

The SDK is configurable. This page describes some changes to the behaviour of the SDK.

API key

Sets the API. Calling this method is obligatory for custom conifguration. There is no default value. The API tells the SDK to which Applause App bugs, crashes, logs and feedback will be sent.

For API key represented by String value

IBuilder withAPIKey(String key);

The API key can also be represented by a resource id

IBuilder withAPIKey(int resId);

Mode

With Applause SDK you can pick the following two modes:

  • QA Mode (Mode.QA): Use this mode to fully activate the Mobile SDK for your testing. When testers start your app, they will be presented with a login screen so that the Applause SDK can associate their bugs with their Applause SDK accounts. Full details about the app and device state are sent with logs, sessions, bug reports, and crash reports. This mode is the default, and in most cases, you should choose this mode
  • Market Mode (Mode.MARKET): This mode hides the Applause SDK from the user. They will not be able to login to the Applause SDK server or report bugs from the app.

The default mode is Mode.QA.

IBuilder withMode(Applause.Mode mode);

Report On Shake

The default is true. Specifies whether to report bugs by shaking the device.

IBuilder withReportOnShakeEnabled(boolean shakeEnabled);

Applause Integration (Enable Feedback)

The default value is false. Activate Applause’s integration with uTest. Set this to false if you are not an Applause customer and you’re not using Applause SDK with the Applause community. NOTE: This also enables/disables theFeedback button in the SDK UI. If you want to collect user feedback in addition to bugs, this flag should be set tofalse. Feedback will be available within the SDK platform’s control panel ([sdk.applause.com]).

IBuilder withUTestEnabled(boolean withUTest);

Customize Notifications shown in your app

The default value is ‘true’. If this is set to false, the only method to report bugs will be the shake gesture. It will also had the ‘logged in’ notification.

IBuilder withNotificationsEnabled(boolean notificationsEnabled);

Server URL

The default server is https://sdk.applause.com. If you are using the SDK in conjunction with an on-premise installation then you will have to override this to ensure your applause traffic goes to the right server.

IBuilder withServerURL(String serverURL);

Set default user

Specify the default user. For password authentication the login field will be filled with this e-mail address. In case of the quick authentication the SDK will use this e-mail automatically if the user is present in the white list.

Placing anonymous@apphance.com as an argument will trigger the login automatically. No login dialog will be displayed

There is no default value.

IBuilder withDefaultUser(String defaultUser);

Build the configuration

Please remember to call

Configuration build();

method on builder object before passing the custom configuration to Applause SDK.

How to start new session with custom configuration

The startNewSession method instead of API_KEY acceppts the custom configuration.

import com.applause.android.Applause;
import com.applause.android.config.Configuration;

public class MyApplication extends Application {
    @Override
    public void onCreate() {
        super.onCreate();
        Configuration.Builder builder = new Configuration.Builder(this);
        builder.withAPIKey("MY_API_KEY");
        builder.withMode(Applause.Mode.QA);
        builder.withReportOnShakeEnabled(true);
        builder.withServerURL("https://sdk.applause.com");
        builder.withDefaultUser("johnsmith@sample.mail");
        builder.withNotificationsEnabled(false);

        //start the applause session with the configuration above
        Applause.startNewSession(this, builder.build());
    }
}