Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by CitrusDev · Sep 26, 2012 at 10:23 AM · androidfilesfile-iotextfile

android browse and read text files

Hi everyone, I read a lot but nothing will help

In my project I have folders with sub-folders and containing txt-files. the amount of txt-files is dynamic it would be nice if the app ( android ) could browse the folders by it self an load an file

This means, I wont use Ressource.Load because the program should decide it, which txt file should be loaded the functions Application.persistentDataPath and Application.dataPath wont point me to the "right" txt-folder, especially there isnt a folder at this path

where is my "lovely" folder wich I created in Unity and how can I access it on android ?

after hours of trying and searching I hope you could help me

thank a lot !

Comment
Add comment · Show 2
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image dscroggi · Sep 26, 2012 at 12:03 PM 0
Share

I'm not sure if this works on Android but have your tried converting the txt to xml and using an xmlreader?

http://msdn.microsoft.com/en-us/library/system.xml.xmlreader.aspx

avatar image CitrusDev · Sep 26, 2012 at 01:17 PM 0
Share

no i haven't mh .. actually I don't need xml files parsing cost time and cpu :\

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by hvilela · Sep 26, 2012 at 08:21 PM

I would recommend to use a XML, JSON or even a simple TXT file just to describe your folder/file structure. So you can read this file when your app start and based on the content you can use Resource.Load to load any specific file.

Comment
Add comment · Show 3 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image CitrusDev · Sep 27, 2012 at 03:37 PM 0
Share

currently this is my solution

avatar image hvilela · Sep 27, 2012 at 03:40 PM 0
Share

So I'm sorry, but your problem is not clear to me.

avatar image CitrusDev · Sep 27, 2012 at 03:54 PM 0
Share

no problem :) the thing is, now i have to define which files are there to load, with the index-file but i would search my pre created ( in unity ) folder for files which are stored in there, without an index file

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

10 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

How to tell android to open a file 0 Answers

Get Contents of Folder Using UnityWebRequest 0 Answers

Save a reachable file on the android device 1 Answer

[Android] Resources folder: number of files limit? 0 Answers

Files on mobile devices 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges