I have a java code which acts as a client and a PHP Server running on xampp. The client sends a String to the PHP server. Thing works as expected in plain java. But when I use the same code for android then only starting few char are sent by the application.
This is the android client
and This is the php server
You posted the android client for the php server. Can you correct that? Not sure I can personally help, but maybe someone else can.
Joe Clark
Full-stack developer specializing in healthcare IT
I had to download Android Studio, get the right SDK, emulator, etc, but finally got this up and running, and I got nothing. No data sent. Turns out, an emulator connecting on localhost doesn't work so well.
However, changing to 10.0.2.2, as this Stack Overflow below suggests, worked just fine. I sent a much longer string through to the PHP server you created and it echoed okay. Give it a try.
stackoverflow.com/questions/38668820/how-to-conne…
Edited to add: I had to give the appropriate permissions in the manifest. I assume you already did that. I also had to shut down my web server since that was bound to port 80 already. I assume you did that, too.