Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>As mentioned by others, you need a couple of things to be able to connect your web-service:<br> - the emulator to know what is the IP address of the server you need to connect to<br> - the server name URL you connect through HTTPS must resolve to the domain of the SSL certificate</p> <p>To do that, you need to: </p> <ul> <li>mount your emulator partitions <code>writeable</code> </li> </ul> <p>From your desktop shell (example for linux but would be similar on windows, and assume the Android sdk is intalled on <code>/android-sdk</code>):</p> <pre><code>cd /android-sdk/tools/ ./emulator -avd NexusS -partition-size 128 </code></pre> <p>where NexusS is the AVD name of your device. You <code>MUST</code> start the emulator from command line or you will get an error in later steps.</p> <p>Now open another shell terminal and get your emulator /system/etc/hosts file: </p> <pre><code>cd /android-sdk/platform-tools ./adb remount ./adb pull /system/etc/hosts /tmp/ </code></pre> <p>The <code>remount</code> is to set the partitions writeable. The <code>pull</code> command above copies the hosts file to <code>/tmp/hosts</code> of your desktop.<br> From the desktop edit the /tmp/hosts file to match your need, i.e. if the Web Service is <a href="https://www.example.com/foo" rel="nofollow noreferrer">https://www.example.com/foo</a> and IP is 192.168.1.10:</p> <pre><code>127.0.0.1 locahost 192.168.1.10 www.example.com </code></pre> <p>Then push it back to the emulator: </p> <pre><code>cd /android-sdk/platform-tools ./adb push /tmp/hosts /system/etc/ </code></pre> <p>You should be able to connect to the web-service now. </p> <p>Note that you could still have error in case of a self-signed certificate.</p> <p>The image below is before editing the <code>hosts</code> file:<br> <img src="https://i.stack.imgur.com/F4gWH.png" alt="IP doesn&#39;t match the certificate"></p> <p>After editing:<br> <img src="https://i.stack.imgur.com/i6UxH.png" alt="Server name match"></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. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    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