"Media not found." How to insert an image in android

I am new to Android programming, so I will be very grateful if someone helps me.

I am trying to implement steganography in android, but my problem is that I do not know how to embed images in android. Because of what I get "No media found" . Please help me with this.

I tried

c:> adb push c: \ image1.png / sdcard / image1.png

But I get this on the command line.

could not copy 'c: \ image1.png' to 'sdcard / image1.png': read-only file system

+4
source share
2 answers

The correct directory for my mnt/sdcard . This works for me:

 adb push README mnt/sdcard 

Also note that you can explore directories with adb shell ls <path> , which could redirect you to the correct path.

Edit - apparently sdcard is a symbolic link to mnt/sdcard and works for me. A file named image1.png also works. Maybe there is a problem file already located in this place?

Change 2 . I think you also need to disable the USB mount option when you use adb for push files. It looks like you have this, given your comment that the gallery does not find your media.

+2
source

I had the same problem, so in case someone lands on this page, here's how I solved it

  • When creating an emulator device (I use IntelliJ IDEA) - do not forget to move the switch to the "Size" option on the SDCard and specify the required size, so a new SDCard will be created and mounted on the emulator. There are some command line parameters in eclipse that you can pass (or something else, I'm not sure, since I only read it on the stackoverflow).
  • After that, I stopped getting the "Read-only file system" error, but I tried and tried to copy the files to the SD card using: adb push image.jpg / sdcard / image.jpg or adb push image.jpg / mnt / sdcard / image.jpg but was getting a β€œNo media” error in my application or when I went to the gallery. So I went to Dev Tools for emulator applications, and then to Media Scanner. He quickly looked through the SD card and the boom - I finally saw my images.

Hope this helps :)

+16
source

Source: https://habr.com/ru/post/1345431/


All Articles