This code works in Android Studio but how can i log in with username and password? Can somebody help me please. Answer You need to use the version of client.connect(); where you pass a MqttConnectOptions object See the docs here
Tag: android
How to fix app:lint error when building flutter app?
For some reason, all of a sudden my app cannot build anymore. First I had flutter devtools problem, then I upgraded to Flutter 2.8.1 and now my app cannot build. I tried upgrading Gradle to 7.3.3 and JDK 17 and still, my app cannot build, I searched the whole GitHub and StackOverflow and cannot find a solutio…
Using one Google Maps Activity, call a method using three different buttons
I have an android application in which I have 3 buttons and by pressing them I want to call three different Google maps markers, by using the same google maps activity. CLASS WITH 3 DIFFERENT BUTTONS and then my GOOGLE MAPS ACTIVITY CODE This is what I’ve done so far, but I can’t find a way to use…
As a user starts to type in an EditText can it append a file extension to the end?
Problem: I’ve been trying unsuccessfully to append a file extension which follows the cursor in real-time as a user types. What I’ve tried: I’ve been trying to use the .addTextChangedListener() which I think is correct, but having an issue trying to make the idea happen. Debugging shows is c…
CoordinatorLayout with NestedScrollView adding padding bottom for sticky button not working
I have this scenario : I’ve created this Then here’s my layout Then I’m doing the collapsing animation as : It works flawless, the problem is now that I want to add a sticky button but I can not tell to NestedScrollView to be aligned bottomToTopOf my button because it’s not inside a Co…
How to fix android build error – Could not create the Java Virtual Machine
Hi I am trying to build Android apk and I get the following errors when I run the shell script. Could you suggest what I can do to resolve this please. I have latest JAVA installed Error I get is Answer You are using two JVM options that are no longer available in recent Java versions: The MaxPermSize option …
How do I set a Java library’s custom event listener in Kotlin?
I have been working on an Android project in Kotlin and would like to use this UI library. However, it’s written in Java (and so is the documentation), and I’m not sure how to implement the event listener for the buttons. This is how it’s supposed to be done in Java: Does anyone know how I c…
how to programmatically set good scan beep on zebra device(Zebra MC3300) (only beep when specific type of barcode is scanned) using android kotlin app
I want my scanner to beep only when the barcode with “/” is scanned, what I have done is my app check if the barcode scanned have “/” but the beep is produced first then app check if the scanned barcode is right or not Answer You would need to mute the scanner beep and then have your a…
Android copy text from edittext
I’m having some trouble whilst following a beginner android dev program. I build an Android App and I have created EditText and Button. My idea, users can put PhoneNumber in EditText, and if they click the Copy button, they can copy shortUrl with PhonNumber that inputed! So, I have create a String with …
Android Gradle plugin requires Java 11 to run. You are currently using Java 1.8
I’m trying to use a physical Android device to test/debug my React Native project. I connected the device to my Windows 11 machine via USB and turned on Developer mode on the device but when I tried to run my project, I got an error stating the following: Android Gradle plugin requires Java 11 to run. Y…