- Home /
Why an Android build doesnt make a _Data file.
Hello guys! I have a question. You know that when you build your game for PC in the folder there is a _Data file. But why when i build it for Android there isnt one?
I made a chatbot, and in the _Data folder there is all its "knowledge" if you know what i mean. There is a folder "StreamingAssets" and in that folder there are all the XML and AIML files. And the deal is that without it it cant work correctly. When i upload it to the phone i can open the chatbot, write to it but it doesnt respond, and i think its doesnt respond because the _Data folder is missing.
Thanks and have a good day :)
Okay, lets explain it :) So, i made a chatbot, and in the _Data file there is all its "knowledge" if you know what i mean. There is a folder "Strea$$anonymous$$gAssets" and in that folder there are all the X$$anonymous$$L and AI$$anonymous$$L files. And the deal is that without it it cant work correctly. When i upload it to the phone i can open the chatbot, write to it but it doesnt respond, and i think its doesnt respond because the _Data folder is missing. If you want just give me your skype so i can send you the project to see whats the real problem
Answer by tanoshimi · Oct 30, 2016 at 08:28 AM
Because Android applications don't have an exposed folder structure - they are packaged in .APK files. I can't possibly imagine how this causes you a big issue.
Okay, lets explain it :) So, i made a chatbot, and in the _Data file there is all its "knowledge" if you know what i mean. There is a folder "Strea$$anonymous$$gAssets" and in that folder there are all the X$$anonymous$$L and AI$$anonymous$$L files. And the deal is that without it it cant work correctly. When i upload it to the phone i can open the chatbot, write to it but it doesnt respond, and i think its doesnt respond because the _Data folder is missing. If you want just give me your skype so i can send you the project to see whats the real problem It may not be the real problem but i dont know.
You should place your X$$anonymous$$L files in the /Resources folder of your project and access them like this:
TextAsset textAsset = (TextAsset) Resources.Load("$$anonymous$$yX$$anonymous$$LFile");
XmlDocument xmldoc = new XmlDocument ();
xmldoc.LoadXml ( textAsset.text );
(this loads the file at Resources/$$anonymous$$yX$$anonymous$$LFile.xml)
Thank you very much sir! You truly are a savior! Have a good day!
No, a folder named "Resources" within your assets folder. If it doesn't exist just create one. https://docs.unity3d.com/ScriptReference/Resources.html
Okay i put the folder with the X$$anonymous$$L files in the Resources folder but what about the AI$$anonymous$$L files, is it the same thing? Put them in there?
Then I recommend you do some more research or follow some of the tutorials on the Unity site about how to access resources in your project - it's pretty fundamental to your application so worth making sure you have a thorough understanding.