The Android Apstrata SDK is a utility that is provided to developers of Android-based applications. The Android Apstrata SDK wraps the Apstrata REST APIs making it very easy to call these latter from within Android-Java code.
All you need to do is to:
- Drop the client library into you code,
- Create an instance of "ApstrataClientAndroid" passing it the URL of the Apstrata server, the key and secret of the Apstrata account you are using and the expected authentication mode (more on authentication with Apstrata).
- Call one of the methods exposed by the Android client.
Click here to download the Android Apstrata SDK source code. The source code ships with a test application. Note that you need to install the Android SDK.
Click here to download the Android Apstrata SDK jar file and required complementary libraries.
The Android Apstrata Client provides the following methods:
| Method | Description | Parameters | Returned value |
|---|---|---|---|
| callAPI | Invokes an Apstrata api by specifying the api name and parameter. This is the generic serving all-purposes method of the Android client. |
Optionally, you can specify the expected format of the response (XML - default, or JSON) by sending it along the parameters (RESPONSE_TYPE_PARAM = RESPONSE_TYPE_XML or RESPONSE_TYPE_JSON) | A string representing the response sent by the API |
| callAPIJson | Similar to the above except that it returns the response in JSON format | Same as above. You do not need to specify the expected returned format of the response. | A string representing the response sent by the API, in JSON format |
| callAPIXml | Similar to the above except that it returns the response in XML format | Same as above. You do not need to specify the expected returned format of the response. | A string representing the response sent by the API, in XML format |
| callAPIStream | Invokes an Apstrata api. This method is used typically to request apstrata file attachments |
| An input stream that returns the data sent by Apstrata in response to the call |
| callAPIFile | Similar to "callAPIStream" but returns a File handle instead of a stream. |
| A handle (File) to the destination file, where the content is stored |
| getSignedRequestUrl | Use this method to retrieve the URL to a file that is uploaded to an Apstrata Store. This is useful for example when using the URL as a link of a page. |
|
Labels: