The BellaDati Java SDK is an easy-to-use implementation to access the REST API using Java. All data is made available in Java objects, eliminating the need to manually parse and interpret JSON responses from the server.
Setting up the SDK
The SDK consists of two parts:
- an API jar file containing the SDK's interface declarations
- an implementation jar file containing an implementation of this interface
When using the SDK, the versions of both jars need to match. Currently, BellaDati provides two SDK implementations, for use in a regular Java VM environment and for use with Android.
Dependencies
Dependencies for the SDK depend on the implementation you are planning to use:
Regular Java VM
- Jackson 2.2.x core, annotations and databind libraries
- Signpost 1.2.x core and Commons HTTP implementation
- Apache HttpClient 4.3.x and its dependencies (jars fluent-hc and httpmime are not needed)
Android
- Jackson 2.2.x core, annotations and databind libraries
- Signpost 1.2.x core
- Re-packaged Apache HttpClient for Android provided by BellaDati
Server Setup
In order to access data from BellaDati, you need to enable API access in your domain. To do so, open your domain settings and click Configure under OAuth Settings.
In this dialog, enter a consumer key and consumer secret. These will be used during authentication in the SDK. You can optionally set a callback URL that will be opened when a user successfully authorizes an OAuth request - more on that in the example below. Finally, if your application environment doesn't allow using a web browser for authentication, you can enable xAuth to authenticate with username and password from within your client application.