Send message from Android mobile app to Azure IoT Hub

Internet of Things IoT Frameworks 2 years ago

0 1 0 0 0 tuteeHUB earn credit +10 pts

5 Star Rating 1 Rating
_x000D_ _x000D_ For an IoT project, we need to send messages from mobile application (iOS and Android) to Azure IoT Hub. We were able to do it connecting as a device using MQTT library. However, the device simulator too connect as a device and since both uses same device ID, the existing connection is dropped when both connect to IoT Hub at the same time. We realized we need to connect mobile apps as a service (not as a device) and for that some research shows we need to use following library. https://github.com/Azure/azure-iot-sdk-java https://github.com/Azure/azure-iot-sdk-java/blob/master/service/iot-service-samples/service-client-sample/src/main/java/samples/com/microsoft/azure/sdk/iot/ServiceClientSample.java However, this java sample uses lot of java specific implementations and which are not supported by Android. Has anyone faced the same problem? Which library can we use to achieve above from Android mobile application? Which library can we use to achieve above from iOS mobile application? Please let me know if any alternate solution is available.

Posted on 16 Aug 2022, this text provides information on IoT Frameworks related to Internet of Things. Please note that while accuracy is prioritized, the data presented might not be entirely correct or up-to-date. This information is offered for general knowledge and informational purposes only, and should not be considered as a substitute for professional advice.

Take Quiz To Earn Credits!

Turn Your Knowledge into Earnings.

tuteehub_quiz

Answers (1)

Post Answer
profilepic.png
manpreet Tuteehub forum best answer Best Answer 2 years ago
_x000D_ You can use a REST API for sending a D2C message to the Azure IoT Hub. The following screen snippet shows an example of this call. Note, that no library is required for this request. another solution for your scenario is to use an Azure Function as a pre-processor to the Azure IoT Hub, see the following example: Thanks Roman

No matter what stage you're at in your education or career, TuteeHub will help you reach the next level that you're aiming for. Simply,Choose a subject/topic and get started in self-paced practice sessions to improve your knowledge and scores.

Important Internet of Things Links

tuteehub community

Join Our Community Today

Ready to take your education and career to the next level? Register today and join our growing community of learners and professionals.

tuteehub community