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 TradeItLinkedBrokerAccount
objects managed by the TradeItLinkedBrokerManager
instance on the TradeItSDK
:
TradeItLinkedBrokerManager linkedBrokerManager = TradeItSDK.getLinkedBrokerManager();