c# - 如何直接或通过 Visual Studio(Xamarin 项目)将图像添加到 Android 模拟器

标签 c# android visual-studio xamarin xamarin.android

我目前正在使用 Visual Studio 2015 创建一个 Android 应用程序。它需要在 AVD 中有一个图像来测试应用程序。

我们如何在 Visual Studio (Xamarin Project) 中将图像添加到我们模拟的 Android 设备?

我在 EclipseAndroid Studio(基于Java)中看到了一些问题和答案:

  1. How to add an image to the emulator gallery in android studio?
  2. How we save image in gallery of emulator
  3. upload picture to emulator gallery

但我找不到在 Visual Studio 中执行此操作的方法。

如果我尝试在我的模拟器中使用摄像头,它会显示摄像头错误,无法连接到摄像头。

enter image description here

因此,自然地,我试图找到一种方法,通过 VS 或直接将图像直接放入模拟的 Android 设备的文件夹中。

有什么想法吗?

最佳答案

So, naturally I am trying to find a way to just put an image directly to the emulated Android device's folder either through VS or directly.

您可以使用DDMS

  1. 使用 VS 2015 运行您的模拟器。

  2. 打开DDMS:

enter image description here

  1. 使用 文件资源管理器 查找存储 -> 模拟 -> 0 -> 图片文件夹。

  2. 将您的图片从您的 PC 拉到此文件夹。

  3. 重新启动您的 AVD,然后您可以从 PhotoGallery 应用程序中找到该文件。

enter image description here

关于c# - 如何直接或通过 Visual Studio(Xamarin 项目)将图像添加到 Android 模拟器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43538453/

相关文章:

c# - 如何从 pdf 文件中提取附件?

c# - JSON 请求太大,无法反序列化

c# - 将 Visual Studio C# 项目转换为安装文件

android - 如何使用 Robolectric 测试异步代码

C# - 不同的 .NET 框架版本

c# - Accord.NET Framework 中的多个绘图

android - 如何删除 android studio 中的 lint 错误

android - 如何计算各种分辨率的字体大小?

visual-studio - 带有 Visual Studio 2017 RC 的 HoloLens 模拟器

c++ - 如何在 Visual Studio 2008 中折叠选定的代码块?