Find SD card volume label on Android

こ雲淡風輕ζ 提交于 2019-12-05 03:14:10

I have found a solution.

The easiest solution is to build busybox and use it like this: busybox blkid

Complicated solution is to find blkid for Android and find what you need in its source code (blkid_dev_devname function).

i don't know how it works exactly in android, but in linux i have kernel message about mounting sd-card, where volume name specified. You can try dmesg and cat /sys/devices/mmc... (or somethong like that)

Try to parse output of blkid command. It works for me, but I'm not sure if it is a firmware depended feature or not. I got permission denied with this command on AVD.

No More Hello World

I don't know if this can help you: if you use the DDMS you can see the folders of the system. In my case, I found the sd card in: /mnt/media_rw.

You can get more information here and here

I hope it helps.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!