この記事では、EloView 3でEloViewHome SDKにアクセスするためのオフライントークンの使用方法を説明します
AndroidアプリケーションでEloViewHome SDKを使用するには、オフライントークンが必要です。オフライントークンをお持ちでない場合は、Eloサポートチーム(support@elotouch.com)にご連絡いただき、アプリケーションのパッケージ名を含めてください。提供されたパッケージ名に基づいて、トークンを含むプロパティファイルを生成します。
オフライントークンを使用するには、SDKに付属のテストアプリ(ソースコード付き)を参照してください。特に、SDK内のAccountManagerActivity.javaを確認してください。要約すると、オフライントークンを使用するには、トークンファイルをアプリケーションのassetsフォルダーにコピーし、以下のコードスニペットを使用してトークンを読み取ります:
Properties credentials = new Properties();
try {
credentials.load(getApplicationContext().getAssets().open("com.eloview.homesdk.testapp_jwt.prop"));
} catch (Exception e) {
e.printStackTrace();
}
String accessToken = credentials.getProperty("jwt");
Please report any broken links by emailing support@elotouch.com and include a link to the knowledge article