Android Open Source - sami-android-demo Sami Hub






From Project

Back to project page sami-android-demo.

License

The source code is released under:

Apache License

If you think the Android project sami-android-demo listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package io.samsungsami.android;
//  ww w .  j ava 2 s .  c o  m
import io.samsungsami.api.DevicesApi;
import io.samsungsami.api.DeviceTypesApi;
import io.samsungsami.api.MessagesApi;
import io.samsungsami.api.UsersApi;

public class SamiHub {

  /**
   * Returns authenticated Swagger API for users
   * @param url
   * @param token
   * @return
   */
    public static UsersApi getUsersApi (String url, String token){
        UsersApi api = new UsersApi();
        api.setBasePath(url);
        api.getInvoker().addDefaultHeader("Authorization", "bearer "+token);
        return api;
    }

    /**
     * Returns authenticated Swagger API for devices
     * @param url
     * @param token
     * @return
     */
    public static DevicesApi getDevicesApi (String url, String token){
        DevicesApi api = new DevicesApi();
        api.setBasePath(url);
        api.getInvoker().addDefaultHeader("Authorization", "bearer "+token);
        return api;
    }

    /**
     * Returns authenticated Swagger API for device types
     * @param url
     * @param token
     * @return
     */
    public static DeviceTypesApi getDevicetypesApi (String url, String token){
        DeviceTypesApi api = new DeviceTypesApi();
        api.setBasePath(url);
        api.getInvoker().addDefaultHeader("Authorization", "bearer "+token);
        return api;
    }

    /**
     * Returns authenticated Swagger API for messages
     * @param url
     * @param token
     * @return
     */
    public static MessagesApi getMessagesApi (String url, String token){
        MessagesApi api = new MessagesApi();
        api.setBasePath(url);
        api.getInvoker().addDefaultHeader("Authorization", "bearer "+token);
        return api;
    }

}




Java Source Code List

io.samsungsami.android.AccountsActivity.java
io.samsungsami.android.AccountsWebClient.java
io.samsungsami.android.AccountsWebView.java
io.samsungsami.android.Credentials.java
io.samsungsami.android.SamiClient.java
io.samsungsami.android.SamiHub.java
io.samsungsami.android.SamiStack.java
io.samsungsami.android.Sami.java
io.samsungsami.android.api.Call.java
io.samsungsami.android.api.Callback.java
io.samsungsami.android.api.Cast.java
io.samsungsami.android.api.Code.java
io.samsungsami.android.api.Task.java
io.samsungsami.androidclient.Config.java
io.samsungsami.androidclient.DevicesActivity.java
io.samsungsami.androidclient.ExpandableAdapter.java
io.samsungsami.androidclient.GenericAdapter.java
io.samsungsami.androidclient.Item.java
io.samsungsami.androidclient.MessagesActivity.java
io.samsungsami.androidclient.RegisterActivity.java
io.samsungsami.androidclient.SamiActivity.java
sami.utils.FileUtils.java