Return to AWS IoT Device SDK for Android README
The Android sample builds an app that can be installed and run on an Android Device. The app builds and allows you to run the following samples from aws-iot-device-sdk-java-v2:
Jump To:
The individual samples within the app require specific files to operate. The files must be placed in the
app/src/main/assets
directory prior to building for the sample app to connect to IoT Core and complete
succesfully. The names of the files must be exactly as provided. Explanations for what each file and
associated argument are doing can be found in the individual Sample README
files linked below.
endpoint.txt
- IoT ATS Endpoint
certificate.pem
- IoT Thing Certificateprivatekey.pem
- IoT Thing Private Key
keychainAlias.txt
- Alias of PrivateKey to access from KeyChain- The sample app must have permission to access KeyChain. The PrivateKey for given alias must also be granted prior to running the KeyChainPubSub sample. This can be done by selecting the
KeyChain Alias Permission
from theSelect a Sample
dropdown menu and selecting the PrivateKey associated with the alias.
- The sample app must have permission to access KeyChain. The PrivateKey for given alias must also be granted prior to running the KeyChainPubSub sample. This can be done by selecting the
topic.txt
- specifies --topic CLI argumentmessage.txt
- specifies --message CLI argumentcount.txt
- specifies --count CLI argument
certificate.pem
- IoT Thing Certificateprivatekey.pem
- IoT Thing Private KeythingName.txt
- IoT Thing Name used by sample
cognitoIdentity.txt
- Cognito identity IDsigningRegion.txt
- Signing region
rootca.pem
- override the default system trust storeclientId.txt
- specifies --clientId CLI argumentport.txt
- specifies --port CLI argumentverbosity.txt
- specifies --verbosity CLI argument
# Change to the app directory
cd samples/Android/app
# Use gradlew from the android folder to build the sample app
../../../android/gradlew build
# Install it to a connected Device
../../../android/gradlew installDebug
The following links will provide more details on the individual samples available in the Android sample app.