Where do I find the Saved Image in Android?

后端 未结 1 1688
伪装坚强ぢ
伪装坚强ぢ 2021-01-24 17:06

Excuse me, quick question:

I have this routine of video stream, where I receive packets, convert them to byte[] ,then to bitmaps, then display them on the screen:

<
相关标签:
1条回答
  • 2021-01-24 17:31

    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.

    0 讨论(0)
提交回复
热议问题