Android Guide

Kii Cloud provides developers with a set of tools to support Android application development. Our Android SDK gives you the opportunity to develop applications without ever needing your own servers.

This guide will navigate you through the SDK's basic features.  You can review what is possible with the Kii SDK, and even get a head start with some sample code snippets.  After reviewing the guide, you'll be ready to dig into our SDK or check the detailed documentation available here.

A reminder when reading the guides...

Exception Handling

In the guides, we provide sample code snippets in order to illustrate how you can leverage our SDKs. In these code snippets, the exception handling is usually simplified. For example, we only cover abstract exceptions - namely IOException and AppException - when we present how to register a user. Here is the example code snippet used in the guide:

try {
    user.register(password);
} catch (IOException e) {
    // Please check IOExecption to see what went wrong...
} catch (AppException e) {
    // Please check AppException to see what went wrong...
}

Kii SDK actually provides more specific exceptions for better debugging when something goes wrong. Using the above example as a reference, it will throw more specific exceptions like BadRequestException and ConflictException. If you prefer, your application may want to catch the specialized exceptions individually in order to properly handle the various error cases. Check the following example:

try {
    user.register(password);
} catch (BadRequestException e) {
    // Registration failed because username / password
    // have invalid format
} catch (ConflictException e) {
    // Registration failed because the user already exists
} catch (AppException e) {
    // Other exceptions in App layer
} catch (IOException e) {
    // Error occurred in Network layer
}

For more information on the exceptions thrown by each API call, please refer to the detailed documentation.

Blocking vs. Non-Blocking API

Many of our SDK methods, such as registering a new user and uploading data, require network communication with the Kii Cloud. Kii SDK provides both blocking and non-blocking versions for these methods. Please read Network Access for the overview.

In the guides, we generally provide sample code snippets for both non-blocking and blocking APIs.