{"id":9991,"date":"2015-09-25T12:10:00","date_gmt":"2015-09-25T12:10:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/visualstudioalm\/2015\/09\/25\/network-simulation-and-more-in-the-vs-emulator-for-android\/"},"modified":"2022-08-02T02:29:16","modified_gmt":"2022-08-02T10:29:16","slug":"network-simulation-and-more-in-the-vs-emulator-for-android","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/devops\/network-simulation-and-more-in-the-vs-emulator-for-android\/","title":{"rendered":"Network simulation and more in the VS Emulator for Android"},"content":{"rendered":"<p>By now, hopefully you\u2019ve heard about <a href=\"http:\/\/blogs.msdn.com\/b\/visualstudioalm\/archive\/2014\/11\/12\/introducing-visual-studio-s-emulator-for-android.aspx\">the new Visual Studio Emulator for Android<\/a>, which is available as <a href=\"http:\/\/blogs.msdn.com\/b\/visualstudioalm\/archive\/2015\/07\/20\/you-can-now-acquire-the-visual-studio-emulator-for-android-on-its-own.aspx\">a standalone download for Eclipse and Android Studio users<\/a>. Today, we\u2019re issuing an update that addresses some of your top requests, including <strong>network simulation\u00a0<\/strong>and <strong>improved screenshot functionality<\/strong>. Let\u2019s take a look at what you can expect from the September update.<\/p>\n<h2>Network simulation<\/h2>\n<p>Apart from touch input, probably the most used feature of a device is network connectivity. Whether pulling down a list of high scores, streaming video, or uploading a photo to the backend, apps make heavy use of the network and need to be tested for robustness against a wide range of network conditions. What happens when signal strength is weak and a significant number of packets are dropped? How does your app control data consumption when connected to a 3G network where data may be metered versus a Wi-Fi network where data is probably not capped? These questions and more can be answered using our new network simulation feature in the emulator. Just open the emulator and navigate to the \u201cNetwork\u201d tab in the Additional Tools window.<\/p>\n<p style=\"text-align: center\">\n  <a href=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2015\/09\/6864.network20tab.png\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2015\/09\/6864.network20tab.png\" alt=\"\" border=\"0\" \/><\/a>\n<\/p>\n<p>By default, the emulator is set to appear connected to a Wi-Fi network, which uses the full speed and signal of the host computer. If you switch to Cellular, the Network type and Signal strength dropdowns will become active and you will see details of the network being simulated below them.<\/p>\n<p style=\"text-align: center\">\n  <a href=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2015\/09\/4118.network20sim.png\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2015\/09\/4118.network20sim.png\" alt=\"\" border=\"0\" \/><\/a>\n<\/p>\n<p>Changing the network type will do two things. First, it will throttle the download and upload bandwidth to match that of a typical network of that type. Second, it will change the network visible to Android to be the network type you selected. No network will appear available to Android when \u201cNo network\u201d is selected. This ensures that Android\u2019s networking APIs (e.g. <span style=\"font-family: courier new,courier\">android.net.NetworkInfo.getType()<\/span>) correctly return the network type being simulated. Note that this is something most other emulators forego\u2014they simply simulate the bandwidth of that network type and remain actually connected to Wi-Fi.<\/p>\n<p>Changing the signal strength will do three things. First, it will increase or decrease the percentage of upload and download packets dropped to match the signal strength specified (lower signal strength means higher packet loss). Second, it will modify the signal strength of the network that appears to Android, ensuring that Android APIs return correct values for signal strength (e.g. <span style=\"font-family: courier new,courier\">android.telephony.SignalStrength.getLevel()<\/span>). Finally, it will modify the bandwidth to match how bandwidth would be impacted by a weaker signal.<\/p>\n<h2>Improved screenshot functionality<\/h2>\n<p>Another piece of feedback we\u2019ve received is that the Screenshot tab sometimes captured a corrupted or mangled image. We\u2019ve fixed this and enabled the ability to use <span style=\"font-family: courier new,courier\">adb shell screencap<\/span> to grab an image as well.<\/p>\n<h2>Wrap up<\/h2>\n<p>This update will appear as a notification in your Emulator Manager and in Visual Studio\u2019s Notification Hub if Visual Studio is installed. If you haven\u2019t tried out the emulator, <a href=\"https:\/\/aka.ms\/blogdownloadvsemu\">you can download it directly<\/a> or <a href=\"https:\/\/aka.ms\/vsemu\">visit our website for more information<\/a>. Thanks for the continued feedback\u2014keep it coming by commenting below, using the Send-a-Smile tool in Visual Studio or in the Emulator Manager, or asking for help on <a href=\"http:\/\/stackoverflow.com\/questions\/tagged\/android-emulator\">StackOverflow using the android-emulator and visual-studio tags<\/a> (but first, <a href=\"https:\/\/msdn.microsoft.com\/en-us\/library\/mt228282.aspx\">check our troubleshooting document<\/a> for common problems)!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>By now, hopefully you\u2019ve heard about the new Visual Studio Emulator for Android, which is available as a standalone download for Eclipse and Android Studio users. Today, we\u2019re issuing an update that addresses some of your top requests, including network simulation\u00a0and improved screenshot functionality. Let\u2019s take a look at what you can expect from the [&hellip;]<\/p>\n","protected":false},"author":164,"featured_media":45953,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1,225],"tags":[],"class_list":["post-9991","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-devops","category-git"],"acf":[],"blog_post_summary":"<p>By now, hopefully you\u2019ve heard about the new Visual Studio Emulator for Android, which is available as a standalone download for Eclipse and Android Studio users. Today, we\u2019re issuing an update that addresses some of your top requests, including network simulation\u00a0and improved screenshot functionality. Let\u2019s take a look at what you can expect from the [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/posts\/9991","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/users\/164"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/comments?post=9991"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/posts\/9991\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/media\/45953"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/media?parent=9991"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/categories?post=9991"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/tags?post=9991"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}