I am completely new to Java and slowly learning the basics so apologies if this sounds idiotic.
I am trying to create an application that on a button click it sends a specific command to a certain IP and Port. The port will be fixed at Port 32, but the IP will be taken from an Intent.
public class IPControl extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Get the message from the intent
Intent intent = getIntent();
String message = intent.getStringExtra(IPEntry.ACTUALIP);
This is as far have gotten.
It will need to connect to the IP send a command of “Root” (Username) and then wait for a reply then send another command ‘Root’ (Password) and then wait for another reply, then after the connection has been established, I want to be able to send further commands on button click.
I have been racking my brains and searching the web for days and cannot seem to find the right solution.
I am going to be learning Java properly, it is on my list of things to do but this is vital for me to complete first.
If someone could help it would be extremely appreciated.
Here is full example of TCP/IP type of work in android
TCP /IP