Socket Programming

General topics about the Android-Platform itself.
Coding issues please to the subforum right below.

HELP ME PLEASE... T_T

Postby b3n_hysteria » Thu May 07, 2009 1:54 pm

hai.. ok,
i have been try source from qamerfarooq

i'm use in 1 computer,
but nothing happen..

this my list source

Server :
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.ServerSocket;
import java.net.Socket;

public class TCPDesktopServer implements Runnable{

/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
new Thread(new TCPDesktopServer()).start();
}

public void run() {
// TODO Auto-generated method stub
try {
System.out.println("S: Connecting...");
ServerSocket serverSocket = new ServerSocket(8221);
while (true) {
Socket client = serverSocket.accept();
System.out.println("S: Receiving...");

try {

BufferedReader in = new BufferedReader(new InputStreamReader(client.getInputStream()));
String str = in.readLine();
System.out.println("S: Received: '" + str + "'");

} catch(Exception e) {
System.out.println("S: Error");
e.printStackTrace();

} finally {
client.close();
System.out.println("S: Done.");
}
}

} catch (IOException e) {
// TODO Auto-generated catch block
System.out.println("S: Error");
e.printStackTrace();
}
}

}


Client :

the manifest :
<?xml version="1.0" encoding="utf-8" ?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="socket.desktop" android:versionCode="1" android:versionName="1.0.0">
<application android:icon="@drawable/icon" android:label="@string/app_name">
<activity android:name=".socket" android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
<uses-permission android:name="android.permission.INTERNET" />
</manifest>



import java.io.BufferedWriter;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.net.InetAddress;
import java.net.Socket;
import java.net.UnknownHostException;

import android.app.Activity;
import android.os.Bundle;
import android.util.Log;


public class socket extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
connectSocket();
}

private void connectSocket() {
// TODO Auto-generated method stub
try {
InetAddress serverAddr = InetAddress.getByName("127.0.0.1");//10.66.3.44 is my pc' IP
Log.d("TCP", "C: Connecting...");
Socket socket = new Socket(serverAddr, 8221);
String message = "Hello from Client android emulator";
try {
Log.d("TCP", "C: Sending: '" + message + "'");
PrintWriter out = new PrintWriter( new BufferedWriter( new OutputStreamWriter(socket.getOutputStream())),true);

out.println(message);
Log.d("TCP", "C: Sent.");
Log.d("TCP", "C: Done.");

} catch(Exception e) {
Log.e("TCP", "S: Error", e);
} finally {
socket.close();
}


} catch (UnknownHostException e) {
// TODO Auto-generated catch block
Log.e("TCP", "C: UnknownHostException", e);
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
Log.e("TCP", "C: IOException", e);
e.printStackTrace();
}

}
}


and last :
package socket.desktop;
import java.io.BufferedWriter;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.net.InetAddress;
import java.net.Socket;

import android.util.Log;


public class TCPClient implements Runnable {

String message = "aaaaaaaa";
public void run() {
message = "haseum";
try {
InetAddress serverAddr = InetAddress.getByName("localhost");
Log.d("TCP", "C: Connecting...");
Socket socket = new Socket(serverAddr, 4444);
message = "bbbbb";

try {
Log.d("TCP", "C: Sending: '" + message + "'");
PrintWriter out = new PrintWriter( new BufferedWriter( new OutputStreamWriter(socket.getOutputStream())),true);
out.println(message);
Log.d("TCP", "C: Sent.");
Log.d("TCP", "C: Done.");
message = "cccccc";

} catch(Exception e) {
Log.e("TCP", "S: Error", e);

} finally {
socket.close();
}

} catch (Exception e) {
Log.e("TCP", "C: Error", e);
}
}
public String a(){
return message;
}
}


please help me to undrestand.. give me your suggetion, or argument..
this for my TA.. my final exam... T_T
b3n_hysteria
Junior Developer
Junior Developer
 
Posts: 11
Joined: Thu May 07, 2009 1:38 pm

Top

Postby blowfish08 » Mon Jun 01, 2009 1:04 am

qamerfarooq wrote:
GeorgieYuan wrote:
Hi all,

I found that when the Server is an Android Server, the socket communication(TCP/UDP) will be failed, any suggestion on this issue?

Regards.


In case your server is on Android then you need to follow the following steps to make your server available on network:

1- Lets say your server is listening on port number 6100 in android.

2- Forward the ports using the following command, so you can connect to android from localhost
Code: Select all
adb forward tcp:6100 tcp:6100


3- Now you can connect to this port from localhost but not from the network, it means you can connect using localhost:6100 from your desktop computer but not with the IP (192.168.0.1:6100 )

    telnet localhost 6100 OK
    telnet 192.168.0.1 6100 Failed
4- An extra step is needed for network access.
Use some proxy server which can listen on 192.168.0.140:6100 and forward the data to localhost:6100 (which is your android server)



Very nice tutorial, however Android development guide suggests not to use the adb tool to redir ports because there is no way to delete them. I found this one very useful.

Code: Select all
http://developer.android.com/guide/developing/tools/emulator.html#emulatornetworking


At least it worked for me :P

PS. Sorry for the code but I couldn't post the link because this is my first post.
blowfish08
Once Poster
Once Poster
 
Posts: 1
Joined: Tue May 19, 2009 6:51 pm

Postby donalduck0304 » Wed Oct 21, 2009 10:16 am

Can u tell more detailed

I really want to make Android Server and Android Client on 2 emulators. But I don't know how to do. Please help me :cry:
User avatar
donalduck0304
Freshman
Freshman
 
Posts: 6
Joined: Tue Oct 20, 2009 10:38 am

Socket programing

Postby Annapurna » Sun Nov 08, 2009 9:02 am

Hi,
I have tried the post posted client server program , On my host pc I wrote server program and on android client program.
server.
[syntax="java"]import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.ServerSocket;
import java.net.Socket;



public class TCPDesktopServer implements Runnable{

public static final String SERVERIP = "127.0.0.1";
public static final int SERVERPORT = 4445;

public void run() {
try {
System.out.println("S: Connecting...");
ServerSocket serverSocket = new ServerSocket(SERVERPORT);
while (true) {
Socket client = serverSocket.accept();
System.out.println("S: Receiving...");

try {

BufferedReader in = new BufferedReader(new InputStreamReader(client.getInputStream()));
String str = in.readLine();
System.out.println("S: Received: '" + str + "'");

} catch(Exception e) {
System.out.println("S: Error");
e.printStackTrace();

} finally {
client.close();
System.out.println("S: Done.");
}
}
} catch (Exception e) {
System.out.println("S: Error");
e.printStackTrace();
}
}

public static void main (String a[]) {

Thread desktopServerThread = new Thread(new TCPDesktopServer());
desktopServerThread.start();
}
}



client(on android)


for socket:

package com.android.SocketTest;

import android.app.Activity;
import android.os.Bundle;

public class SocketTest extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
}
}

package com.android.SocketTest;

import java.io.BufferedWriter;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.net.InetAddress;
import java.net.Socket;

import android.util.Log;


public class TCPClient implements Runnable {


public void run() {
try {
InetAddress serverAddr = InetAddress.getByName("10.64.18.178");// Ip of my desktop.
Log.d("TCP", "C: Connecting...");
Socket socket = new Socket(serverAddr, 4445);
String message = "Hello from Client android emulator";

try {
Log.d("TCP", "C: Sending: '" + message + "'");
PrintWriter out = new PrintWriter( new BufferedWriter( new OutputStreamWriter(socket.getOutputStream())),true);
out.println(message);
Log.d("TCP", "C: Sent.");
Log.d("TCP", "C: Done.");

} catch(Exception e) {
Log.e("TCP", "S: Error", e);

} finally {
socket.close();
}

} catch (Exception e) {
Log.e("TCP", "C: Error", e);
}
}
}

Androidmanifest.xml is


[syntax="xml"]
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.android.SocketTest"
android:versionCode="1"
android:versionName="1.0.0">
<application android:icon="@drawable/icon" android:label="@string/app_name">
<activity android:label="@string/app_name" android:name="SocketTest">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<uses-permission android:name="android.permission.INTERNET" />
</application>
</manifest>

problem: The client couldn't able to send the massage to server. Server is running properly but it is not showing the massage from client.
Please help me . It is so much urgent for me.

Thanks to all.
Annapurna
Freshman
Freshman
 
Posts: 2
Joined: Fri Nov 06, 2009 11:12 am

Postby Sapientum » Tue Nov 24, 2009 4:16 pm

Hey guys,

First of all, I'm not very experienced with Android or network communication, only just began, so some of my questions might be very simple :)

I'm trying to develop a small app that will send a string/integer from an Android Phone to a PC, so I've been looking at getting the code from this post to work...
I've come to the point where the code executes without error messages, but I don't seem to receive anything in the Android emulator... The app opens on the emulator, but then nothing else happens.

I'm not quite sure whether the problem is port- or execution-based.
I'm compiling/running all the code directly from Eclipse, but is that the proper method for testing it? I'm not sure if some of the code(the server?) should be run differently, and only the client be run from Eclipse?

Or is the problem most likely port-based? That the port isn't forwarded?

Also, like I mentioned, I need the client to run on a phone afterwards, and I've noticed that in many other discussions(like Bluetooth) people seem to have had problems with running apps on a HTC Hero... Is this also the case with TCP-communication?
Sapientum
Junior Developer
Junior Developer
 
Posts: 11
Joined: Tue Nov 24, 2009 3:56 pm

Postby zizo » Fri Nov 27, 2009 2:47 am

Hello!
I'm trying to do a chat application. I have a android app and a windows mobile application running in the same pc and i want to put the two comunicating with each other. Sometimes i put one being the client and other the server and another times vice-versa. It's suposed to be able to receive and send messages both in server and in client.

My windows app is fine because was tested many times before. I can't put the android app on when i run it being the server and i can't connect with the wm server when android is the client. android app freezes in the if next to the creation of the client socket saying that the socket is null(not created - nullpointerexception).

In the end i put the wm app just in case...
First i put the android eclipse app.
Help me. :(
Cumps

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. package com.android.chat;
  2.  
  3.  
  4.  
  5. import java.io.BufferedReader;
  6.  
  7. import java.io.IOException;
  8.  
  9. import java.io.InputStream;
  10.  
  11. import java.io.InputStreamReader;
  12.  
  13. import java.io.OutputStream;
  14.  
  15. import java.io.PrintWriter;
  16.  
  17. import java.net.InetAddress;
  18.  
  19. import java.net.ServerSocket;
  20.  
  21. import java.net.Socket;
  22.  
  23. import java.net.UnknownHostException;
  24.  
  25.  
  26.  
  27. import android.app.Activity;
  28.  
  29. import android.os.Bundle;
  30.  
  31. import android.os.Handler;
  32.  
  33. import android.os.Message;
  34.  
  35. import android.view.View;
  36.  
  37. import android.view.View.OnClickListener;
  38.  
  39. import android.widget.Button;
  40.  
  41. import android.widget.EditText;
  42.  
  43. import android.widget.ListView;
  44.  
  45. import android.widget.TextView;
  46.  
  47.  
  48.  
  49. public class Chat extends Activity implements OnClickListener {
  50.  
  51.  
  52.  
  53.   private EditText etChat;
  54.  
  55.   private EditText etInfos;
  56.  
  57.   private Button bEnviar;
  58.  
  59.   private Button bDesligar;
  60.  
  61.   private Button bLigarServer;
  62.  
  63.   private Button bLigarClient;
  64.  
  65.   private ListView lvConversa;
  66.  
  67.   private TextView tvChat;
  68.  
  69.   private boolean isServer = false;
  70.  
  71.   private boolean isClient = false;
  72.  
  73.  
  74.  
  75.   //cliente
  76.  
  77.   Socket socketCliente;
  78.  
  79.   String hostIpServidor;
  80.  
  81.   int portoServidor;
  82.  
  83.   PrintWriter outClient;
  84.  
  85.   TCPClient tcpclient;
  86.  
  87.  
  88.  
  89.   //Servidor
  90.  
  91.   int portoEscutaGeral;
  92.  
  93.   ServerSocket socketGeralServidor;
  94.  
  95.   PrintWriter outServer;
  96.  
  97.   TCPServer tcpserver;
  98.  
  99.  
  100.  
  101.   /** Called when the activity is first created. */
  102.  
  103.   @Override
  104.  
  105.   public void onCreate(Bundle savedInstanceState) {
  106.  
  107.     super.onCreate(savedInstanceState);
  108.  
  109.     setContentView(R.layout.main);
  110.  
  111.     etChat = (EditText)findViewById(R.id.EditText01);
  112.  
  113.     etInfos = (EditText)findViewById(R.id.EditText02);
  114.  
  115.     lvConversa = (ListView)findViewById(R.id.ListView01);
  116.  
  117.     tvChat = (TextView)findViewById(R.id.TextView01);
  118.  
  119.     bEnviar = (Button)findViewById(R.id.Button01);
  120.  
  121.     bEnviar.setOnClickListener((OnClickListener)this);
  122.  
  123.     bDesligar = (Button)findViewById(R.id.Button02);
  124.  
  125.     bDesligar.setOnClickListener((OnClickListener)this);
  126.  
  127.     bLigarServer = (Button)findViewById(R.id.Button03);
  128.  
  129.     bLigarServer.setOnClickListener((OnClickListener)this);
  130.  
  131.     bLigarClient = (Button)findViewById(R.id.Button04);
  132.  
  133.     bLigarClient.setOnClickListener((OnClickListener)this);
  134.  
  135.   }
  136.  
  137.  
  138.  
  139.   private Handler handlerCliente = new Handler() {
  140.  
  141.     public void handleMessage(Message msg) {
  142.  
  143.       // processar mensagem
  144.  
  145.       if (msg.what == 0) {
  146.  
  147.         tvChat.append("Servidor diz: " + (String)msg.obj);
  148.  
  149.       }
  150.  
  151.     }
  152.  
  153.   };
  154.  
  155.  
  156.  
  157.   Handler handlerServidor = new Handler() {
  158.  
  159.     public void handleMessage(Message msg) {
  160.  
  161.       // processar mensagem
  162.  
  163.       if (msg.what == 0){
  164.  
  165.         tvChat.append("Cliente diz: " + (String)msg.obj);
  166.  
  167.       }
  168.  
  169.     }
  170.  
  171.   };
  172.  
  173.  
  174.  
  175.   public void onClick(View v) {
  176.  
  177.     switch(v.getId()){
  178.  
  179.     case R.id.Button01:
  180.  
  181.       try {
  182.  
  183.         if (isClient){
  184.  
  185.           //desligarCliente();
  186.  
  187.           socketCliente.close();
  188.  
  189.           isClient = false;
  190.  
  191.         }
  192.  
  193.         else if (isServer){
  194.  
  195.           //desligarServidor();//só fecha socket que o servidor tinha aberta para este cliente
  196.  
  197.           tcpserver.getSocketServerCliente().close();
  198.  
  199.           isServer = false;
  200.  
  201.         }
  202.  
  203.       }catch (IOException ioe) {
  204.  
  205.         ioe.printStackTrace();
  206.  
  207.       }
  208.  
  209.       break;
  210.  
  211.     case R.id.Button02:
  212.  
  213.       try {
  214.  
  215.         if (isClient) {
  216.  
  217.           outClient = new PrintWriter(socketCliente.getOutputStream(), true);
  218.  
  219.           outClient.println(etChat.getText().toString() + "\n");
  220.  
  221.         }
  222.  
  223.         else if (isServer){
  224.  
  225.           outServer = new PrintWriter(tcpserver.getSocketServerCliente().getOutputStream(), true);
  226.  
  227.           outServer.println(etChat.getText().toString() + "\n");
  228.  
  229.         }
  230.  
  231.       }
  232.  
  233.       catch (IOException ioe) {
  234.  
  235.         ioe.printStackTrace();
  236.  
  237.       }
  238.  
  239.       break;
  240.  
  241.     case R.id.Button03:    
  242.  
  243.       isServer = true;
  244.  
  245.       //lerDadosServidor();
  246.  
  247.       portoEscutaGeral = Integer.parseInt(etInfos.getText().toString());
  248.  
  249.       //ligarServidor();
  250.  
  251.       try {
  252.  
  253.         socketGeralServidor = new ServerSocket(portoEscutaGeral);
  254.  
  255.         socketGeralServidor.bind(socketGeralServidor.getLocalSocketAddress(), 10);
  256.  
  257.         //receberInfoServidor()
  258.  
  259.         tcpserver = new TCPServer(socketGeralServidor, handlerServidor);
  260.  
  261.         Thread threadServer = new Thread(tcpserver);
  262.  
  263.         threadServer.start();
  264.  
  265.       }
  266.  
  267.       catch (IOException ioe) {
  268.  
  269.         ioe.printStackTrace();
  270.  
  271.       }
  272.  
  273.       break;
  274.  
  275.     case R.id.Button04:
  276.  
  277.       isClient = true;
  278.  
  279.       //lerDadosCliente();
  280.  
  281.       String[] meu = etInfos.getText().toString().split(":");
  282.  
  283.       hostIpServidor = meu[0];
  284.  
  285.       portoServidor = Integer.parseInt(meu[1]);
  286.  
  287.       //ligarCliente();
  288.  
  289.       try {
  290.  
  291.         InetAddress serverAddr = InetAddress.getByName(hostIpServidor);
  292.  
  293.         socketCliente = new Socket(serverAddr, portoServidor/*"10.101.226.2", 4444*/);
  294.  
  295.       } catch (UnknownHostException e) {
  296.  
  297.         e.printStackTrace();
  298.  
  299.       } catch (IOException e) {
  300.  
  301.         e.printStackTrace();
  302.  
  303.       }
  304.  
  305.       if(socketCliente.isConnected()){
  306.  
  307.         // o socket do cliente esta pronto para enviar e receber mensagens
  308.  
  309.       }
  310.  
  311.       //receberInfoCliente();
  312.  
  313.       tcpclient = new TCPClient(socketCliente, handlerCliente);
  314.  
  315.       Thread threadClient = new Thread(tcpclient);
  316.  
  317.       threadClient.start();
  318.  
  319.       break;
  320.  
  321.     }
  322.  
  323.  
  324.  
  325.   }
  326.  
  327. }
Parsed in 0.052 seconds, using GeSHi 1.0.8.4


Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. package com.android.chat;
  2.  
  3.  
  4.  
  5. import java.io.BufferedReader;
  6.  
  7. import java.io.IOException;
  8.  
  9. import java.io.InputStreamReader;
  10.  
  11. import java.net.Socket;
  12.  
  13.  
  14.  
  15. import android.os.Handler;
  16.  
  17. import android.os.Message;
  18.  
  19.  
  20.  
  21. public class TCPClient implements Runnable {
  22.  
  23.  
  24.  
  25.   Socket socketCliente;
  26.  
  27.   Handler handler;
  28.  
  29.  
  30.  
  31.   public TCPClient(Socket socketCliente, Handler handler) {
  32.  
  33.     this.socketCliente = socketCliente;
  34.  
  35.     this.handler = handler;
  36.  
  37.   }
  38.  
  39.  
  40.  
  41.   @Override
  42.  
  43.   public void run() {
  44.  
  45.     char[] line = new char[100];
  46.  
  47.     BufferedReader in = null;
  48.  
  49.     try {
  50.  
  51.       in = new BufferedReader(new InputStreamReader(socketCliente.getInputStream()));
  52.  
  53.       while (true) {
  54.  
  55.         line = new char[100];
  56.  
  57.         in.read(line, 0, 100);
  58.  
  59.         if (line.length > 0) {
  60.  
  61.           String msg = new String(line);
  62.  
  63.           // processar a mensagem
  64.  
  65.           Message lmsg = new Message();
  66.  
  67.           lmsg.what = 0;
  68.  
  69.           lmsg.obj = msg;
  70.  
  71.           handler.sendMessage(lmsg);
  72.  
  73.         }
  74.  
  75.       }
  76.  
  77.     } catch (IOException e) {
  78.  
  79.       e.printStackTrace();
  80.  
  81.     }
  82.  
  83.   }
  84.  
  85. }
Parsed in 0.036 seconds, using GeSHi 1.0.8.4


Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. package com.android.chat;
  2.  
  3.  
  4.  
  5. import java.io.BufferedReader;
  6.  
  7. import java.io.IOException;
  8.  
  9. import java.io.InputStreamReader;
  10.  
  11. import java.net.ServerSocket;
  12.  
  13. import java.net.Socket;
  14.  
  15.  
  16.  
  17. import android.os.Handler;
  18.  
  19. import android.os.Message;
  20.  
  21.  
  22.  
  23. /**
  24.  
  25.  * Faz a leitura do lado do servidor.
  26.  
  27.  * @author Celso
  28.  
  29.  *
  30.  
  31.  */
  32.  
  33. public class TCPServer implements Runnable {
  34.  
  35.  
  36.  
  37.   Handler handlerServidor;
  38.  
  39.   ServerSocket socketGeralServidor;
  40.  
  41.   Socket socketServerCliente;//socket do lado do servidor para falar com este cliente
  42.  
  43.  
  44.  
  45.   public TCPServer(ServerSocket socketGeralServidor, Handler handlerServidor) {
  46.  
  47.     this.socketGeralServidor = socketGeralServidor;
  48.  
  49.     this.handlerServidor = handlerServidor;
  50.  
  51.   }
  52.  
  53.  
  54.  
  55.   @Override
  56.  
  57.   public void run() {
  58.  
  59.     try {
  60.  
  61.       while(true){
  62.  
  63.         socketServerCliente = socketGeralServidor.accept();//bloqueia até ligação com novo cliente seja estabelecida
  64.  
  65.         if (socketServerCliente != null)
  66.  
  67.         {
  68.  
  69.           if (socketServerCliente.isConnected())
  70.  
  71.           {
  72.  
  73.             // ligacao estabelecida
  74.  
  75.           }
  76.  
  77.         }      
  78.  
  79.         char[] line = new char[100];
  80.  
  81.         BufferedReader in = new BufferedReader(new InputStreamReader(socketServerCliente.getInputStream()));
  82.  
  83.         while (true) {
  84.  
  85.           line = new char[100];
  86.  
  87.           in.read(line, 0, 100);
  88.  
  89.           if (line.length > 0) {
  90.  
  91.             String msg = new String(line);
  92.  
  93.             // processar a mensagem
  94.  
  95.             Message lmsg = new Message();
  96.  
  97.             lmsg.what = 0;
  98.  
  99.             lmsg.obj = msg;
  100.  
  101.             handlerServidor.sendMessage(lmsg);
  102.  
  103.           }
  104.  
  105.         }
  106.  
  107.       }
  108.  
  109.     } catch (IOException ioe) {
  110.  
  111.       ioe.printStackTrace();
  112.  
  113.     }
  114.  
  115.   }
  116.  
  117.  
  118.  
  119.   public Socket getSocketServerCliente(){
  120.  
  121.     return socketServerCliente;
  122.  
  123.   }
  124.  
  125. }
  126.  
  127.  
Parsed in 0.041 seconds, using GeSHi 1.0.8.4


Syntax: [ Download ] [ Hide ]
Using xml Syntax Highlighting
  1. <?xml version="1.0" encoding="utf-8"?>
  2.  
  3. <manifest xmlns:android="http://schemas.android.com/apk/res/android"
  4.  
  5.      package="com.android.chat"
  6.  
  7.      android:versionCode="1"
  8.  
  9.      android:versionName="1.0">
  10.  
  11.       <uses-permission android:name="android.permission.INTERNET" />
  12.  
  13.     <application android:icon="@drawable/icon" android:label="@string/app_name">
  14.  
  15.         <activity android:name=".Chat"
  16.  
  17.                  android:label="@string/app_name">
  18.  
  19.             <intent-filter>
  20.  
  21.                 <action android:name="android.intent.action.MAIN" />
  22.  
  23.                 <category android:name="android.intent.category.LAUNCHER" />
  24.  
  25.             </intent-filter>
  26.  
  27.         </activity>
  28.  
  29.  
  30.  
  31.     </application>
  32.  
  33.  
  34.  
  35.  
  36.  
  37. </manifest>
Parsed in 0.003 seconds, using GeSHi 1.0.8.4


Syntax: [ Download ] [ Hide ]
Using xml Syntax Highlighting
  1. <?xml version="1.0" encoding="utf-8"?>
  2.  
  3. <TextView xmlns:android="http://schemas.android.com/apk/res/android"
  4.  
  5.         android:id="@+id/TextView01" android:layout_width="wrap_content"
  6.  
  7.         android:layout_height="wrap_content"></TextView>
  8.  
  9.  
Parsed in 0.001 seconds, using GeSHi 1.0.8.4


Syntax: [ Download ] [ Hide ]
Using xml Syntax Highlighting
  1. <?xml version="1.0" encoding="utf-8"?>
  2.  
  3. <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  4.  
  5.    android:orientation="vertical"
  6.  
  7.    android:layout_width="fill_parent"
  8.  
  9.    android:layout_height="fill_parent">
  10.  
  11.         <ListView android:id="@+id/ListView01"
  12.  
  13.                 android:layout_height="200dip"
  14.  
  15.                 android:layout_width="fill_parent">
  16.  
  17.                 </ListView>
  18.  
  19.         <EditText android:id="@+id/EditText01"
  20.  
  21.                 android:layout_width="200dip"
  22.  
  23.                 android:layout_height="40dip"></EditText>
  24.  
  25.         <Button android:id="@+id/Button01"
  26.  
  27.                 android:text="Enviar"
  28.  
  29.                 android:layout_height="40dip"
  30.  
  31.                 android:layout_width="120dip"
  32.  
  33.                 android:layout_marginLeft="200dip"
  34.  
  35.                 android:layout_marginTop="-41dip"></Button>
  36.  
  37.         <EditText android:id="@+id/EditText02"
  38.  
  39.                 android:layout_width="200dip"
  40.  
  41.                 android:layout_height="40dip"></EditText>
  42.  
  43.         <Button android:id="@+id/Button02"
  44.  
  45.                 android:layout_width="120dip"
  46.  
  47.                 android:layout_marginTop="-41dip"
  48.  
  49.                 android:layout_marginLeft="200dip"
  50.  
  51.                 android:layout_height="40dip"
  52.  
  53.                 android:text="Desligar"></Button>
  54.  
  55.         <Button android:id="@+id/Button03"
  56.  
  57.                 android:text="Ligar-se como servidor"
  58.  
  59.                 android:layout_height="40dip"
  60.  
  61.                 android:layout_width="175dip"></Button>
  62.  
  63.         <Button android:id="@+id/Button04"
  64.  
  65.                 android:text="Ligar-se como cliente"
  66.  
  67.                 android:layout_height="40dip"
  68.  
  69.                 android:layout_width="175dip"></Button>
  70.  
  71. </LinearLayout>
Parsed in 0.005 seconds, using GeSHi 1.0.8.4


Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. using System;
  2.  
  3.  
  4.  
  5. using System.Linq;
  6.  
  7. using System.Collections.Generic;
  8.  
  9. using System.ComponentModel;
  10.  
  11. using System.Data;
  12.  
  13. using System.Net;
  14.  
  15. using System.Net.Sockets;
  16.  
  17. using System.Drawing;
  18.  
  19. using System.Text;
  20.  
  21. using System.Windows.Forms;
  22.  
  23.  
  24.  
  25. namespace ex1g4 {
  26.  
  27.     public partial class Form1 : Form {
  28.  
  29.         private Socket temp;
  30.  
  31.         private EndPoint client_EndPoint;
  32.  
  33.         private Socket server_listenSocket;
  34.  
  35.         private Socket client_Socket;
  36.  
  37.         private bool isServer;
  38.  
  39.         public Form1() {
  40.  
  41.             InitializeComponent();
  42.  
  43.         }
  44.  
  45.  
  46.  
  47.         private void button1_Click(object sender, EventArgs e) {
  48.  
  49.             isServer = false;
  50.  
  51.             try {
  52.  
  53.                 char[] arr = { ':' };
  54.  
  55.                 String[] meu = textBoxIp.Text.Split(arr);
  56.  
  57.                 int porto = int.Parse(meu[1]);
  58.  
  59.                 client_EndPoint = new IPEndPoint(IPAddress.Parse(meu[0]),
  60.  
  61.                                                      Convert.ToInt16(porto));
  62.  
  63.  
  64.  
  65.             } catch (FormatException) {
  66.  
  67.                 MessageBox.Show("Invalid IP address entered - needs n.n.n.n, for example 192.168.0.103");
  68.  
  69.                 return;
  70.  
  71.             }
  72.  
  73.             try {
  74.  
  75.                 client_Socket = new Socket(AddressFamily.InterNetwork,
  76.  
  77.                               SocketType.Stream,
  78.  
  79.                               ProtocolType.Tcp);
  80.  
  81.                 client_Socket.Connect(client_EndPoint);
  82.  
  83.  
  84.  
  85.             } catch (SocketException) {
  86.  
  87.                 MessageBox.Show("Não é possível estabelecer a ligação");
  88.  
  89.                 return;
  90.  
  91.             }
  92.  
  93.             textBoxWriteMsg.Enabled = true;
  94.  
  95.             textBoxReadMsg.Enabled = true;
  96.  
  97.             buttonEnviar.Enabled = true;
  98.  
  99.             buttonDesligar.Enabled = true;
  100.  
  101.             buttonLigar.Enabled = false;
  102.  
  103.             buttonLancarServer.Enabled = false;
  104.  
  105.             textBoxIp.Enabled = false;
  106.  
  107.             System.Threading.ThreadStart ts = new System.Threading.ThreadStart(receiveLoop);
  108.  
  109.             System.Threading.Thread t1 = new System.Threading.Thread(ts);
  110.  
  111.             t1.Start();
  112.  
  113.         }
  114.  
  115.  
  116.  
  117.         public void receiveLoop() {
  118.  
  119.             if (isServer) {
  120.  
  121.                 while (true) {
  122.  
  123.                     //textBoxIp.Text += "while ";
  124.  
  125.                     try {
  126.  
  127.                         temp = server_listenSocket.Accept();
  128.  
  129.                         textBoxWriteMsg.Enabled = true;
  130.  
  131.                         textBoxReadMsg.Enabled = true;
  132.  
  133.                         buttonEnviar.Enabled = true;
  134.  
  135.                     } catch (ObjectDisposedException) {
  136.  
  137.  
  138.  
  139.                         return;
  140.  
  141.                     }
  142.  
  143.                     try {
  144.  
  145.                         Byte[] l_Buffer;
  146.  
  147.                         string l_receivedString;
  148.  
  149.                         while (temp.Connected) {
  150.  
  151.                             l_Buffer = new Byte[100];
  152.  
  153.                             int received = temp.Receive(l_Buffer, l_Buffer.Length, SocketFlags.None);
  154.  
  155.                             l_receivedString = System.Text.Encoding.UTF8.GetString(l_Buffer, 0, received);
  156.  
  157.                             myDelegate updateDelegate = new myDelegate(updateMessageLog); // updateMessageLog é a funcao noutra thread que processa a string recebida
  158.  
  159.                             updateDelegate(l_receivedString); // passagem da string para a funcao updateMessageLog atraves de um delegado
  160.  
  161.                         }
  162.  
  163.                     } catch (System.Exception) {
  164.  
  165.                         if (temp != null)
  166.  
  167.                             temp.Close(); // fecha os sockets do cliente e do servidor
  168.  
  169.                     }
  170.  
  171.                     textBoxWriteMsg.Enabled = false;
  172.  
  173.                     textBoxReadMsg.Enabled = false;
  174.  
  175.                     buttonEnviar.Enabled = false;
  176.  
  177.                 }
  178.  
  179.             } else {
  180.  
  181.                 temp = client_Socket;
  182.  
  183.                 try {
  184.  
  185.                     Byte[] l_Buffer;
  186.  
  187.                     string l_receivedString;
  188.  
  189.                     while (temp.Connected) {
  190.  
  191.                         l_Buffer = new Byte[100];
  192.  
  193.                         int received = temp.Receive(l_Buffer, l_Buffer.Length, SocketFlags.None);
  194.  
  195.                         l_receivedString = System.Text.Encoding.UTF8.GetString(l_Buffer, 0, received);
  196.  
  197.                         myDelegate updateDelegate = new myDelegate(updateMessageLog); // updateMessageLog é a funcao noutra thread que processa a string recebida
  198.  
  199.                         updateDelegate(l_receivedString); // passagem da string para a funcao updateMessageLog atraves de um delegado
  200.  
  201.                     }
  202.  
  203.                 } catch (System.Exception) {
  204.  
  205.                     if (temp != null)
  206.  
  207.                         temp.Close(); // fecha os sockets do cliente e do servidor
  208.  
  209.                 }
  210.  
  211.             }
  212.  
  213.         }
  214.  
  215.  
  216.  
  217.         public delegate void myDelegate(String str);
  218.  
  219.  
  220.  
  221.         public void updateMessageLog(String str) {
  222.  
  223.             textBoxReadMsg.Text += "Remoto diz:\r\n" + str + "\r\n";
  224.  
  225.         }
  226.  
  227.  
  228.  
  229.         private void button2_Click(object sender, EventArgs e) {
  230.  
  231.             buttonLancarServer.Enabled = false;
  232.  
  233.             textBoxIp.Enabled = false;
  234.  
  235.             buttonLigar.Enabled = false;
  236.  
  237.             isServer = true;
  238.  
  239.             server_listenSocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
  240.  
  241.             try {
  242.  
  243.                 server_listenSocket.Bind(new IPEndPoint(IPAddress.Any, 4444));
  244.  
  245.             } catch (SocketException) {
  246.  
  247.                 MessageBox.Show("Já existe um servidor neste porto");
  248.  
  249.                 Application.Exit();
  250.  
  251.             }
  252.  
  253.             server_listenSocket.Listen((int)SocketOptionName.MaxConnections);
  254.  
  255.             System.Threading.ThreadStart ts = new System.Threading.ThreadStart(receiveLoop);
  256.  
  257.             System.Threading.Thread t1 = new System.Threading.Thread(ts);
  258.  
  259.             t1.Start();
  260.  
  261.         }
  262.  
  263.  
  264.  
  265.         private void buttonEnviar_Click(object sender, EventArgs e) {
  266.  
  267.             if (!isServer) {
  268.  
  269.                 client_Socket.Send(Encoding.UTF8.GetBytes(textBoxWriteMsg.Text));
  270.  
  271.             } else {
  272.  
  273.                 temp.Send(Encoding.UTF8.GetBytes(textBoxWriteMsg.Text));
  274.  
  275.             }
  276.  
  277.             textBoxReadMsg.Text += "Local diz: \r\n" + textBoxWriteMsg.Text + "\r\n";
  278.  
  279.             textBoxWriteMsg.Text = "";
  280.  
  281.         }
  282.  
  283.  
  284.  
  285.         private void buttonDesligar_Click(object sender, EventArgs e) {
  286.  
  287.             if (client_Socket != null)
  288.  
  289.                 client_Socket.Close();
  290.  
  291.             if (temp != null)
  292.  
  293.                 temp.Close();
  294.  
  295.             if (!isServer) {
  296.  
  297.                 textBoxWriteMsg.Enabled = false;
  298.  
  299.                 textBoxReadMsg.Enabled = false;
  300.  
  301.                 buttonEnviar.Enabled = false;
  302.  
  303.                 buttonLigar.Enabled = true;
  304.  
  305.                 textBoxIp.Enabled = true;
  306.  
  307.                 buttonDesligar.Enabled = false;
  308.  
  309.                 buttonLancarServer.Enabled = true;
  310.  
  311.             }
  312.  
  313.  
  314.  
  315.  
  316.  
  317.  
  318.  
  319.  
  320.  
  321.         }
  322.  
  323.  
  324.  
  325.         private void Form1_Closing(object sender, CancelEventArgs e) {
  326.  
  327.             if (isServer) {
  328.  
  329.                 try {
  330.  
  331.                     if (server_listenSocket != null) {
  332.  
  333.                         server_listenSocket.Close();
  334.  
  335.                     }
  336.  
  337.                 } catch (Exception) {
  338.  
  339.  
  340.  
  341.                 }
  342.  
  343.             } else {
  344.  
  345.                 if (client_Socket != null)
  346.  
  347.                     client_Socket.Close();
  348.  
  349.             }
  350.  
  351.         }
  352.  
  353.  
  354.  
  355.         private void Form1_Load(object sender, EventArgs e) {
  356.  
  357.             buttonEnviar.Enabled = false;
  358.  
  359.             textBoxWriteMsg.Enabled = false;
  360.  
  361.             textBoxReadMsg.Enabled = false;
  362.  
  363.             buttonDesligar.Enabled = false;
  364.  
  365.         }
  366.  
  367.     }
  368.  
  369. }
Parsed in 0.065 seconds, using GeSHi 1.0.8.4
zizo
Once Poster
Once Poster
 
Posts: 1
Joined: Fri Nov 27, 2009 2:28 am

Top

executing from different class - application crashes ?

Postby Laurid » Mon Jan 25, 2010 1:06 am

Hi, I'm working with the tcp example from qamerfarooq. I have an EchoServer running on my Desktop and I'm testing direktly on my Device.
It's working great. Thanks for that!!

Now I wanted to modify the code a little bit, that I'm able to change the text which is send.

In the TCPClient-Class I added a simple "test" function:

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. package de.lauridmeyer.egocontrol;
  2. public class TCPClient implements Runnable {
  3.  
  4.     public static final String SERVERIP = "192.168.0.6";//192.168.0.6
  5.     public static final int SERVERPORT = 6200;
  6.     PrintWriter out;
  7.     String message = "Hello from Client!!";
  8.    
  9.     public TCPClient(){
  10.        
  11.     }
  12.    
  13.     public void test(){
  14.         message ="TESTEST";
  15.         Log.d("TCP", "C: Sending: '" + message + "'");
  16.         out.println(message);
  17.    
  18.     }
  19.        
  20.     public void run() {
  21.          try {
  22.                  
  23.                  InetAddress serverAddr = InetAddress.getByName(SERVERIP);//TCPServer.SERVERIP
  24.                  
  25.                  Log.d("TCP", "C: Connecting...");
  26.                  Socket socket = new Socket(serverAddr, SERVERPORT);
  27.                
  28.                      try {
  29.                          Log.d("TCP", "C: Sending: '" + message + "'");
  30.                          out = new PrintWriter( new BufferedWriter( new OutputStreamWriter(socket.getOutputStream())),true);
  31.                          
  32.                          out.println(message);
  33.                          Log.d("TCP", "C: Sent.");
  34.                      Log.d("TCP", "C: Done.");
  35.                      test();
  36.                          
  37.              } catch(Exception e) {
  38.                  Log.e("TCP", "S: Error", e);
  39.                       } finally {
  40.                         //socket.close();
  41.                       }
  42.          } catch (Exception e) {
  43.               Log.e("TCP", "C: Error", e);
  44.          }
  45.     }
  46. }
  47.  
Parsed in 0.042 seconds, using GeSHi 1.0.8.4


When I execute this function from the TCP Client Class it works. (See line after "C:Done")

Now I tried executing it from the SocketTest (activity)
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. import android.app.Activity;
  2. import android.os.Bundle;
  3.  
  4. public class SocketTest extends Activity {
  5.         private TCPClient tcpclient;
  6.        
  7.     public void onCreate(Bundle icicle) {
  8.         super.onCreate(icicle);
  9.         setContentView(R.layout.main);
  10.        
  11.  
  12.         Thread cThread = new Thread(new TCPClient());
  13.           cThread.start();
  14.          
  15.          tcpclient.test();
  16.     }
  17. }
Parsed in 0.037 seconds, using GeSHi 1.0.8.4



I get an Error Mesage on my device:
Sorry! The application TCPConnection (prozess com ....test) has stopped unexpectedly. Please try again.

What am I doing wrong?

Thanks a lot for your efforts!!
Laurid
Freshman
Freshman
 
Posts: 3
Joined: Sun Jan 24, 2010 1:53 pm

Postby zuper » Tue Feb 23, 2010 1:59 pm

Hello everyone!

Does exist alternatives of Socket on TCP communication between a Client Android and a Server Android or PC? Maybe RMI, corba or other strange protocols(I need Object transmission between Client & Server so i think that HTTP is not for me)?

Thanks to everyone
zuper
Once Poster
Once Poster
 
Posts: 1
Joined: Mon Feb 22, 2010 10:21 pm

Postby kaziu » Thu Feb 25, 2010 6:37 pm

Hello

I would like to know if it is possible to use Android client and C++ server to communicate via TCP protocol. Did someone do something like this?
kaziu
Once Poster
Once Poster
 
Posts: 1
Joined: Thu Feb 25, 2010 6:30 pm
Location: Szczecin [PL]

Postby Laurid » Tue Mar 02, 2010 8:16 am

Does nobody has a solution for my problem??
Laurid
Freshman
Freshman
 
Posts: 3
Joined: Sun Jan 24, 2010 1:53 pm

The post by zhufan and haugsrud helped in getting it to work

Postby roysamuel » Mon May 10, 2010 8:24 am

Hi..
I am setting up the client on the android and the server on my desktop PC.
After setting up the code, running the code returned

C: Connecting
C: error

on logcat.

However, after the change in the manifest file as mentioned in the post by zhufan

zhufan wrote::D ,I sovle the problem,
the modfication is necessary in the android.Manifest.xml,
<uses-permission android:name="android.permission.INTERNET" />


It worked.

The code needs to be changed like so : (this is mentioned in a prev. post....)
Code: Select all
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="com.android.TCP"
      android:versionCode="1"
      android:versionName="1.0.0">
         <uses-permission android:name="android.permission.INTERNET" />
    <application android:icon="@drawable/icon" android:label="@string/app_name">
        <activity android:label="@string/app_name" android:name="SocketTest">
         
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>
</manifest>
User avatar
roysamuel
Freshman
Freshman
 
Posts: 6
Joined: Tue Apr 20, 2010 8:20 am

Postby dickwan » Fri May 14, 2010 4:19 pm

zuper wrote:Hello everyone!

Does exist alternatives of Socket on TCP communication between a Client Android and a Server Android or PC? Maybe RMI, corba or other strange protocols(I need Object transmission between Client & Server so i think that HTTP is not for me)?

Thanks to everyone

Hi Zuper,

so far I know, android does not support RNI yet and so it goes with Corba. I think you can "stream" object between client (let us say emulator) and the server (your pc) by creating serializable class/objects.

I'm also working on C/S programming over socket with android as client. But what I want is to able able to remotely call server methods... Well I guess I would have to define the packet I stream so that the server reacts the proper way.
dickwan
Freshman
Freshman
 
Posts: 8
Joined: Sun Dec 27, 2009 11:39 pm

Re: Socket Programming

Postby wahaneebelly » Fri May 28, 2010 5:46 am

I wrote a script in Perl which displays the Outlook Folders but For socket programming, Python provides the socket module. It is a very common module and it's most likely that you have it. The socket module consists of the socket() function, which is used for socket initiation/creation. We will be primarily concerned with this function only, i.e. socket.socket. The socket module also provides several other methods.
[url=http://www.zoombits.co.uk/memory-cards/micro-sd]16gb micro sd cards[/url]
wahaneebelly
Freshman
Freshman
 
Posts: 4
Joined: Sat May 08, 2010 7:37 am

Re: Socket Programming

Postby DMacATTACK » Tue Jun 15, 2010 3:44 am

Hi all,
Since I learned how to establish a TCP client connection from this thread I thought I'd add to it. This thread creates a client that establishes a connection, sends data and then closes. I've worked with sockets before, and it is desirable to maintain a connection to the client, send data as you please, and disconnect. So I've done just that. I'm sorry if this concept has been posted by someone else, but I couldn't find the thread that does so. Also by having a persistent connection with a Connection timeout prevents your program from crashing when a connection is not found.

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. // Private variable
  2. private Socket socket;
  3.  
  4. try {
  5.                  InetSocketAddress remoteAddr = new InetSocketAddress("string of Server IP address",Port#);
  6.                          
  7.                  Log.d("TCP", "Connecting...");
  8.                
  9.                  socket = new Socket();
  10.                  socket.connect(remoteAddr, 1000);                               
  11.                    
  12.          } catch (Exception e) {
  13.               Log.e("TCP", "Error Connecting" + e);
  14.          }
  15.  
Parsed in 0.038 seconds, using GeSHi 1.0.8.4


This code snippet tries to connect to the server, and if no connection is made within 1000 milliseconds, the connection is timed out, and your program wont hang. Ive used the socket as a private variable, so that it can be accessed from a function.
In the examples I've seen in this thread use
Socket socket = new socket(IP address, port);

This creates the socket object AND connects it to the IP address and port. Mine creates it and allows the socket to send data with any amount of time in between, and then the connection can be closed at your leisure as well.

My other Change/ Issue I ran into when creating the TCP client had to do how I was writing data to the socket.
I did not want the line feed character at the end of my stream, and I found some methods that just don't work. See the code Below for the solution to this:

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. Printwriter out = new PrintWriter.....etc
  2. out.println("hello");
  3. /*
  4. * This writes "hello" followed by Line feed  (ASCII character 10)
  5. */
  6.  
  7.  
  8. Printwriter out = new PrintWriter.....etc
  9. out.print("hello");
  10. /*
  11. * This does not work. It should write "hello" not followed by any ASCII characters
  12. */
  13.  
  14. Printwriter out = new PrintWriter.....etc
  15. out.write("hello");
  16. /*
  17. * This does not work. It should write "hello" not followed by any ASCII characters
  18. */
  19.  
  20. // --------------- SOLUTION ------------------
  21. String strMessage = "Hello" + (char)13;
  22. byte[] arrByteMessage = strMessage.getBytes();
  23.  
  24. OutputStream output = socket.getOutputStream();
  25.                 output.write(arrByteMessage);
  26.  
  27. /*
  28. * This method performs the action I wanted "Hello" followed by Carriage Return (ASCII character 13)
  29. */
  30.  
  31.  
Parsed in 0.038 seconds, using GeSHi 1.0.8.4



I hope this Helps anyone,

- DMacATTACK -
User avatar
DMacATTACK
Experienced Developer
Experienced Developer
 
Posts: 58
Joined: Thu Dec 31, 2009 6:31 pm
Location: Canada

Re: Socket Programming

Postby hsonbk » Tue Sep 28, 2010 7:35 am

Hi guys
I'm a new user and sorry for digging this thread
I'm having a same old problem.
Here it is: I want to establish a socket connection between client (run on Android emulator) and server (run on PC)
The code on my client is liked:

public static String serverIP = "10.0.2.2";
public static int serverPort = 3725;
InetAddress serverAddr = InetAddress.getByName(serverIP);
Socket socket = new Socket(serverAddr, serverPort);

and on server:

ServerSocket myServer = new ServerSocket(3725);

I tried redir ports too, like the following:
telnet localhost 5554
redir add tcp:3725:3725
and check with redir list, everything's fine

But it didn't work. I got exception at "Socket socket = new Socket(serverAddr, serverPort);" and I really dont know why. :(
Please help, thanks very much.
hsonbk
Once Poster
Once Poster
 
Posts: 1
Joined: Tue Sep 28, 2010 7:24 am

Top
PreviousNext

Return to General

Who is online

Users browsing this forum: No registered users and 4 guests