├── README.md
├── SimpleServer-Socket
├── .classpath
├── .project
├── .settings
│ └── org.eclipse.jdt.core.prefs
└── src
│ └── test
│ └── Sockettest
│ ├── Mensaje_data.java
│ └── Server.java
└── Socket-Client
├── .classpath
├── .project
├── AndroidManifest.xml
├── bin
├── Socket-Client.apk
├── classes.dex
└── resources.ap_
├── default.properties
├── proguard.cfg
├── res
├── drawable-hdpi
│ └── icon.png
├── drawable-ldpi
│ ├── icon.png
│ ├── off.png
│ ├── on.png
│ └── warn.png
├── drawable-mdpi
│ └── icon.png
├── layout
│ └── main.xml
└── values
│ └── strings.xml
└── src
└── test
└── Sockettest
├── Mensaje_data.java
└── Sockettest.java
/README.md:
--------------------------------------------------------------------------------
1 | Sockets-en-Android-Server
2 | =========================
3 |
4 | Codigo fuente utilizado en el Tutorial de Sockets
5 |
6 | Creado por Sebastian Cipolat Buenos Aires Argentina
7 |
8 | Tutorial disponible:
9 | http://androideity.com/2012/08/05/sockets-en-android/
10 |
--------------------------------------------------------------------------------
/SimpleServer-Socket/.classpath:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/SimpleServer-Socket/.project:
--------------------------------------------------------------------------------
1 |
2 |
3 | SimpleServer-Socket
4 |
5 |
6 |
7 |
8 |
9 | org.eclipse.jdt.core.javabuilder
10 |
11 |
12 |
13 |
14 |
15 | org.eclipse.jdt.core.javanature
16 |
17 |
18 |
--------------------------------------------------------------------------------
/SimpleServer-Socket/.settings/org.eclipse.jdt.core.prefs:
--------------------------------------------------------------------------------
1 | #Sat May 21 18:22:58 ART 2011
2 | eclipse.preferences.version=1
3 | org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
4 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
5 | org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
6 | org.eclipse.jdt.core.compiler.compliance=1.6
7 | org.eclipse.jdt.core.compiler.debug.lineNumber=generate
8 | org.eclipse.jdt.core.compiler.debug.localVariable=generate
9 | org.eclipse.jdt.core.compiler.debug.sourceFile=generate
10 | org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
11 | org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
12 | org.eclipse.jdt.core.compiler.source=1.6
13 |
--------------------------------------------------------------------------------
/SimpleServer-Socket/src/test/Sockettest/Mensaje_data.java:
--------------------------------------------------------------------------------
1 | package test.Sockettest;
2 |
3 | import java.io.Serializable;
4 |
5 | public class Mensaje_data implements Serializable{
6 | private static final long serialVersionUID = 9178463713495654837L;
7 |
8 | public int Action;
9 | public String texto;
10 | public boolean last_msg=false;
11 |
12 | }
13 |
--------------------------------------------------------------------------------
/SimpleServer-Socket/src/test/Sockettest/Server.java:
--------------------------------------------------------------------------------
1 | package test.Sockettest;
2 |
3 | /* SERVIDOR
4 | * Creado por Sebastian Cipolat
5 | * */
6 |
7 | import java.io.IOException;
8 | import java.io.ObjectInputStream;
9 | import java.io.ObjectOutputStream;
10 | import java.net.ServerSocket;
11 | import java.net.Socket;
12 |
13 | public class Server {
14 | Socket skCliente;
15 | ServerSocket skServidor;
16 | String datareceived, substring1, substring2;
17 | final int PUERTO = 5555;// Puerto que utilizara el servidor utilizar este
18 | // mismo en el cliente
19 | String IP_client;
20 | Mensaje_data mdata = null;
21 | ObjectOutputStream oos = null;
22 | String TimeStamp;
23 |
24 | Server() {
25 |
26 | try {
27 | System.out.println("************ SERVER ****************");
28 | // creamos server socket
29 | skServidor = new ServerSocket(PUERTO);
30 | System.out.println("Escuchando el puerto " + PUERTO);
31 | System.out.println("En Espera....");
32 |
33 | TimeStamp = new java.util.Date().toString();
34 |
35 | try {
36 | // Creamos socket para manejar conexion con cliente
37 | skCliente = skServidor.accept(); // esperamos al cliente
38 | // una vez q se conecto obtenemos la ip
39 | IP_client = skCliente.getInetAddress().toString();
40 | System.out.println("[" + TimeStamp + "] Conectado al cliente "
41 | + "IP:" + IP_client);
42 |
43 | while (true) {
44 | // Manejamos flujo de Entrada
45 | ObjectInputStream ois = new ObjectInputStream(
46 | skCliente.getInputStream());
47 | // Cremos un Objeto con lo recibido del cliente
48 | Object aux = ois.readObject();// leemos objeto
49 |
50 | // si el objeto es una instancia de Mensaje_data
51 | if (aux instanceof Mensaje_data) {
52 | // casteamos el objeto
53 | mdata = (Mensaje_data) aux;
54 |
55 | // Analizamos el mensaje recibido
56 | // si no es el mensaje FINAL
57 | if (!mdata.last_msg) {
58 |
59 | // Es un mensaje de Accion
60 | if (mdata.Action != -1) {
61 | // exec accion
62 | Exec(mdata.Action);
63 | System.out.println("[" + TimeStamp + "] "
64 | + "Ejecutar Accion " + mdata.Action
65 | + " [" + IP_client + "]");
66 | } else {
67 | // No es un mensaje de accion entonces es de
68 | // texto
69 | System.out.println("[" + TimeStamp + "] "
70 | + "Mensaje de [" + IP_client + "]--> "
71 | + mdata.texto);
72 | }
73 | } else {// cerramos socket
74 | skCliente.close();
75 | ois.close();
76 | System.out
77 | .println("["
78 | + TimeStamp
79 | + "] Last_msg detected Conexion cerrada, gracias vuelva pronto");
80 | break;
81 | }
82 | } else {
83 | // Si no es del tipo esperado, se marca error
84 | System.err.println("Mensaje no esperado ");
85 | }
86 | }
87 | } catch (Exception e) {
88 | e.printStackTrace();
89 | System.out.println("[" + TimeStamp + "] Error ");
90 | }
91 | } catch (Exception e) {
92 | e.printStackTrace();
93 | System.out.println("[" + TimeStamp + "] Error ");
94 | }
95 | }
96 |
97 | // en base al codigo de accion recibido realizaremos una accion
98 | public void Exec(int action_num) {
99 | String ACTNUM = null;
100 | String ACT1 = "vlc";// abrir VLC
101 | String ACT2 = "/opt/google/chrome/google-chrome %U";// Chrome
102 | String ACT3 = "gnome-terminal";// terminal
103 | String ACT4 = "";
104 |
105 | try {
106 | switch (action_num) {
107 | case 1: {
108 | ACTNUM = ACT1;
109 | break;
110 | }
111 | case 2: {
112 | ACTNUM = ACT2;
113 | break;
114 | }
115 | case 3: {
116 | ACTNUM = ACT3;
117 | break;
118 | }
119 | case 4: {
120 | ACTNUM =ACT4;
121 | break;
122 | }
123 | default:{
124 | System.out.println("EXEC Error invalid parameter:"+ACTNUM);
125 | ACTNUM=null;
126 |
127 | break;
128 | }
129 | }
130 | //Realizamos la accion
131 | Process p = Runtime.getRuntime().exec (ACTNUM);
132 | }
133 | catch (Exception e)
134 | {
135 | /* Se lanza una excepción si no se encuentra en ejecutable o el fichero no es ejecutable. */
136 | System.out.println("EXEC Error "+e);
137 | }
138 | }
139 | public static void main(String[] args) {
140 | new Server();
141 | }
142 | }
--------------------------------------------------------------------------------
/Socket-Client/.classpath:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Socket-Client/.project:
--------------------------------------------------------------------------------
1 |
2 |
3 | Socket-Client
4 |
5 |
6 |
7 |
8 |
9 | com.android.ide.eclipse.adt.ResourceManagerBuilder
10 |
11 |
12 |
13 |
14 | com.android.ide.eclipse.adt.PreCompilerBuilder
15 |
16 |
17 |
18 |
19 | org.eclipse.jdt.core.javabuilder
20 |
21 |
22 |
23 |
24 | com.android.ide.eclipse.adt.ApkBuilder
25 |
26 |
27 |
28 |
29 |
30 | com.android.ide.eclipse.adt.AndroidNature
31 | org.eclipse.jdt.core.javanature
32 |
33 |
34 |
--------------------------------------------------------------------------------
/Socket-Client/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/Socket-Client/bin/Socket-Client.apk:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Androideity/Sockets-en-Android-Server/2eecff1712fc50fc5d8dbfc2dce83010f384b8b6/Socket-Client/bin/Socket-Client.apk
--------------------------------------------------------------------------------
/Socket-Client/bin/classes.dex:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Androideity/Sockets-en-Android-Server/2eecff1712fc50fc5d8dbfc2dce83010f384b8b6/Socket-Client/bin/classes.dex
--------------------------------------------------------------------------------
/Socket-Client/bin/resources.ap_:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Androideity/Sockets-en-Android-Server/2eecff1712fc50fc5d8dbfc2dce83010f384b8b6/Socket-Client/bin/resources.ap_
--------------------------------------------------------------------------------
/Socket-Client/default.properties:
--------------------------------------------------------------------------------
1 | # This file is automatically generated by Android Tools.
2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED!
3 | #
4 | # This file must be checked in Version Control Systems.
5 | #
6 | # To customize properties used by the Ant build system use,
7 | # "build.properties", and override values to adapt the script to your
8 | # project structure.
9 |
10 | # Project target.
11 | target=android-8
12 |
--------------------------------------------------------------------------------
/Socket-Client/proguard.cfg:
--------------------------------------------------------------------------------
1 | -optimizationpasses 5
2 | -dontusemixedcaseclassnames
3 | -dontskipnonpubliclibraryclasses
4 | -dontpreverify
5 | -verbose
6 | -optimizations !code/simplification/arithmetic,!field/*,!class/merging/*
7 |
8 | -keep public class * extends android.app.Activity
9 | -keep public class * extends android.app.Application
10 | -keep public class * extends android.app.Service
11 | -keep public class * extends android.content.BroadcastReceiver
12 | -keep public class * extends android.content.ContentProvider
13 | -keep public class com.android.vending.licensing.ILicensingService
14 |
15 | -keepclasseswithmembernames class * {
16 | native ;
17 | }
18 |
19 | -keepclasseswithmembernames class * {
20 | public (android.content.Context, android.util.AttributeSet);
21 | }
22 |
23 | -keepclasseswithmembernames class * {
24 | public (android.content.Context, android.util.AttributeSet, int);
25 | }
26 |
27 | -keepclassmembers enum * {
28 | public static **[] values();
29 | public static ** valueOf(java.lang.String);
30 | }
31 |
32 | -keep class * implements android.os.Parcelable {
33 | public static final android.os.Parcelable$Creator *;
34 | }
35 |
--------------------------------------------------------------------------------
/Socket-Client/res/drawable-hdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Androideity/Sockets-en-Android-Server/2eecff1712fc50fc5d8dbfc2dce83010f384b8b6/Socket-Client/res/drawable-hdpi/icon.png
--------------------------------------------------------------------------------
/Socket-Client/res/drawable-ldpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Androideity/Sockets-en-Android-Server/2eecff1712fc50fc5d8dbfc2dce83010f384b8b6/Socket-Client/res/drawable-ldpi/icon.png
--------------------------------------------------------------------------------
/Socket-Client/res/drawable-ldpi/off.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Androideity/Sockets-en-Android-Server/2eecff1712fc50fc5d8dbfc2dce83010f384b8b6/Socket-Client/res/drawable-ldpi/off.png
--------------------------------------------------------------------------------
/Socket-Client/res/drawable-ldpi/on.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Androideity/Sockets-en-Android-Server/2eecff1712fc50fc5d8dbfc2dce83010f384b8b6/Socket-Client/res/drawable-ldpi/on.png
--------------------------------------------------------------------------------
/Socket-Client/res/drawable-ldpi/warn.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Androideity/Sockets-en-Android-Server/2eecff1712fc50fc5d8dbfc2dce83010f384b8b6/Socket-Client/res/drawable-ldpi/warn.png
--------------------------------------------------------------------------------
/Socket-Client/res/drawable-mdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Androideity/Sockets-en-Android-Server/2eecff1712fc50fc5d8dbfc2dce83010f384b8b6/Socket-Client/res/drawable-mdpi/icon.png
--------------------------------------------------------------------------------
/Socket-Client/res/layout/main.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
15 |
16 |
17 |
26 |
27 |
28 |
35 |
36 |
45 |
46 |
51 |
52 |
53 |
54 |
61 |
62 |
70 |
71 |
76 |
77 |
78 |
79 |
80 |
86 |
87 |
93 |
94 |
104 |
109 |
110 |
111 |
112 |
113 |
114 |
121 |
130 |
131 |
138 |
146 |
154 |
155 |
156 |
157 |
158 |
159 |
160 |
161 |
167 |
168 |
175 |
176 |
183 |
190 |
197 |
198 |
199 |
200 |
201 |
207 |
208 |
209 |
216 |
217 |
218 |
219 |
220 |
221 |
222 |
--------------------------------------------------------------------------------
/Socket-Client/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Hello World, Sockettest!
4 | Sockettest
5 |
6 |
--------------------------------------------------------------------------------
/Socket-Client/src/test/Sockettest/Mensaje_data.java:
--------------------------------------------------------------------------------
1 | package test.Sockettest;
2 |
3 | import java.io.Serializable;
4 |
5 | public class Mensaje_data implements Serializable{
6 |
7 | private static final long serialVersionUID = 9178463713495654837L;
8 |
9 | public int Action;
10 | public String texto;
11 | public boolean last_msg=false;
12 |
13 | }
14 |
--------------------------------------------------------------------------------
/Socket-Client/src/test/Sockettest/Sockettest.java:
--------------------------------------------------------------------------------
1 | package test.Sockettest;
2 |
3 | import java.io.IOException;
4 | import java.io.ObjectInputStream;
5 | import java.io.ObjectOutputStream;
6 | import java.io.StreamCorruptedException;
7 | import java.net.Socket;
8 |
9 | import android.app.Activity;
10 | import android.graphics.Color;
11 | import android.os.Bundle;
12 | import android.util.Log;
13 | import android.view.View;
14 | import android.view.View.OnClickListener;
15 | import android.widget.Button;
16 | import android.widget.EditText;
17 | import android.widget.ImageView;
18 | import android.widget.TextView;
19 |
20 | /* cliente*/
21 | public class Sockettest extends Activity {
22 | /** Called when the activity is first created. */
23 |
24 | private Button btconect, btdisconect, btsndtxt, btnizq, btnder, bt1, bt2,
25 | bt3, bt4;
26 | private TextView txtstatus;
27 | private EditText ipinput, portinput, input_txt;
28 | private ImageView leds;
29 | Socket miCliente;
30 |
31 | private boolean connected = false;
32 | ObjectOutputStream oos;
33 | ObjectInputStream ois;
34 | Mensaje_data mdata;
35 |
36 | @Override
37 | public void onCreate(Bundle savedInstanceState) {
38 | super.onCreate(savedInstanceState);
39 | setContentView(R.layout.main);
40 |
41 | leds = (ImageView) findViewById(R.id.leds);
42 |
43 | ipinput = (EditText) findViewById(R.id.ipinput);
44 | portinput = (EditText) findViewById(R.id.portinput);
45 | input_txt = (EditText) findViewById(R.id.input_txt);
46 |
47 | btconect = (Button) findViewById(R.id.btcnt);
48 | btdisconect = (Button) findViewById(R.id.btdisc);
49 | btsndtxt = (Button) findViewById(R.id.sndtxt);
50 |
51 | bt1 = (Button) findViewById(R.id.bt1);
52 | bt2 = (Button) findViewById(R.id.bt2);
53 | bt3 = (Button) findViewById(R.id.bt3);
54 | bt4 = (Button) findViewById(R.id.bt4);
55 |
56 | txtstatus = (TextView) findViewById(R.id.txtstatus);
57 | //Al clickear en conectar
58 | btconect.setOnClickListener(new OnClickListener() {
59 | @Override
60 | // conectar
61 | public void onClick(View v) {
62 | //Nos conectamos y obtenemos el estado de la conexion
63 | boolean conectstatus = Connect();
64 | //si nos pudimos conectar
65 | if (conectstatus) {//mostramos mensaje
66 | Set_txtstatus("Conexion OK ", 1);
67 | Change_leds(true);//camiamos img a verde
68 |
69 | } else {//error al conectarse
70 | Change_leds(false);//camiamos img a rojo
71 | //mostramos msg de error
72 | Set_txtstatus("Error.. ", 0);
73 | }
74 | }
75 | });
76 | //Al clickear en desconectar
77 | btdisconect.setOnClickListener(new OnClickListener() {
78 | @Override
79 | public void onClick(View v) {
80 | Disconnect();
81 | }
82 | });
83 |
84 | btsndtxt.setOnClickListener(new OnClickListener() {
85 | @Override
86 | public void onClick(View v) {
87 | Snd_txt_Msg(input_txt.getText().toString());
88 | }
89 | });
90 | //Botones de Accion
91 | bt1.setOnClickListener(new OnClickListener() {
92 | @Override
93 | public void onClick(View v) {
94 | Snd_Action(1);
95 | }
96 | });
97 |
98 | bt2.setOnClickListener(new OnClickListener() {
99 | @Override
100 | public void onClick(View v) {
101 | Snd_Action(2);
102 | }
103 | });
104 |
105 | bt3.setOnClickListener(new OnClickListener() {
106 | @Override
107 | public void onClick(View v) {
108 | Snd_Action(3);
109 | }
110 | });
111 |
112 | bt4.setOnClickListener(new OnClickListener() {
113 | @Override
114 | public void onClick(View v) {
115 | Snd_Action(4);
116 | }
117 | });
118 | /************/
119 | }
120 | //cambia el imageview segun status
121 | public void Change_leds(boolean status) {
122 | if (status)
123 | leds.setImageResource(R.drawable.on);
124 | else
125 | leds.setImageResource(R.drawable.off);
126 | }
127 |
128 | /*Cambiamos texto de txtstatus segun parametro flag_status
129 | * flag_status 0 error, 1 ok*/
130 | public void Set_txtstatus(String txt, int flag_status) {
131 | // cambiel color
132 | if (flag_status == 0) {
133 | txtstatus.setTextColor(Color.RED);
134 | } else {
135 | txtstatus.setTextColor(Color.GREEN);
136 | }
137 | txtstatus.setText(txt);
138 | }
139 |
140 | //Conectamos
141 | public boolean Connect() {
142 | //Obtengo datos ingresados en campos
143 | String IP = ipinput.getText().toString();
144 | int PORT = Integer.valueOf(portinput.getText().toString());
145 |
146 | try {//creamos sockets con los valores anteriores
147 | miCliente = new Socket(IP, PORT);
148 | //si nos conectamos
149 | if (miCliente.isConnected() == true) {
150 | return true;
151 | } else {
152 | return false;
153 | }
154 | } catch (Exception e) {
155 | //Si hubo algun error mostrmos error
156 | txtstatus.setTextColor(Color.RED);
157 | txtstatus.setText(" !!! ERROR !!!");
158 | Log.e("Error connect()", "" + e);
159 | return false;
160 | }
161 | }
162 |
163 | //Metodo de desconexion
164 | public void Disconnect() {
165 | try {
166 | //Prepramos mensaje de desconexion
167 | Mensaje_data msgact = new Mensaje_data();
168 | msgact.texto = "";
169 | msgact.Action = -1;
170 | msgact.last_msg = true;
171 | //avisamos al server que cierre el canal
172 | boolean val_acc = Snd_Msg(msgact);
173 |
174 | if (!val_acc) {//hubo un error
175 | Set_txtstatus(" Error ", 0);
176 | Change_leds(false);
177 | Log.e("Disconnect() -> ", "!ERROR!");
178 |
179 | } else {//ok nos desconectamos
180 | Set_txtstatus("Desconectado", 0);
181 | //camibmos led a rojo
182 | Change_leds(false);
183 | Log.e("Disconnect() -> ", "!ok!");
184 | //cerramos socket
185 | miCliente.close();
186 | }
187 | } catch (IOException e) {
188 | // TODO Auto-generated catch block
189 | e.printStackTrace();
190 | }
191 |
192 | if (!miCliente.isConnected())
193 | Change_leds(false);
194 | }
195 |
196 | //Enviamos mensaje de accion segun el boton q presionamos
197 | public void Snd_Action(int bt) {
198 | Mensaje_data msgact = new Mensaje_data();
199 | //no hay texto
200 | msgact.texto = "";
201 | //seteo en el valor action el numero de accion
202 | msgact.Action = bt;
203 | //no es el ultimo msg
204 | msgact.last_msg = false;
205 | //mando msg
206 | boolean val_acc = Snd_Msg(msgact);
207 | //error al enviar
208 | if (!val_acc) {
209 | Set_txtstatus(" Error ", 0);
210 | Change_leds(false);
211 | Log.e("Snd_Action() -> ", "!ERROR!");
212 |
213 | }
214 |
215 | if (!miCliente.isConnected())
216 | Change_leds(false);
217 | }
218 |
219 | //Envio mensaje de texto
220 | public void Snd_txt_Msg(String txt) {
221 |
222 | Mensaje_data mensaje = new Mensaje_data();
223 | //seteo en texto el parametro recibido por txt
224 | mensaje.texto = txt;
225 | //action -1 no es mensaje de accion
226 | mensaje.Action = -1;
227 | //no es el ultimo msg
228 | mensaje.last_msg = false;
229 | //mando msg
230 | boolean val_acc = Snd_Msg(mensaje);
231 | //error al enviar
232 | if (!val_acc) {
233 | Set_txtstatus(" Error ", 0);
234 | Change_leds(false);
235 | Log.e("Snd_txt_Msg() -> ", "!ERROR!");
236 | }
237 | if (!miCliente.isConnected())
238 | Change_leds(false);
239 | }
240 |
241 | /*Metodo para enviar mensaje por socket
242 | *recibe como parmetro un objeto Mensaje_data
243 | *retorna boolean segun si se pudo establecer o no la conexion
244 | */
245 | public boolean Snd_Msg(Mensaje_data msg) {
246 |
247 | try {
248 | //Accedo a flujo de salida
249 | oos = new ObjectOutputStream(miCliente.getOutputStream());
250 | //creo objeto mensaje
251 | Mensaje_data mensaje = new Mensaje_data();
252 |
253 | if (miCliente.isConnected())// si la conexion continua
254 | {
255 | //lo asocio al mensaje recibido
256 | mensaje = msg;
257 | //Envio mensaje por flujo
258 | oos.writeObject(mensaje);
259 | //envio ok
260 | return true;
261 |
262 | } else {//en caso de que no halla conexion al enviar el msg
263 | Set_txtstatus("Error...", 0);//error
264 | return false;
265 | }
266 |
267 | } catch (IOException e) {// hubo algun error
268 | Log.e("Snd_Msg() ERROR -> ", "" + e);
269 |
270 | return false;
271 | }
272 | }
273 | }
--------------------------------------------------------------------------------