Application Class Implementation

First, let us look into the source file of the Application class,

This class initializes the Kii Cloud SDK as follows. You have set APP_ID, APP_KEY, and APP_SITE_CLOUD in an earlier step in building the mobile app.

public static final String APP_ID = "11111111";
public static final String APP_KEY = "22222222222222222222222222222222";
public static final Kii.Site APP_SITE_CLOUD = Kii.Site.JP;

public void onCreate() {

  // initialize the Kii SDK!
  Kii.initialize(getApplicationContext(), APP_ID, APP_KEY, APP_SITE_CLOUD, true);

Kii.initialize is the SDK initialization method. The method has three application related parameters: AppID, AppKey, and server location.

You need to initialize both the Thing-IF SDK and the Kii Cloud SDK in order to use the Thing-IF SDK. The sample app initializes the Thing-IF SDK with PromiseAPIWrapper. The initialization process will be described in detail in Login Screen Implementation. As with the Kii Cloud SDK, specify the AppID and server location. You can set an arbitrary value for the AppKey.

There are many applications created by numerous developers on Kii Cloud. To distinguish the application, Kii Cloud uses two strings: AppID and AppKey. These values are generated when you create your application on the developer portal.

As illustrated in the figure below, the initialization process of the mobile app sets the AppID. By setting the same AppID, you can share application data and users across multiple platforms; in the figure, the Android and iOS applications share the same application data and users by using the same AppID 1111.


It is not possible to attack your application by exploiting its AppID. If a malicious user obtains your application's ClientID and ClientSecret, however, they will be able to access all of your application data as the app administrator. The ClientID and ClientSecret, therefore, need to be secured just like the login password of the developer portal.

When you are sending a question to Kii support team, you only need to provide the AppID and server location.

What's Next?

To get started with the implementation of your mobile app, let us walk through how to achieve screen transition with fragments. In the next topic, we will review how to implement fragments in general.

Go to Screen Transition with Fragments.

If you want to learn more...

  • See the steps described in Initializing and Onboarding if you implement the initialization process from scratch.
  • See Security for more information about security. The topic explains why any third party cannot attack applications on Kii Cloud even if they know the AppID.