¡@

Home 

2014/10/16 ¤W¤È 08:24:33

android Programming Glossary: socket

Secure HTTP Post in Android

http://stackoverflow.com/questions/2253061/secure-http-post-in-android

to use a different port EDIT I indeed registered the wrong socket factory for https communication. Here is the updated method.. that I use to create my HttpClient object with the correct socket factory just in case someone searches this kind of problem in..

How to prevent Android bluetooth RFCOMM connection from dying immediately after .connect()?

http://stackoverflow.com/questions/2660968/how-to-prevent-android-bluetooth-rfcomm-connection-from-dying-immediately-after

version which first waits for ACL_CONNECTED and then opens socket but there's nothing new in its behaviour. Some background info..

Custom SSL handling stopped working on Android 2.2 FroYo

http://stackoverflow.com/questions/2899079/custom-ssl-handling-stopped-working-on-android-2-2-froyo

connections with the HttpClient I am using a custom SSL socket factory implementation to make sure self signed certificates.. Seesmic developer willing to share the fix In the custom socket factory the socket creation with createSocket has apparently.. willing to share the fix In the custom socket factory the socket creation with createSocket has apparently been changed specifically..

Apache HttpClient on Android producing CertPathValidatorException (IssuerName != SubjectName)

http://stackoverflow.com/questions/4115101/apache-httpclient-on-android-producing-certpathvalidatorexception-issuername

java.net.Socket public boolean isSecure Socket socket throws IllegalArgumentException return true @see org.apache.http.conn.scheme.LayeredSocketFactory#createSocket.. int boolean public Socket createSocket Socket socket String host int port boolean autoClose throws IOException.. return getSSLContext .getSocketFactory .createSocket socket host port autoClose javadoc in org.apache.http.conn.scheme.SocketFactory..

Connecting 2 Emulator instances In Android

http://stackoverflow.com/questions/4683854/connecting-2-emulator-instances-in-android

new InetSocketAddress 10.0.2.15 4444 while true Socket socket serverSocket.accept tv.setText Connected... And code for Client.. onClick View v TODO Auto generated method stub try Socket socket new Socket 10.0.2.2 4445 catch UnknownHostException e TODO Auto.. in either the server or client. I opened the server socket differently and had the comms handled in a separate thread...

How to set HttpResponse timeout for Android in Java

http://stackoverflow.com/questions/693997/how-to-set-httpresponse-timeout-for-android-in-java

Socket is not connected and the socket timeout java.net.SocketTimeoutException The operation timed.. httpParameters timeoutConnection Set the default socket timeout SO_TIMEOUT in milliseconds which is the timeout for..

Handler vs AsyncTask vs Thread

http://stackoverflow.com/questions/6964011/handler-vs-asynctask-vs-thread

abstractions of AsyncTasks. However I would like to have a socket connection run in a service. Should this be run in a handler..

Custom SSL handling stopped working on Android 2.2 FroYo

http://stackoverflow.com/questions/2899079/custom-ssl-handling-stopped-working-on-android-2-2-froyo

SchemeRegistry registry.register new Scheme http new PlainSocketFactory 80 registry.register new Scheme https trustAll new FakeSocketFactory.. 80 registry.register new Scheme https trustAll new FakeSocketFactory SSLSocketFactory.getSocketFactory 443 client new DefaultHttpClient.. new Scheme https trustAll new FakeSocketFactory SSLSocketFactory.getSocketFactory 443 client new DefaultHttpClient new..

Apache HttpClient on Android producing CertPathValidatorException (IssuerName != SubjectName)

http://stackoverflow.com/questions/4115101/apache-httpclient-on-android-producing-certpathvalidatorexception-issuername

new SchemeRegistry registry.register new Scheme http PlainSocketFactory.getSocketFactory 80 Register for port 443 our SSLSocketFactory.. registry.register new Scheme http PlainSocketFactory.getSocketFactory 80 Register for port 443 our SSLSocketFactory with our.. 80 Register for port 443 our SSLSocketFactory with our keystore to the ConnectionManager registry.register..

Connecting 2 Emulator instances In Android

http://stackoverflow.com/questions/4683854/connecting-2-emulator-instances-in-android

Called when the activity is first created. private ServerSocket serverSocket null private TextView tv public static final int.. the activity is first created. private ServerSocket serverSocket null private TextView tv public static final int SERVERPORT.. public void Connect throws IOException serverSocket new ServerSocket serverSocket.bind new InetSocketAddress 10.0.2.15..

Where to stop/destroy threads in Android Service class?

http://stackoverflow.com/questions/680180/where-to-stop-destroy-threads-in-android-service-class

Thread.sleep 1000 continue Log.d TCP C Connecting... Socket socket new Socket socket.setTcpNoDelay true socket.connect.. continue Log.d TCP C Connecting... Socket socket new Socket socket.setTcpNoDelay true socket.connect new InetSocketAddress.. Socket socket.setTcpNoDelay true socket.connect new InetSocketAddress serverAddress portNumber 3000 socket.connect new InetSocketAddress..

How to set HttpResponse timeout for Android in Java

http://stackoverflow.com/questions/693997/how-to-set-httpresponse-timeout-for-android-in-java

timeouts are set. The connection timeout throws java.net.SocketTimeoutException Socket is not connected and the socket timeout.. connection timeout throws java.net.SocketTimeoutException Socket is not connected and the socket timeout java.net.SocketTimeoutException.. Socket is not connected and the socket timeout java.net.SocketTimeoutException The operation timed out . HttpGet httpGet new..

Https Connection Android

http://stackoverflow.com/questions/995514/https-connection-android

schemeRegistry.register new Scheme http PlainSocketFactory.getSocketFactory 80 schemeRegistry.register new Scheme.. new Scheme http PlainSocketFactory.getSocketFactory 80 schemeRegistry.register new Scheme https new CustomSSLSocketFactory.. 80 schemeRegistry.register new Scheme https new CustomSSLSocketFactory 443 ThreadSafeClientConnManager cm new ThreadSafeClientConnManager..

Secure HTTP Post in Android

http://stackoverflow.com/questions/2253061/secure-http-post-in-android

s to tell it to use HTTPS Do I have to explicitly tell it to use a different port EDIT I indeed registered the wrong socket factory for https communication. Here is the updated method that I use to create my HttpClient object with the correct socket.. factory for https communication. Here is the updated method that I use to create my HttpClient object with the correct socket factory just in case someone searches this kind of problem in the future private HttpClient createHttpClient HttpParams..

How to prevent Android bluetooth RFCOMM connection from dying immediately after .connect()?

http://stackoverflow.com/questions/2660968/how-to-prevent-android-bluetooth-rfcomm-connection-from-dying-immediately-after

to disconnect after 5 seconds. And yes I do have third version which first waits for ACL_CONNECTED and then opens socket but there's nothing new in its behaviour. Some background info I can connect to the Zeemote from my laptop perfectly fine..

Custom SSL handling stopped working on Android 2.2 FroYo

http://stackoverflow.com/questions/2899079/custom-ssl-handling-stopped-working-on-android-2-2-froyo

via HTTP and optionally securely via HTTPS. For these HTTPS connections with the HttpClient I am using a custom SSL socket factory implementation to make sure self signed certificates are working. Basically I accept everything and ignore every.. Here is the answer with many many thanks to a helpful Seesmic developer willing to share the fix In the custom socket factory the socket creation with createSocket has apparently been changed specifically for the SSLSocketFactory implementation... answer with many many thanks to a helpful Seesmic developer willing to share the fix In the custom socket factory the socket creation with createSocket has apparently been changed specifically for the SSLSocketFactory implementation. So the old..

Apache HttpClient on Android producing CertPathValidatorException (IssuerName != SubjectName)

http://stackoverflow.com/questions/4115101/apache-httpclient-on-android-producing-certpathvalidatorexception-issuername

@see org.apache.http.conn.scheme.SocketFactory#isSecure java.net.Socket public boolean isSecure Socket socket throws IllegalArgumentException return true @see org.apache.http.conn.scheme.LayeredSocketFactory#createSocket java.net.Socket.. java.net.Socket java.lang.String int boolean public Socket createSocket Socket socket String host int port boolean autoClose throws IOException UnknownHostException return getSSLContext .getSocketFactory.. boolean autoClose throws IOException UnknownHostException return getSSLContext .getSocketFactory .createSocket socket host port autoClose javadoc in org.apache.http.conn.scheme.SocketFactory says Both Object.equals and Object.hashCode..

Connecting 2 Emulator instances In Android

http://stackoverflow.com/questions/4683854/connecting-2-emulator-instances-in-android

IOException serverSocket new ServerSocket serverSocket.bind new InetSocketAddress 10.0.2.15 4444 while true Socket socket serverSocket.accept tv.setText Connected... And code for Client public class ClientActivity extends Activity Called when.. bt.setOnClickListener new OnClickListener public void onClick View v TODO Auto generated method stub try Socket socket new Socket 10.0.2.2 4445 catch UnknownHostException e TODO Auto generated catch block tv.setText Error1 e.printStackTrace.. after a while. I didn't make any reference at all to 10.0.2.15 in either the server or client. I opened the server socket differently and had the comms handled in a separate thread. I ran the server on emulator 5554 and the client on 5556. My..

How to set HttpResponse timeout for Android in Java

http://stackoverflow.com/questions/693997/how-to-set-httpresponse-timeout-for-android-in-java

two timeouts are set. The connection timeout throws java.net.SocketTimeoutException Socket is not connected and the socket timeout java.net.SocketTimeoutException The operation timed out . HttpGet httpGet new HttpGet url HttpParams httpParameters.. int timeoutConnection 3000 HttpConnectionParams.setConnectionTimeout httpParameters timeoutConnection Set the default socket timeout SO_TIMEOUT in milliseconds which is the timeout for waiting for data. int timeoutSocket 5000 HttpConnectionParams.setSoTimeout..

Handler vs AsyncTask vs Thread

http://stackoverflow.com/questions/6964011/handler-vs-asynctask-vs-thread

the UI provide more basic threading and you miss all the abstractions of AsyncTasks. However I would like to have a socket connection run in a service. Should this be run in a handler or a thread or even an asynctask UI interaction is not necessary..

Custom SSL handling stopped working on Android 2.2 FroYo

http://stackoverflow.com/questions/2899079/custom-ssl-handling-stopped-working-on-android-2-2-froyo

how I initialize the HttpClient SchemeRegistry registry new SchemeRegistry registry.register new Scheme http new PlainSocketFactory 80 registry.register new Scheme https trustAll new FakeSocketFactory SSLSocketFactory.getSocketFactory 443 client.. registry.register new Scheme http new PlainSocketFactory 80 registry.register new Scheme https trustAll new FakeSocketFactory SSLSocketFactory.getSocketFactory 443 client new DefaultHttpClient new ThreadSafeClientConnManager httpParams registry.. new Scheme http new PlainSocketFactory 80 registry.register new Scheme https trustAll new FakeSocketFactory SSLSocketFactory.getSocketFactory 443 client new DefaultHttpClient new ThreadSafeClientConnManager httpParams registry httpParams..

Apache HttpClient on Android producing CertPathValidatorException (IssuerName != SubjectName)

http://stackoverflow.com/questions/4115101/apache-httpclient-on-android-producing-certpathvalidatorexception-issuername

createClientConnectionManager SchemeRegistry registry new SchemeRegistry registry.register new Scheme http PlainSocketFactory.getSocketFactory 80 Register for port 443 our SSLSocketFactory with our keystore to the ConnectionManager registry.register.. SchemeRegistry registry new SchemeRegistry registry.register new Scheme http PlainSocketFactory.getSocketFactory 80 Register for port 443 our SSLSocketFactory with our keystore to the ConnectionManager registry.register new Scheme.. SchemeRegistry registry.register new Scheme http PlainSocketFactory.getSocketFactory 80 Register for port 443 our SSLSocketFactory with our keystore to the ConnectionManager registry.register new Scheme https newSslSocketFactory 443 return new..

Connecting 2 Emulator instances In Android

http://stackoverflow.com/questions/4683854/connecting-2-emulator-instances-in-android

code for Server public class ServerActivity extends Activity Called when the activity is first created. private ServerSocket serverSocket null private TextView tv public static final int SERVERPORT 4444 @Override public void onCreate Bundle savedInstanceState.. public class ServerActivity extends Activity Called when the activity is first created. private ServerSocket serverSocket null private TextView tv public static final int SERVERPORT 4444 @Override public void onCreate Bundle savedInstanceState.. Auto generated catch block tv.setText Not connected e.printStackTrace public void Connect throws IOException serverSocket new ServerSocket serverSocket.bind new InetSocketAddress 10.0.2.15 4444 while true Socket socket serverSocket.accept tv.setText..

Where to stop/destroy threads in Android Service class?

http://stackoverflow.com/questions/680180/where-to-stop-destroy-threads-in-android-service-class

void doSendData while true try if Measurements.isEmpty Thread.sleep 1000 continue Log.d TCP C Connecting... Socket socket new Socket socket.setTcpNoDelay true socket.connect new InetSocketAddress serverAddress portNumber 3000 socket.connect.. while true try if Measurements.isEmpty Thread.sleep 1000 continue Log.d TCP C Connecting... Socket socket new Socket socket.setTcpNoDelay true socket.connect new InetSocketAddress serverAddress portNumber 3000 socket.connect new InetSocketAddress.. continue Log.d TCP C Connecting... Socket socket new Socket socket.setTcpNoDelay true socket.connect new InetSocketAddress serverAddress portNumber 3000 socket.connect new InetSocketAddress serverAddress portNumber if socket.isConnected..

How to set HttpResponse timeout for Android in Java

http://stackoverflow.com/questions/693997/how-to-set-httpresponse-timeout-for-android-in-java

httpresponse share improve this question In my example two timeouts are set. The connection timeout throws java.net.SocketTimeoutException Socket is not connected and the socket timeout java.net.SocketTimeoutException The operation timed out ... this question In my example two timeouts are set. The connection timeout throws java.net.SocketTimeoutException Socket is not connected and the socket timeout java.net.SocketTimeoutException The operation timed out . HttpGet httpGet new HttpGet.. The connection timeout throws java.net.SocketTimeoutException Socket is not connected and the socket timeout java.net.SocketTimeoutException The operation timed out . HttpGet httpGet new HttpGet url HttpParams httpParameters new BasicHttpParams..

Https Connection Android

http://stackoverflow.com/questions/995514/https-connection-android

the Apache HTTP Client SchemeRegistry schemeRegistry new SchemeRegistry schemeRegistry.register new Scheme http PlainSocketFactory.getSocketFactory 80 schemeRegistry.register new Scheme https new CustomSSLSocketFactory 443 ThreadSafeClientConnManager.. Client SchemeRegistry schemeRegistry new SchemeRegistry schemeRegistry.register new Scheme http PlainSocketFactory.getSocketFactory 80 schemeRegistry.register new Scheme https new CustomSSLSocketFactory 443 ThreadSafeClientConnManager cm new ThreadSafeClientConnManager.. new Scheme http PlainSocketFactory.getSocketFactory 80 schemeRegistry.register new Scheme https new CustomSSLSocketFactory 443 ThreadSafeClientConnManager cm new ThreadSafeClientConnManager params schemeRegistry return new DefaultHttpClient..