9.
Appendix B: Mobile Application Configuration
9.1
Android Application
The mobile application source files are available in the
/mobile-app/android
The developer needs to configure the mobile application to connect to the AWS account. For this
purpose, change the default value in
/src/com/amazonaws/mchp/awsprovisionkit/utils/
ConfigFileConstant.java
directly in the mobile application source files and compile to build the apk
file.
The file contains the fields below. The developer can get all these settings in the AWS account after the
AWS cloud setup.
//========================================================================
// User need to set below parameters to your AWS account credentials
//========================================================================
public static final String CUSTOMER_SPECIFIC_ENDPOINT_DEFAULT_VAL = "xxxxxx.us-
east-1.amazonaws.com";
public static final String COGNITO_POOL_ID_DEFAULT_VAL = "us-east-1:xxx-xxxxx-xxxx-xx-
xxxxxxxxxx";
public static final String AWS_IOT_POLICY_NAME_DEFAULT_VAL = "xxx"
// e.g. "AWS_IOT_POLICY_NAME";
public static final String AWS_IOT_REGION_DEFAULT_VAL ="xxx" // e.g. "us-east-1";
public static final String COGNITO_USER_POOL_ID_DEFAULT_VAL ="xxx" // "us-
east-1_xxxxxxx";
public static final String COGNITO_REGION_DEFAULT_VAL = "xxx" // e.g. "us-east-1";
public static final String COGNITO_CLIENT_ID_DEFAULT_VAL = "xxxxxxxxxxxxxxxxxxxxxxxx";
public static final String COGNITO_CLIENT_SECRET_DEFAULT_VAL = "xxxxxxxxxxxxxxxx";
public static final String DB_TABLE_NAME_DEFAULT_VAL = "SensorBoardAcctTable";
Instead of modifying the
ConfigFileConstant.java
file and building the apk, the developer can
modify the
config.txt
file in the smartphone after installing the mobile application. The file is located
in
/SDCARD/Android/data/com.amazonaws.mchp.awsprovisionkit/files/MyFileStorage/
and contains the fields below.
CUSTOMER_SPECIFIC_ENDPOINT=xxx // e.g. xxxx.us-east-1.amazonaws.com
COGNITO_POOL_ID=xxx // e.g. us-east-1:xxxxxx-xxxxxxxxx-xxxx-xxxxxxxxx
AWS_IOT_POLICY_NAME=xxx // e.g. "AWS_IOT_POLICY_NAME";
AWS_IOT_REGION=xxxx // e.g. us-east-1
COGNITO_USER_POOL_ID=xxx // e.g. us-east-1_xxxxxxxxxxxxx
COGNITO_REGION= xxx // e.g. us-east-1
COGNITO_CLIENT_ID=xxxxxxxxxxxxxxxx
COGNITO_CLIENT_SECRET=xxxxxxxxxxxxxxxxxx
• CUSTOMER_SPECIFIC_ENDPOINT
This is the AWS IoT EndPoint, which can be found in the setting page of AWS IoT console.
• COGNITO_POOL_ID
This is the AWS Cognito Identity pool ID after creating the Cognito Identity pool.
• AWS_IOT_POLICY
This is the AWS IoT policy name used for the mobile application to access AWS IoT resources.
• AWS_IOT_REGION
This is the AWS IoT Region.
• COGNITO_USER_POOL_ID
ATWINC15x0 Smart Device Kit
Appendix B: Mobile Application Configurati...
©
2019 Microchip Technology Inc.
User Guide
DS50002885A-page 73