简体   繁体   中英

Have a user upload an image to the Android Resources/drawable folder

I need the user to be able to upload an image, and then have the image be able to be accessed later for drawing it. I only know how to show an image in the Android Resources/drawable folder. I don't think it is possible for a user to upload an image there, so is there another place they can upload it, and then have the image to be used? I don't know how to have the user to be able to upload it either.

I only know how to show an image with the xaml code <Image Source="image.png"/> , where image.png is in the Android Resources/drawable folder

Since Resources contained in out raw directory of our project will be packaged inside our APK and will not be writeable at runtime.

So I highly recommend that you use Internal or External Data Storage to store your images and text file.

For more details, you can check: https://docs.microsoft.com/en-us/xamarin/android/platform/files/

And at the bottom of this page: External storage , there is a example which function is to save text file in External storage, it should be helpful for you.

The sample link is here: https://github.com/xamarin/monodroid-samples/tree/master/LocalFiles

If you want to choose Photos and Video, you can use MediaPlugin of jamesmontemagno. Of course, you can achieve this function yourself.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM