如何在android studio中将图像添加到模拟器库? [英] How to add an image to the emulator gallery in android studio?
问题描述
我正在开发一个图像过滤器应用程序。但如果我没有任何图像,就无法真正尝试。
I am developing an image filter app. But can't really try it if i don't have any images.
我知道我可以在手机上测试它,但它不一样,因为我需要错误信息和其他东西。
I know that i can test it in the phone, but it's not the same, since I need the error messages and other stuff.
我只是想从AVD的图库中访问图像,以便我可以测试我的应用程序。
如何添加一个?
I just want to access an image from the AVD's gallery so that I can test my app. How can I add one?
我正在使用Android Studio。我在Eclipse中看到了一些关于如何使用它的示例,但我没有使用它。
I am using Android Studio. I saw some examples on how to do it in Eclipse, but i am not using that.
那么,如何将图像添加到模拟器图库?
So, how can I add an image to the emulator image gallery?
推荐答案
如何使用Android Studio将图像导入Android虚拟设备的图库:
我正在使用Android Studio 1.4 .1和API 15虚拟设备。
How to import images into the gallery of an Android Virtual Device using Android Studio: I'm using Android Studio 1.4.1 and a API 15 virtual device.
警告:这是手动密集型的,因此它不适用于大量图像。
Warning: This is manual intensive so it is not a good solution for a large number of images.
- 使用Android的设备管理器(AVD),菜单 / Tools / Android / AVD Manager 创建虚拟设备。
- 启动此虚拟设备。
- 启动Android设备监视器,菜单* /工具/ Android / Android设备监视器。在 Devices 标签(左上角)中,您应该会看到您的设备。它应该是在线(参见此屏幕截图)
- 在右侧窗口中是文件资源管理器。转到那里,选择 / mnt / sdcard / Pictures 目录。应突出显示(请参阅此屏幕截图)
- 将jpegs添加到此通过单击将文件推送到设备图标(我在上面的屏幕截图中突出显示的小手机图标。目录,您可以一次只添加一张照片,dadburnit。
- 转到您的设备并运行开发工具应用。
- 向下滚动并选择媒体提供商。
- 点击扫描SD卡按钮。这应该将您在步骤5中添加的图像复制到图库。转到图库,看看,它们应该在那里。
- Create a virtual device using Android's Device Manager (AVD), Menu /Tools/Android/AVD Manager.
- Start this virtual device.
- Start the Android Device monitor, Menu */Tools/Android/Android Device Monitor. In the Devices tab (upper left) you should see your device. It should be Online (see this screenshot)
- On the right window is the File Explorer. Go there and select the /mnt/sdcard/Pictures directory. It should be highlighted (see this screenshot)
- Add jpegs to this directory by clicking on the Push a file onto the device icon (the little phone icon I highlighted in the above screenshot. You can add only one photo at a time, dadburnit.
- Go to your device and run the Dev Tools app.
- Scroll down and select Media Provider.
- Click on the Scan SD Card button. This should copy the images you added in step 5 to the gallery. Go to the gallery and look, they should be there.
这篇关于如何在android studio中将图像添加到模拟器库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!