-
Notifications
You must be signed in to change notification settings - Fork 549
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IoT sample for Android? (for IoT Android SDK) #3633
Comments
While the AWS Android SDK library is still supported, it is being replaced by https://github.com/aws/aws-iot-device-sdk-java-v2?tab=readme-ov-file. Here, you will find a few samples: https://github.com/aws/aws-iot-device-sdk-java-v2/blob/main/documents/ANDROID.md. You may want to go ahead and look at that library instead. If you want to continue using aws-android-sdk, please provide logs specific to your connection attempts and we can take a look to see what may be the issue. Our documentation for the IoT library can be found here: https://docs.amplify.aws/gen1/android/sdk/pubsub/ |
Thank you very much for the prompt response. We will investigate the java sdk per your note. Regarding the androd aws sdk,I'm attaching the console log (without the actual end point, let me know if you need it). As I mentioned, with the same AWS settings, the iOS sample works just fine (using the IoTWebSocket flow) |
Please double check the url/port you are using. You are getting |
remove the |
@tylerjroach , thank you so very much! I added https just because it says so in the comments in the example: Removing the https resolved the problem. Thank you again! |
This issue is now closed. Comments on closed issues are hard for our team to see. |
State your question
In your mobile SDK samples, you provide an "IoT-Sample" for iOS:
https://github.com/awslabs/aws-sdk-ios-samples/tree/main/IoT-Sample/Swift/
This sample demonstrates use of the AWS IoT APIs to securely publish to and subscribe from an MQTT topic. It uses Cognito authentication with identity pool id, without requiring a user login. It works.
You used to have a similar sample for Android (AndroidPubSubWebSocket) which used to be located here:
https://github.com/awslabs/aws-sdk-android-samples/tree/main/AndroidPubSubWebSocket
but it's not available anymore on the official sdk site for some reason.
The same sample is available over Internet from some previous AWS SDK demo backups, but it seems like that code doesn't work anymore.
The problem with that old sample is reported on a few places, and you have a (closed) ticket without resolution for the same problem:
#750
(the aWSIotMqttManager consistently reconnects and doesn't make a connection).
The same approach, with same values, pool id and policies works with the iOS sample.
Here is my question:
Can we currently use the same approach for Android (to use the moblie IoT SDK, and cognito without user login for the connection, subscription and publishing of messages?), or it's not possible?
If we can, is there a guide, tutorial or simple app who does that and it works?
Thanks,
Tony
Which AWS Services are you utilizing?
AWS IOT / Android
Provide code snippets (if applicable)
Your previous sample : https://github.com/felipemeriga/aws-sdk-android-samples/tree/master/AndroidPubSubWebSocket
Environment(please complete the following information):
Device Information (please complete the following information):
Multiple Pixel devices and simulators (Pixel 7 / API 34, Pixel 6. API 33, etc)
If you need help with understanding how to implement something in particular then we suggest that you first look into our developer guide. You can also simplify your process of creating an application, as well as the associated backend setup by using the Amplify CLI.
The link above is not valid.
We went over https://docs.aws.amazon.com/iot/latest/developerguide/what-is-aws-iot.html
Thanks,
Tony
The text was updated successfully, but these errors were encountered: