Skip to content

Configuring the SDK

guillaumedebavelaere edited this page Oct 16, 2017 · 4 revisions

Configuring the SDK

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