High Latencys if using HiveMQ Client in Android

Hi y’all,
Im currently implementing a Android Messaging Service and i’m using HiveMQ Client Library with my HiveMQ-Cloud Broker.
I’m using the latest 1.3.1 release in my Android App and i’m facing some major issues.
Since i wanna develop in nearly RealTime, latency is a big point. But the latency while sending with the HiveMQ Client via Android is way to huge. For comparison i implemented the same client with Paho and HiveMQ in python and pure Java-Programm with latency beeing <50ms.
But as soon as i swap to my android app it goes around 3-4sec.
I also started a complete new Project and implemented only a button and a client but faced the same issues. The App got build on my Mac in a Emulator and on my HuaweiP30Pro.
Is there some related issue or know performance issues?
Big thanks in advance

The client i implemented for testing looks like this (the messages are received but with latency of >3sec)

Mqtt5AsyncClient client = Mqtt5Client
                        .builder()
                        .identifier("23")
                        .serverHost(host)
                        .serverPort(port)
                        .sslWithDefaultConfig()
                        .simpleAuth()
                            .username(username)
                            .password(password.getBytes())
                        .applySimpleAuth()
                        .buildAsync();

                client.connectWith()
                        .send()
                        .whenComplete((mqtt5ConnAck, throwable) -> {
                            if (throwable != null) {
                                //handle failure
                                System.out.println("connection failure" + throwable.toString());
                            } else {
                                client.publishWith()
                                        .topic("test")
                                        .payload(Long.toString(System.currentTimeMillis()).getBytes())
                                        .qos(MqttQos.EXACTLY_ONCE)
                                        .send()
                                        .whenComplete((mqtt5PublishResult, throwabl) -> {
                                            if (throwabl != null) {
                                                System.out.println("sou" + throwabl);
                                            }
                                        });                           
                            }
                        });

Hello @ktpn ,

This behavior does certainly sound unexpected - latency times of that magnitude are unusual for MQTT communication. I want to verify a few details so that we may be able to assist further.

To confirm, does this behavior continue when reducing the QoS level of the message being sent?

Does the performance appear the same when emulating versus when using a physical Android device?

It would also be beneficial to review how long the connection request takes to successfully complete before the message is being sent, as the connect and send actions are being performed in sequence, and this may give us a better indicator as to where the latency is being introduced.

Best,
Aaron from the HiveMQ Team