{"id":8515,"date":"2020-08-22T23:35:05","date_gmt":"2020-08-22T23:35:05","guid":{"rendered":"http:\/\/putridparrot.com\/blog\/?p=8515"},"modified":"2020-08-22T23:35:05","modified_gmt":"2020-08-22T23:35:05","slug":"accessing-the-host-machine-via-the-android-emulator","status":"publish","type":"post","link":"https:\/\/putridparrot.com\/blog\/accessing-the-host-machine-via-the-android-emulator\/","title":{"rendered":"Accessing the host machine via the Android emulator"},"content":{"rendered":"<p>If you want to access a service\/server running on the host machine you need to use specially designated IP addresses, such as 10.0.2.2.<\/p>\n<p><em>Note: The following table is taken from <a href=\"https:\/\/developer.android.com\/studio\/run\/emulator-networking\" rel=\"noopener noreferrer\" target=\"_blank\">Network address space<\/a><\/em><\/p>\n\n<table id=\"tablepress-4\" class=\"tablepress tablepress-id-4\">\n<thead>\n<tr class=\"row-1\">\n\t<th class=\"column-1\">Network Address<\/th><th class=\"column-2\">Description<\/th>\n<\/tr>\n<\/thead>\n<tbody class=\"row-striping row-hover\">\n<tr class=\"row-2\">\n\t<td class=\"column-1\">10.0.2.1<\/td><td class=\"column-2\">Router\/gateway address<\/td>\n<\/tr>\n<tr class=\"row-3\">\n\t<td class=\"column-1\">10.0.2.2<\/td><td class=\"column-2\">Alias to your host loopback (i.e. 127.0.0.1 on the host machine)<\/td>\n<\/tr>\n<tr class=\"row-4\">\n\t<td class=\"column-1\">10.0.2.3<\/td><td class=\"column-2\">First DNS server<\/td>\n<\/tr>\n<tr class=\"row-5\">\n\t<td class=\"column-1\">10.0.2.4\/10.0.2.5\/10.0.2.6<\/td><td class=\"column-2\">Optional, second, third and fourth DNS server (if any)<\/td>\n<\/tr>\n<tr class=\"row-6\">\n\t<td class=\"column-1\">10.0.2.15<\/td><td class=\"column-2\">The emulated device network\/ethernet interface<\/td>\n<\/tr>\n<tr class=\"row-7\">\n\t<td class=\"column-1\">127.0.0.1<\/td><td class=\"column-2\">The emulated device loopback interface<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<!-- #tablepress-4 from cache -->\n","protected":false},"excerpt":{"rendered":"<p>If you want to access a service\/server running on the host machine you need to use specially designated IP addresses, such as 10.0.2.2. Note: The following table is taken from Network address space<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[120],"tags":[],"class_list":["post-8515","post","type-post","status-publish","format-standard","hentry","category-android"],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/posts\/8515","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/comments?post=8515"}],"version-history":[{"count":4,"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/posts\/8515\/revisions"}],"predecessor-version":[{"id":8521,"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/posts\/8515\/revisions\/8521"}],"wp:attachment":[{"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/media?parent=8515"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/categories?post=8515"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/tags?post=8515"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}