Hello everyone, i’m trying to get an advice or something from a extension developer or knowledged programmer. I’m trying to make an extension for a personal project that is able to create a socket for sending bytes to a device via its ip address. This is my code.
The code is working as i tested it on netbeans and the device recieves the data.
But now trying to covert it as an extension, it doesnt work.
The extensions is succesfully compiled using rush. But when i try to test it crashes.
The problem is, i’ve tried to trace the error using:
You should really do adb logcat -d > C:\users\username\desktop\logcat.txt and then search either the companions package name, or your extensions package name. This should give a better error to look at.
“Specifically, if everything is happening in the UI thread, performing long operations such as network access or database queries will block the whole UI.”
The UI thread is meant to be used for UI modifications (an addition, a change, or a removal of a “widget”). For example, setting text on a label would require that to be done on the UI thread. Sending data from one device to another, shouldn’t be done on the UI thread.
Your list variable is a YailList. When you use this method list.toArray(); then it returns a Object[ ] not an array list and you can’t cast Object[ ] to a array list. In your code you’re using array list to convert it’s item to byte. You can do this same with Object[ ] by replacing your Array List to Object[ ] then why are you casting Object[ ] to an ArrayList?