Android SDK for the Kloudless API
Requirements:
- AndroidStudio 2.3.3 or equivalent
- You need to have registered as a Kloudless app at https://developers.kloudless.com. You should have an App key and API Key.
Note: The SDK is designed to work with Java 1.8 or above.
- Open the project KTester in Android Studio
- Fill in the values for fileId and linkId
- Build and Run the MainActivity.java
- Once running, you can test the functionalities of the API without errors.
- The example app uses android.support.customtabs.CustomTabsIntent to handle the OAuth 2.0 flow to Kloudless and stores the access token and account id at Kloudless.bearerToken and Kloudless.accountId.
- To authorize users without the example app, first register a Redirect URI
scheme in the Kloudless developer portal
App Detailspage (e.g. ktester://kloudless/callback). - Add an Intent Filter to the AndroidManifest.xml that matches the Redirect
URI scheme (e.g.
<data android:scheme="ktester" android:host="kloudless" />) - Modify the
redirect_urivariable to match. (we use the package suffix) - Initialize your own CustomTabsIntent Builder and launch the authorization url with your own button action.
- Make an API call to verify the access token returned by the Intent filter and retrieve the account ID.
- You can now successfully make requests to the Kloudless API with the bearer token and account ID.
Note: You will need to add com.android.support:customtabs:23.2.0 to your
module's build.gradle file and add the android.permission.INTERNET to your
AndroidManifest.xml file.
- Verify that Maven is a valid repository in your Project's build.gradle
- Add
com.kloudless:kloudless-java:1.0.3to your module's build.gradle file. - Under
compileOptionsverifysourceCompatibilityandtargetCompatibilityasJavaVersion.VERSION_1_8. - Under
packagingOptionsexcludeMETA-INF/LICENSE - Now you can import
com.kloudless.Kloudlessto any file!
See the Kloudless API Docs for the official documentation.
You can obtain an App ID at the Developer Portal.
Step 1. Click the Link Account button to connect an account.
Step 2. Click the additional buttons to test Kloudless API requests.
To make your own requests with the Java SDK you will need to create an AsyncTask as seen in MainActivity.java.
To authenticate with your own Application ID or Client ID please follow the steps in Authorizing Users without the example app.
- 2017/07 - updated SDK to use CustomTabsIntent removed AuthActivity
- 2016/08 - updated SDK to Kloudless v1
- 2014/10 - updated SDK with new methods, modified AuthActivity
- 2014/04 - added initial Example project
- more tests
- add multiple account id / access token management
- add additional examples