Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>1.) I assume that this question does not refer to the WebView question. From within your app, you can create connections to your server using <code>java.net.Socket</code> or <code>java.nio.channels.SocketChannel</code>. I prefer SocketChannel as it has some features that the basic Socket does not have (e.g. non-blocking mode).</p> <p>With this class it's fairly easy to communicate with your server, for example:</p> <pre><code>// this code has not been tested (!) // Username and Password will be sent in a single string to the server, namely "username|password" String username = "foo"; String password = "bar"; // Open Socket connection to the Server example.com at Port 12345 SocketChannel sock = SocketChannel.open(new InetSocketAddress("example.com", 12345)); // send user credentials to server String data = username + "|" + password; sock.write(ByteBuffer.wrap(data.getBytes())); // await response from server ByteBuffer result = ByteBuffer.allocate(8); // 8 byte-large container for result fSocket.read(result); // The first byte of the response decides wether login failed or succeeded (just as an example!) if (result.get(0) == 1) { // login succeeded } else { // login failed } </code></pre> <p>However, if you use the blocking mode, I would suggest to move the connection handling in its own thread. For mor information on Socket communication, see the <a href="http://developer.android.com/reference/java/net/Socket.html" rel="nofollow">Socket</a> and <a href="http://developer.android.com/reference/java/nio/channels/SocketChannel.html" rel="nofollow">SocketChannel</a> documentation.</p> <p>2.) If the Page is not found, maybe the URL is in a wrong format? Some details would help here.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload