Where do I find the Saved Image in Android?

亡梦爱人 提交于 2019-12-02 03:52:10

The getDir method of ContextWrapper will automatically create the imageDir directory if it does not already exist according to the docs. Additionally, you cannot access anything in the /data directory outside of your application code unless you have root access. If you would like to view the images you saved in this directory, you can run the adb tool in a command prompt to move the images into a publicly accessible directory:

adb shell run-as com.your.packagename cp -r /data/data/com.your.packagename/app_data/imageDir /sdcard/imageDir

Note that the run-as command will only work if your application is debuggable.

You can replace /sdcard/imageDir with any directory you have permission to access on the device. If you would like to subsequently move the files off the device and onto your machine, you can use adb pull to pull the files from the public directory:

adb pull /sdcard/myDir C:\Users\Desktop

Again, replace /sdcard/myDir and C:\Users\Desktop with the appropriate source and destination directories.

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