# Reading text files from the Android document folder?

**URL:** <https://forum.xojo.com/t/reading-text-files-from-the-android-document-folder/87705>\
**Category:** Android\
**Created:** [February 16, 2026, 6:57pm UTC](https://forum.xojo.com/t/reading-text-files-from-the-android-document-folder/87705 "2026-02-16T18:57:16Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![James\_Bailey](https://forum.xojo.com/user_avatar/forum.xojo.com/james_bailey/32/3337_2.png) [@James\_Bailey](https://forum.xojo.com/u/James_Bailey)\
**Post date:** [February 16, 2026, 6:57pm UTC](https://forum.xojo.com/t/reading-text-files-from-the-android-document-folder/87705/1 "2026-02-16T18:57:16Z")

</div>

The code I am porting to Android from iPad seems to be successfully writing text files using SpecialFolder.Documents, but I do not know how to verify this. Is there a way to open such a file inside the Android simulator.

---

<div class="post-metadata">

**Author:** ![Jeremie\_L](https://forum.xojo.com/user_avatar/forum.xojo.com/jeremie_l/32/150_2.png) [@Jeremie\_L](https://forum.xojo.com/u/Jeremie_L)\
**Post date:** [February 16, 2026, 8:50pm UTC](https://forum.xojo.com/t/reading-text-files-from-the-android-document-folder/87705/2 "2026-02-16T20:50:38Z")

</div>

This might work. First print the location in Xojo messages panel:  
System.debugLog(file.NativePath)

Then in Android Studio there is a feature to navigate in the system files of the simulator.

I’m not in front of my computer right now, I can offer more guidance later if needed.

---

<div class="post-metadata">

**Author:** ![MarkusR](https://forum.xojo.com/user_avatar/forum.xojo.com/markusr/32/685_2.png) [@MarkusR](https://forum.xojo.com/u/MarkusR)\
**Post date:** [February 17, 2026, 12:55pm UTC](https://forum.xojo.com/t/reading-text-files-from-the-android-document-folder/87705/3 "2026-02-17T12:55:02Z")

</div>

try files app from google or any file manager.  
android have a virtual file system, possible your file is hidden or not listed.  
if you can write the file you could open the file from xojo.

---

<div class="post-metadata">

**Author:** ![James\_Bailey](https://forum.xojo.com/user_avatar/forum.xojo.com/james_bailey/32/3337_2.png) [@James\_Bailey](https://forum.xojo.com/u/James_Bailey)\
**Post date:** [February 17, 2026, 3:04pm UTC](https://forum.xojo.com/t/reading-text-files-from-the-android-document-folder/87705/4 "2026-02-17T15:04:49Z")

</div>

Thank you for the suggestions. My obstacle is that the code that creates the file is randomized and creates a different one each time. I thought I could go over to my iPad Mobile version, give it a constant seed, then dive down into the core simulator folder of the Mac where I am running the simulators, get the file it produces, put it into a constant in my Android version, and then run the Android with the same seed and compare. No such luck. Given the same seed, iOS and Android give different results. (Mac Desktop gives a third.) I will keep trying to figure out a way to test.

---

<div class="post-metadata">

**Author:** ![Tim\_Parnell](https://forum.xojo.com/user_avatar/forum.xojo.com/tim_parnell/32/161_2.png) [@Tim\_Parnell](https://forum.xojo.com/u/Tim_Parnell)\
**Post date:** [February 18, 2026, 4:32pm UTC](https://forum.xojo.com/t/reading-text-files-from-the-android-document-folder/87705/5 "2026-02-18T16:32:42Z")

</div>

Since all three platforms give different results, it sounds like your core algorithm has a flaw.

Build that in a separate project so it’s easier to debug _and then_ put it in your main project.

---

<div class="post-metadata">

**Author:** ![James\_Bailey](https://forum.xojo.com/user_avatar/forum.xojo.com/james_bailey/32/3337_2.png) [@James\_Bailey](https://forum.xojo.com/u/James_Bailey)\
**Post date:** [February 19, 2026, 9:27pm UTC](https://forum.xojo.com/t/reading-text-files-from-the-android-document-folder/87705/6 "2026-02-19T21:27:38Z")

</div>

I certainly did find a flaw in my code. “DownTo” was not behaving. Changing a For Next loop to a While Wend solved that. As for the random numbers, I tried the attached little code on Mac and Android and seem to get very different results after a thousand calls to the random generator. I wonder if you see the same.

[RandomTest Text.txt.zip](https://forum.xojo.com/uploads/short-url/1h4FUCCJUJ4pmpl7vU1AaOc6Wwm.zip) (769 Bytes)
