Android Question error- file ot found mnt\sdcard\Android\data\...

sarkis

Member
Licensed User
Longtime User
Hello,
I am trying to write a txt file to the local hard drive while debugging.
Here are commands.
Dim WriteLevel, WriteWay As TextWriter
WriteLevel.Initialize(File.OpenOutput(File.DirDefaultExternal, fileName ,False))
Path for fileName was configured while running AVD manager to the original file.
Compiler created a folder by the name "fileName.lock" and a file within by the name "pid"
The first question is what means "mnt" in line mnt\sdcard\Android\data\...
How to write a file to any folder in the local drive
Thanks
 
Last edited:

Devv

Active Member
Licensed User
Longtime User
why dont you use file write ?

B4X:
  File.WriteString(File.DirDefaultExternal,"test.txt","this is a test")
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
They also work properly if you use the right path.
If you think it is not lik this then you should create a thread describing what you want to to, what you have done (your code (Export as zip)) and what errors you get
 
Upvote 0

sarkis

Member
Licensed User
Longtime User
They also work properly if you use the right path.
If you think it is not lik this then you should create a thread describing what you want to to, what you have done (your code (Export as zip)) and what errors you get
Well,
If I use CD card everything is ok.
Error appearing when I am trying to use file.
I set a path from AVD manager.
Here are commands.

Dim WriteLevel As TextWriter
WriteLevel.Initialize(File.OpenOutput(File.DirDefaultExternal, fileName ,False))
I get an error "file not found mnt\sdcard\Android\data\...fileName"

Thanks
 
Upvote 0

sarkis

Member
Licensed User
Longtime User
What is the exacpt path and filename?
Note that the files in the android\data\yourpackage\files\ are your ASSETS files (files-tab in the ide). This path is read only. You should use a writeable path to store files... File.DirRootExternal for ex.

I tried File.DirDefaultExternal but I dont know where to start .
From C:\... or file\
 
Upvote 0

sarkis

Member
Licensed User
Longtime User
You can not store a file in Windows fron your app
I tried both DirDefaultExternal and DirRootExternal and every time i get the same error file not found with permission denied.
And in both cases it was created folder by name filename.lock and a "pid" named file 1kb within.
Anyway thank you for help
Thanks
 
Upvote 0

sarkis

Member
Licensed User
Longtime User
The folders was crated by system ,not by me
I only choose the path in AVD and run debugger
with commands
Dim WriteLevel As TextWriter
WriteLevel.Initialize(File.OpenOutput(File.DirDefaultExternal, fileName ,False))
files was crated.
 
Upvote 0

sarkis

Member
Licensed User
Longtime User
What exactly do you want to do with the information in this file during debuging?
For debugging you have other possibilities like Breakpoints and the Log.
These would be much more efficient than writing data in a file.
Thank you for responding
That information I need to save for another application , not for a debugging purposes.
Thank you again
 
Upvote 0

klaus

Expert
Licensed User
Longtime User
From your first post:
I am trying to write a txt file to the local hard drive while debugging.
That's why I understood that is was for debugging.
If I understood well, you use an Emulator.
Did you set a size for the SDCard ?
Beginner's Guide chpater 6.2 Create a new Emulator.
 
Upvote 0

sarkis

Member
Licensed User
Longtime User
From your first post:

That's why I understood that is was for debugging.
If I understood well, you use an Emulator.
Did you set a size for the SDCard ?
Beginner's Guide chpater 6.2 Create a new Emulator.

Yes I did.
But now I am using phone connected with usb and it seems there is no problem ... till now.
 
Upvote 0

sarkis

Member
Licensed User
Longtime User
From your first post:

That's why I understood that is was for debugging.
If I understood well, you use an Emulator.
Did you set a size for the SDCard ?
Beginner's Guide chpater 6.2 Create a new Emulator.

By the way I have a question
Can you participate to the one of my project?
Do you have time?
Let me know. Here is my email.
[email protected]
Thanks
 
Upvote 0
Top