How to Add an Image to Android Emulator Directly o

2019-09-14 17:27发布

问题:

I currently am creating an Android application using Visual Studio 2015. It requires to have an image in the AVD to test the application.

How do we add image to our emulated Android device in Visual Studio (Xamarin Project)?

I have seen some questions and answers to do so in Eclipse or Android Studio (Java-based):

  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

But I cannot find one to do it in Visual Studio.

If I try to use camera in my emulator, it shows camera error, cannot connect to camera.

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.

Any idea?

回答1:

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.

You can use DDMS.

  1. Run your emulator with VS 2015.

  2. Open DDMS:

  1. Use File Explorer to find storage -> emulated -> 0 ->Pictures folder.

  2. Pull your picture from your PC to this folder.

  3. Restart your AVD, then you can find the file from Photo or Gallery app.