简体   繁体   中英

How do I store text files in the Android Directory on Installation in a Xamarin Project?

I have a bunch of resource text files that I don't want to embed in my Xamarin Project. When I install my app I want to text files to be transferred to the phones android directory at

data/data/$ProjectName/files

Which is the FileSystem's LocalStorage. How do I set up my Xamarin project to do this?

Currently I put all of the files in a folder and set the files to CopyAlways, and when I build they go into the project's Debug Folder. But when I run the project on my phone, nothing is showing up in the localstorage folder. My Xamarin project is PCL and I am exporting to an Android Phone with SDK 23.

Deploy them as Android Assets instead. Then your app can either read them directly from Assets, or can copy them to local storage. Your app has to explicitly write things to local storage - there is no automated build action that will do this for you.

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