Skip to content

Configuring the SDK

alex [dot] kramer [at] g_m_a_i_l [dot] com edited this page Aug 3, 2018 · 4 revisions

Add the following dependency to your project:

compile 'it.trade.tradeit:tradeit-android-sdk:1.X.X'

(Find the latest version here)

To use the SDK you will first need to call it's configuration method. You will also need to obtain an API key from https://trade.it or test with "tradeit-test-api-key".

Example in the onCreate method of your main application:

public class MainActivity extends AppCompatActivity {
    ...
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        ...
        TradeItConfigurationBuilder configurationBuilder = new TradeItConfigurationBuilder(
            this.getApplicationContext(),
            "tradeit-test-api-key",
            TradeItEnvironment.LOCAL
        );

        TradeItSDK.configure(configurationBuilder);
        ...
    }
    ...

Interacting with the TradeIt API is done via TradeItLinkedBroker and TradeItLinkedBrokerAccountobjects managed by the TradeItLinkedBrokerManager instance on the TradeItSDK:

TradeItLinkedBrokerManager linkedBrokerManager = TradeItSDK.getLinkedBrokerManager();
Clone this wiki locally